Skip to content

Commit

Permalink
tests: fix pip backtracking
Browse files Browse the repository at this point in the history
* With the current setup of minimizing the number of different
  virtualenvs used by tox we ended up hitting an issue of pip
  backtracking. As prospector seems to be the most likely culprit here
  because has a lot of dependencies, and in the past too we had issues
  between prospector and flake8 dependencies, move prospector to its own
  virtualenv.
* Add also mypy as an explicit dependency.

Based off of I0bcbb448ef41 by Volans.

Change-Id: I024dcf05118b3c531edaec12ffd9ca570994f83a
  • Loading branch information
legoktm authored and volans- committed Mar 22, 2021
1 parent 38186a7 commit a49b3db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
'bandit>=1.5.1',
'flake8>=3.6.0',
'flake8-import-order>=0.18.1',
'prospector[with_everything]>=1.3.1',
'mypy',
'pytest-cov>=2.6.0',
'pytest-xdist>=1.26.1',
'pytest>=3.10.1',
Expand All @@ -40,12 +40,18 @@
'sphinx-argparse>=0.2.2',
'Sphinx>=1.8.4',
],
'prospector': [
'prospector[with_everything]>=1.3.1',
'pytest>=3.10.1',
'requests-mock>=1.5.2',
],
}

# Copy tests requirements to test only base dependencies
extras_require['tests-base'] = extras_require['tests'][:]
# Add optional dependencies to the tests ones
extras_require['tests'].extend(extras_require['with-openstack'])
extras_require['prospector'].extend(extras_require['with-openstack'])

# Generate minimum dependencies
extras_require['tests-min'] = [dep.replace('>=', '==') for dep in extras_require['tests']
Expand Down
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ description =
envdir =
py37-unitbase: {toxworkdir}/py37-tests-base
py37-min: {toxworkdir}/py37-tests-min
py37-!unitbase-!min: {toxworkdir}/py37-tests
py37-!unitbase-!min-!prospector: {toxworkdir}/py37-tests
py38-unitbase: {toxworkdir}/py38-tests-base
py38-min: {toxworkdir}/py38-tests-min
py38-!unitbase-!min: {toxworkdir}/py38-tests
py38-!unitbase-!min-!prospector: {toxworkdir}/py38-tests
py39-unitbase: {toxworkdir}/py39-tests-base
py39-min: {toxworkdir}/py39-tests-min
py39-!unitbase-!min: {toxworkdir}/py39-tests
py39-!unitbase-!min-!prospector: {toxworkdir}/py39-tests
prospector: {toxworkdir}/{envname}
commands =
flake8: flake8 setup.py cumin doc
mypy: mypy cumin/
Expand All @@ -51,7 +52,8 @@ deps =
# Use install_requires and the additional extras_require[NAME] from setup.py
unitbase: .[tests-base]
min: .[tests-min]
!min-!unitbase: .[tests]
prospector: .[prospector]
!min-!unitbase-!prospector: .[tests]
setenv =
min: CUMIN_MIN_DEPS=1

Expand Down

0 comments on commit a49b3db

Please sign in to comment.