diff --git a/.travis.yml b/.travis.yml index 180baad..7883115 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,11 @@ language: python python: - - '3.5' + - '3.7' + - '3.8' install: - pip install -r requirements.txt - - pip install . + - pip install '.[all]' - pip install pyflakes script: - pyflakes smart_fact_crawler - - python setup.py test + - pytest diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..8efdcbd --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +graft smart_fact_crawler/resources diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..121a39f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools >= 40.6.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 701dbeb..8a41fed 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,11 @@ from setuptools import setup +extras_require = { + "tests": ['pytest>=3.0', 'freezegun'], +} +extras_require['all'] = extras_require['tests'] + + setup( name='smart_fact_crawler', @@ -12,16 +18,13 @@ packages=[ 'smart_fact_crawler', ], - package_data={ - 'smart_fact_crawler': [ - 'resources/20160703_233149/*.data', - 'resources/20160703_233149_broken_fsc/fsc.data', - ] - }, install_requires=[ 'requests', ], - tests_require=['pytest>=3.0', 'freezegun'], - setup_requires=['pytest-runner'], - zip_safe=True, + include_package_data=True, + package_data={ + 'smart_fact_crawler': ['resources/*'], + }, + extras_require=extras_require, + zip_safe=False, ) diff --git a/smart_fact_crawler/__init__.py b/smart_fact_crawler/__init__.py index a281740..c0cfe84 100644 --- a/smart_fact_crawler/__init__.py +++ b/smart_fact_crawler/__init__.py @@ -245,7 +245,7 @@ def status(url=None, timeout=None, fallback=False): storage_newdaq = Quantity(s2f(value), unit) value, unit = get(table, 32, 1, default='nan nan').split(' ')[:2] - storage_daq = Quantity(s2f(value), unit) + storage_newdata = Quantity(s2f(value), unit) return to_namedtuple('StatusPage', { 'timestamp': sft2dt(get(table, 0, 0)), @@ -280,7 +280,7 @@ def status(url=None, timeout=None, fallback=False): 'chat_server': get(table, 29, 1), 'skype_client': get(table, 30, 1), 'free_space_newdaq': storage_newdaq, - 'free_space_daq': storage_daq, + 'free_space_newdata': storage_newdata, 'smartfact_runtime': get(table, 33, 1), })