Volans has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/382484 )
Change subject: setup.py: split test dependencies
......................................................................
setup.py: split test dependencies
* Split test dependencies per tox environment, to keep the virtualenvs
lighther and including only the necessary dependencies.
* Update tox.ini to dynamically install only the depdendencies for that
given task.
Change-Id: If5bf5227b32170b1979276b990352ec77846d535
---
M setup.py
M tox.ini
2 files changed, 32 insertions(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/software/cumin
refs/changes/84/382484/1
diff --git a/setup.py b/setup.py
index 27e6d86..d0019f3 100644
--- a/setup.py
+++ b/setup.py
@@ -19,19 +19,32 @@
'tqdm>=4.11.2',
]
-tests_require = [
- 'bandit>=0.13.2',
- 'flake8>=3.2.1',
- 'mock>=2.0.0',
- 'pytest>=3.0.3',
- 'pytest-cov>=1.8.0',
- 'pytest-xdist>=1.15.0',
- 'requests-mock>=0.7.0',
- 'Sphinx>=1.4.9',
- 'sphinx-argparse>=0.1.15',
- 'sphinx_rtd_theme>=0.1.6',
- 'tox>=2.5.0',
- 'vulture>=0.6,<0.25', # Required for
https://github.com/landscapeio/prospector/issues/230
+extras_require = {
+ 'flake8': ['flake8>=3.2.1'],
+ 'unit': [
+ 'mock>=2.0.0',
+ 'pytest>=3.0.3',
+ 'pytest-cov>=1.8.0',
+ 'pytest-xdist>=1.15.0',
+ 'requests-mock>=0.7.0',
+ ],
+ 'bandit': ['bandit>=0.13.2'],
+ 'prospector': [
+ 'vulture>=0.6,<0.25', # Required for
https://github.com/landscapeio/prospector/issues/230
+ 'prospector[with_everything]>=0.12.4',
+ ],
+ 'sphinx': [
+ 'Sphinx>=1.4.9',
+ 'sphinx-argparse>=0.1.15',
+ 'sphinx_rtd_theme>=0.1.6',
+ ],
+}
+# Required to allow prospector to inspect also the tests directory
+extras_require['prospector'].extend(extras_require['unit'])
+
+setup_requires = [
+ 'pytest-runner>=2.7.1',
+ 'setuptools_scm>=1.15.0',
]
setup(
@@ -59,7 +72,7 @@
'cumin = cumin.cli:main',
],
},
- extras_require={'tests': tests_require +
['prospector[with_everything]>=0.12.4']},
+ extras_require=extras_require,
install_requires=install_requires,
keywords=['cumin', 'cumin-automation', 'automation', 'orchestration'],
license='GPLv3+',
@@ -67,8 +80,8 @@
name='cumin-automation',
packages=find_packages(exclude=['*.tests', '*.tests.*']),
platforms=['GNU/Linux', 'BSD', 'MacOSX'],
- setup_requires=['pytest-runner>=2.7.1', 'setuptools_scm>=1.15.0'],
- tests_require=tests_require,
+ setup_requires=setup_requires,
+ tests_require=extras_require['unit'],
url='https://github.com/wikimedia/cumin',
use_scm_version=True,
zip_safe=False,
diff --git a/tox.ini b/tox.ini
index 8b6b11c..f0068fa 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,7 +6,7 @@
usedevelop = True
basepython = python2.7
commands =
- flake8: flake8
+ flake8: flake8 setup.py cumin doc
unit: py.test --strict --cov-report term-missing --cov=cumin
cumin/tests/unit {posargs}
# Avoid bandit assert_used (B101) in tests
bandit: bandit -l -i -r --exclude cumin/tests cumin/
@@ -17,8 +17,8 @@
# Fix missing space after bold blocks in man page:
https://github.com/ribozz/sphinx-argparse/issues/80
sphinx: /usr/bin/sed -i '' 's/^\.B/.B /' doc/build/man/cumin.1
deps =
- # Use install_requires and extras_require['tests'] from setup.py
- .[tests]
+ # Use install_requires and the environemnt additional
extras_require[ENVNAME] from setup.py
+ .[{envname}]
[testenv:integration]
setenv =
--
To view, visit https://gerrit.wikimedia.org/r/382484
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If5bf5227b32170b1979276b990352ec77846d535
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/cumin
Gerrit-Branch: master
Gerrit-Owner: Volans <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits