From af50e8bf911a55892391ba5bf490c2f78e2af866 Mon Sep 17 00:00:00 2001 From: spl0k Date: Sun, 29 Apr 2018 14:51:30 +0200 Subject: [PATCH] Rewritten dependencies and don't use pip as a library Closes #97, #98 --- .travis.yml | 3 +-- README.md | 10 ++++++++-- requirements.txt | 6 ------ setup.py | 21 +++++++++++++++------ travis-requirements.txt | 6 ++++++ 5 files changed, 30 insertions(+), 16 deletions(-) delete mode 100644 requirements.txt create mode 100644 travis-requirements.txt diff --git a/.travis.yml b/.travis.yml index 90f182c..fab5014 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ python: - 3.5 - 3.6 install: - - pip install -r requirements.txt - - pip install lxml coverage codecov + - pip install -r travis-requirements.txt script: coverage run setup.py test after_script: codecov diff --git a/README.md b/README.md index 815e058..9d0accc 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,12 @@ You'll need these to run _Supysonic_: * [Python Imaging Library](https://github.com/python-pillow/Pillow) * [requests](http://docs.python-requests.org/) * [mutagen](https://mutagen.readthedocs.io/en/latest/) -* [watchdog](https://github.com/gorakhargosh/watchdog) +* [watchdog](https://github.com/gorakhargosh/watchdog) (if you want to use the + [watcher](#watching-library-changes)) You can install all of them using `pip`: - $ pip install -r requirements.txt + $ pip install . You may also need a database specific package: @@ -218,6 +219,11 @@ print anything to the console. If you want to keep it running in background, either use the old `nohup` or `screen` methods, or start it as a simple _systemd_ unit (unit file not included). +It needs some additional dependencies which can be installed with the following +command: + + $ pip install -e .[watcher] + ## Upgrading Some commits might introduce changes in the database schema. When that's the diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7c1623b..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -flask>=0.11 -pony>=0.7.2 -Pillow -requests>=1.0.0 -mutagen>=1.33 -watchdog>=0.8.0 diff --git a/setup.py b/setup.py index 98bea82..352b9e3 100755 --- a/setup.py +++ b/setup.py @@ -14,10 +14,19 @@ import supysonic as project from setuptools import setup from setuptools import find_packages -from pip.req import parse_requirements -from pip.download import PipSession +reqs = [ + 'flask>=0.11', + 'pony>=0.7.2', + 'Pillow', + 'requests>=1.0.0', + 'mutagen>=1.33' +] +extras = { + 'watcher': [ 'watchdog>=0.8.0' ] +} + setup( name=project.NAME, version=project.VERSION, @@ -29,13 +38,13 @@ setup( url=project.URL, license=project.LICENSE, packages=find_packages(), - install_requires=[str(x.req) for x in - parse_requirements('requirements.txt', session=PipSession())], + install_requires = reqs, + extras_require = extras, scripts=['bin/supysonic-cli', 'bin/supysonic-watcher'], zip_safe=False, include_package_data=True, - test_suite="tests.suite", - tests_require = [ 'lxml' ], + test_suite='tests.suite', + tests_require = [ 'lxml' ] + [ r for er in extras.values() for r in er ], classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', diff --git a/travis-requirements.txt b/travis-requirements.txt new file mode 100644 index 0000000..f8a0e25 --- /dev/null +++ b/travis-requirements.txt @@ -0,0 +1,6 @@ +-e .[watcher] + +lxml +coverage +codecov +