Skip to content

Commit

Permalink
CLEANUP: tox, virtualenv related
Browse files Browse the repository at this point in the history
* Use tox < 4.0 for now (hint: tox 4.x does not support python2)
* Use virtualenv < 20.22.0 to retain support for Python 2.7, Python <= 3.6
* tox.ini: Remove py27 section, virtualenv >= 20.14.1 fixes #2284 issue
  SEE: pypa/virtualenv#2284
* py.requirements/ci.tox.txt: Simplify and use "testing.txt" requirements
  • Loading branch information
jenisys committed May 6, 2023
1 parent bea66b0 commit 3f264e2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 40 deletions.
18 changes: 1 addition & 17 deletions py.requirements/ci.tox.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
# ============================================================================
# BEHAVE: PYTHON PACKAGE REQUIREMENTS: ci.tox.txt
# ============================================================================
# BASED ON: testing.txt

pytest < 5.0; python_version < '3.0' # pytest >= 4.2
pytest >= 5.0; python_version >= '3.0'

pytest-html >= 1.19.0,<2.0; python_version < '3.0'
pytest-html >= 2.0; python_version >= '3.0'

mock < 4.0; python_version < '3.6'
mock >= 4.0; python_version >= '3.6'
PyHamcrest >= 2.0.2; python_version >= '3.0'
PyHamcrest < 2.0; python_version < '3.0'

# -- HINT: path.py => path (python-install-package was renamed for python3)
path.py >=11.5.0,<13.0; python_version < '3.5'
path >= 13.1.0; python_version >= '3.5'

-r testing.txt
jsonschema

3 changes: 2 additions & 1 deletion py.requirements/develop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ pylint
-r testing.txt
coverage >= 4.2
pytest-cov
tox >= 1.8.1
tox >= 1.8.1,<4.0 # -- HINT: tox >= 4.0 has breaking changes.
virtualenv < 20.22.0 # -- SUPPORT FOR: Python 2.7, Python <= 3.6

# -- REQUIRED FOR: docs
-r docs.txt
5 changes: 4 additions & 1 deletion py.requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
sphinx >=1.6,<4.4
sphinx-autobuild
sphinx_bootstrap_theme >= 0.6.0
urllib3 < 2.0.0

# -- NEEDED FOR: RTD (as temporary fix)
urllib3 < 2.0.0; python_version < '3.10'
urllib3 >= 2.0.0; python_version >= '3.10'

# -- SUPPORT: sphinx-doc translations (prepared)
sphinx-intl >= 0.9.11
1 change: 0 additions & 1 deletion py.requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ path >= 13.1.0; python_version >= '3.5'
tomli >= 1.1.0; python_version >= '3.0' and python_version < '3.11'
toml >= 0.10.2; python_version < '3.0'


# -- PYTHON2 BACKPORTS:
pathlib; python_version <= '3.4'

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def find_packages_by_root_package(where):
"PyHamcrest >= 2.0.2; python_version >= '3.0'",
"PyHamcrest < 2.0; python_version < '3.0'",
"pytest-cov",
"tox",
"tox >= 1.8.1,<4.0", # -- HINT: tox >= 4.0 has breaking changes.
"virtualenv < 20.22.0", # -- SUPPORT FOR: Python 2.7, Python <= 3.6
"invoke >=1.7.0,<2.0; python_version < '3.6'",
"invoke >=1.7.0; python_version >= '3.6'",
# -- HINT, was RENAMED: path.py => path (for python3)
Expand Down
20 changes: 1 addition & 19 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

[tox]
minversion = 2.3
envlist = py39, py27, py310, py38, pypy3, pypy, docs
envlist = py311, py27, py310, py39, py38, pypy3, pypy, docs
skip_missing_interpreters = true


Expand All @@ -36,24 +36,6 @@ setenv =
PYTHONPATH = {toxinidir}


# -- HINT: Script(s) seems to be no longer installed on Python 2.7.
# WEIRD: pip-install seems to need "--user" option.
# RELATED: https://github.com/pypa/virtualenv/issues/2284 -- macOS 12 Monterey related
[testenv:py27]
# MAYBE: platform = darwin
install_command = pip install --user -U {opts} {packages}
changedir = {toxinidir}
commands=
python -m pytest {posargs:tests}
python -m behave --format=progress {posargs:features}
python -m behave --format=progress {posargs:tools/test-features}
python -m behave --format=progress {posargs:issue.features}
deps=
{[testenv]deps}
setenv =
PYTHONPATH = {toxinidir}


[testenv:docs]
changedir = docs
commands =
Expand Down

0 comments on commit 3f264e2

Please sign in to comment.