From 00aeb6dbf5fcb0b561efacab199c1c4e22d81ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Fri, 3 May 2019 21:33:40 +0200 Subject: [PATCH 1/5] Move install dependencies to setup.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use setup.py for Python dependency resolution and installing rather than specifying them individually in the .travis.yml file or in the requirements.txt file. See also https://caremad.io/posts/2013/07/setup-vs-requirement/ Signed-off-by: Frederik “Freso” S. Olesen --- .travis.yml | 3 +-- requirements.txt | 7 +------ setup.py | 7 +++++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07289baf..9235aa1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,9 +16,8 @@ env: install: # Dependencies - sudo apt-get -qq update - - pip install --upgrade -qq pip + - pip install --upgrade -qq pip setuptools - sudo apt-get -qq install cdparanoia cdrdao flac gir1.2-glib-2.0 libcdio-dev libgirepository1.0-dev libiso9660-dev libsndfile1-dev sox swig libcdio-utils - - pip install musicbrainzngs mutagen pycdio==0.21 PyGObject requests setuptools setuptools_scm # Testing dependencies - pip install twisted flake8 diff --git a/requirements.txt b/requirements.txt index c62bb6df..d6e1198b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1 @@ -musicbrainzngs -mutagen -pycdio>0.20 -PyGObject -requests -setuptools_scm +-e . diff --git a/setup.py b/setup.py index bbcfa0b4..82f1439a 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,13 @@ python_requires='>=2.7,<3', packages=find_packages(), setup_requires=['setuptools_scm'], + install_requires=[ + 'musicbrainzngs', + 'mutagen', + 'pycdio>0.20', + 'PyGObject', + 'requests', + ], entry_points={ 'console_scripts': [ 'whipper = whipper.command.main:main' From 04bfb4bd70abde34f19159cbeffe3cc65479bbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Fri, 3 May 2019 21:45:15 +0200 Subject: [PATCH 2/5] setup.py: Add classifiers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://pypi.org/classifiers/ and https://packaging.python.org/guides/distributing-packages-using-setuptools/#classifiers Signed-off-by: Frederik “Freso” S. Olesen --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 82f1439a..05ba600f 100644 --- a/setup.py +++ b/setup.py @@ -26,4 +26,16 @@ data_files=[ ('share/metainfo', ['com.github.whipper_team.Whipper.metainfo.xml']), ], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Intended Audience :: End Users/Desktop', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', # noqa: E501 + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 2 :: Only', + 'Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping', + ], ) From 2579ae35268608d6c6c3abca3f07db0d8483a991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Fri, 3 May 2019 21:56:31 +0200 Subject: [PATCH 3/5] setup.py: Add test and lint requirements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Frederik “Freso” S. Olesen --- .travis.yml | 7 ++----- setup.py | 4 ++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9235aa1f..d9f30afd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,9 +19,6 @@ install: - pip install --upgrade -qq pip setuptools - sudo apt-get -qq install cdparanoia cdrdao flac gir1.2-glib-2.0 libcdio-dev libgirepository1.0-dev libiso9660-dev libsndfile1-dev sox swig libcdio-utils - # Testing dependencies - - pip install twisted flake8 - # Build bundled C utils - cd src - sudo make install @@ -31,5 +28,5 @@ install: - python setup.py install script: - - if [ ! "$FLAKE8" = true ]; then python -m unittest discover; fi - - if [ "$FLAKE8" = true ]; then flake8 --benchmark --statistics; fi + - if [ ! "$FLAKE8" = true ]; then pip install .[test] && python -m unittest discover; fi + - if [ "$FLAKE8" = true ]; then pip install .[lint] && flake8 --benchmark --statistics; fi diff --git a/setup.py b/setup.py index 05ba600f..6c273aaf 100644 --- a/setup.py +++ b/setup.py @@ -18,6 +18,10 @@ 'PyGObject', 'requests', ], + extras_require={ + 'test': ['twisted'], + 'lint': ['flake8'], + }, entry_points={ 'console_scripts': [ 'whipper = whipper.command.main:main' From 79b1cd8fee69f3b0b9287d2995af6c6113c91e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Fri, 3 May 2019 22:29:56 +0200 Subject: [PATCH 4/5] CI: Install all dependencies for PyGObject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Can otherwise cause issues with not being able to install PyGObject via pip/setuptools. List taken from https://gitlab.gnome.org/GNOME/pygobject/blob/master/setup.py#L135-143 Signed-off-by: Frederik “Freso” S. Olesen --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index d9f30afd..2e93779f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,8 @@ install: - sudo apt-get -qq update - pip install --upgrade -qq pip setuptools - sudo apt-get -qq install cdparanoia cdrdao flac gir1.2-glib-2.0 libcdio-dev libgirepository1.0-dev libiso9660-dev libsndfile1-dev sox swig libcdio-utils + # Additional dependencies for PyGObject + - sudo apt-get -qq install libglib2.0-dev libcairo2-dev libcairo2-dev libffi-dev # Build bundled C utils - cd src From 0b7711f46b6811be3c4f60dc7ce7ed0a45f43817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Fri, 3 May 2019 22:39:31 +0200 Subject: [PATCH 5/5] CI: Install with pip instead of setup.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Frederik “Freso” S. Olesen --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2e93779f..d04a3992 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ install: - cd .. # Installing - - python setup.py install + - pip install . script: - if [ ! "$FLAKE8" = true ]; then pip install .[test] && python -m unittest discover; fi