From 4bc91623678f1964c5a7373b26c31487e4e130fa Mon Sep 17 00:00:00 2001 From: "Mr. Senko" Date: Sun, 22 Mar 2020 02:41:18 +0200 Subject: [PATCH] Move dependencies in requirements.txt & devel.txt and start using them everywhere in CI --- .github/workflows/integration.yml | 6 +----- .travis.yml | 7 +++---- MANIFEST.in | 2 +- appveyor.yml | 2 +- devel.txt | 6 ++++++ requirements.txt | 2 ++ setup.py | 17 ++++++++++++----- 7 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 devel.txt create mode 100644 requirements.txt diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index bd1148d..2fcc327 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -40,7 +40,7 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get install libkrb5-dev - pip install kerberos requests + pip install -r devel.txt - name: Build & start services run: | @@ -72,10 +72,6 @@ jobs: make verify-web-login klist - - name: Install coverage tools - run: | - pip install coverage codecov - - name: Verify tcms-api can communicate via username/password run: | cat > ~/.tcms.conf << _EOF_ diff --git a/.travis.yml b/.travis.yml index 93efe84..e1dc583 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,15 +11,14 @@ env: - MAKE=build install: - - pip install coverage pylint flake8 twine kerberos requests + - pip install -r devel.txt script: - make $MAKE after_success: - - | - pip install coveralls - coveralls + - coveralls + notifications: email: on_failure: change diff --git a/MANIFEST.in b/MANIFEST.in index 0c73842..645a28c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include README.rst LICENSE +include README.rst LICENSE requirements.txt diff --git a/appveyor.yml b/appveyor.yml index dd2126e..a7977df 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ install: - "python --version" - "python -m pip install --disable-pip-version-check --user --upgrade pip wheel" - - "python -m pip install coverage pylint flake8 twine winkerberos requests" + - "python -m pip install -r devel.txt" build: off diff --git a/devel.txt b/devel.txt new file mode 100644 index 0000000..307b551 --- /dev/null +++ b/devel.txt @@ -0,0 +1,6 @@ +-r requirements.txt + +coveralls +flake8 +pylint +twine diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a647d3a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +gssapi +requests diff --git a/setup.py b/setup.py index 1e7d4aa..8ace00c 100644 --- a/setup.py +++ b/setup.py @@ -10,12 +10,22 @@ def get_version(): ).replace('__version__=', '').strip().strip("'").strip('"') +def get_install_requires(path): + requires = [] + + with open(path, 'r') as file: + for line in file: + if line.startswith('-r '): + continue + requires.append(line.strip()) + return requires + + with open("README.rst") as readme: LONG_DESCRIPTION = readme.read() setup(name='tcms-api', - # always update version/release in docs/conf.py version=get_version(), packages=['tcms_api'], description='Python API for Kiwi', @@ -25,10 +35,7 @@ def get_version(): license='LGPLv2+', url='https://github.com/kiwitcms/tcms-api', python_requires='>=3.6', - install_requires=[ - 'requests', - 'gssapi', - ], + install_requires=get_install_requires('requirements.txt'), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console',