Skip to content

Commit

Permalink
Make sure Astral 2 or higher is installed
Browse files Browse the repository at this point in the history
Also enforce Python 3.6 which is required by Astral 2
  • Loading branch information
Mark Ruys committed Jun 29, 2020
1 parent 868031c commit 5cb515e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ README.rst: README.md
pandoc --from markdown --to rst --output=README.rst README.md

dist: README.rst
rm -fr dist
python3 setup.py sdist bdist_wheel

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gw2pvo is a command line tool to upload solar data from a GoodWe power inverter
You need to have Python 3 and pip installed. Then:

```shell
sudo pip3 install https://github.com/markruys/gw2pvo/releases/download/1.3.2/gw2pvo-1.3.2-py3-none-any.whl
sudo pip3 install https://github.com/markruys/gw2pvo/releases/download/1.3.3/gw2pvo-1.3.3-py3-none-any.whl
```

Next determine the Station ID from the GoodWe site as follows. Open the [Sems Portal](https://www.semsportal.com). The Plant Status will reveal the Station ID in the URL. Example:
Expand Down
2 changes: 1 addition & 1 deletion gw2pvo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "1.3.2"
__version__ = "1.3.3"

__all__ = [ 'gw_api', 'gw_csv', 'pvo_api' ]
9 changes: 7 additions & 2 deletions gw2pvo/__main__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#!/usr/bin/env python3

import sys
if sys.version_info < (3,6):
sys.exit('Sorry, you need at least Python 3.6 for Astral 2')

import logging
import argparse
import locale
import time
from datetime import datetime

from astral import LocationInfo
from astral.geocoder import lookup, database
from astral.location import Location

from gw2pvo import ds_api
from gw2pvo import gw_api
from gw2pvo import gw_csv
Expand Down Expand Up @@ -106,8 +111,8 @@ def run():
parser.add_argument("--gw-station-id", help="GoodWe station ID", metavar='ID', required=True)
parser.add_argument("--gw-account", help="GoodWe account", metavar='ACCOUNT', required=True)
parser.add_argument("--gw-password", help="GoodWe password", metavar='PASSWORD', required=True)
parser.add_argument("--pvo-system-id", help="PVOutput system ID", metavar='ID', required=not True)
parser.add_argument("--pvo-api-key", help="PVOutput API key", metavar='KEY', required=not True)
parser.add_argument("--pvo-system-id", help="PVOutput system ID", metavar='ID')
parser.add_argument("--pvo-api-key", help="PVOutput API key", metavar='KEY')
parser.add_argument("--pvo-interval", help="PVOutput interval in minutes", type=int, choices=[5, 10, 15])
parser.add_argument("--darksky-api-key", help="Dark Sky Weather API key")
parser.add_argument("--log", help="Set log level (default info)", choices=['debug', 'info', 'warning', 'critical'], default="info")
Expand Down
15 changes: 7 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
https://github.com/markruys/gw2pvo
"""

import sys
if sys.version_info < (3,3):
sys.exit('Sorry, you need at least Python 3.3.0')

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
Expand Down Expand Up @@ -59,9 +55,9 @@
'License :: OSI Approved :: MIT License',

'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],

# What does your project relate to?
Expand All @@ -79,7 +75,10 @@
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=['astral', 'requests'],
install_requires=['astral>=2', 'requests'],

# Astral >=2 requires Python>=3.6
python_requires='>=3.6',

# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
Expand Down

0 comments on commit 5cb515e

Please sign in to comment.