Skip to content

Commit

Permalink
PYTHON: Fix "tox" for Python 2.7 (#50)
Browse files Browse the repository at this point in the history
* Fixes a problem in DEVELOPMENT support
* Problem seems to be related to macOS 12 Monterey
  SEE: pypa/virtualenv#2284
* Use special section in "tox.ini" and
  use "pip install --user ..." to fix the problem for now.
* ADDED: "py27" to "envlist" again.
  • Loading branch information
jenisys authored Mar 20, 2022
1 parent 5f441c3 commit d7a40e4
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

[tox]
minversion = 2.8
envlist = py310, py39, pypy3
skip_missing_interpreters = True
envlist = py310, py27, py39, pypy3
skip_missing_interpreters = true


# -----------------------------------------------------------------------------
Expand All @@ -39,19 +39,12 @@ passenv =
PYTHONPATH = {toxinidir}


# -- SPECIAL CASE: pytest script does not seem to be installed.
# -- SPECIAL CASE:Script(s) do not seem to be installed.
# RELATED: https://github.com/pypa/virtualenv/issues/2284 -- macOS 12 Monterey related
# NOTES:
# * Python 2.7 seems to be broken in tox (due to: pip)
# THEREFORE: Remove from "envlist" above for now.
# * I can still run tests in own virtual-environment.
#
# VIRTUAL-ENVIRONMENT SETUP PROCEDURE:
# virtualenv -p python2.7 .venv_py27
# source .venv_py27
# scripts/ensurepip_python27.sh
# python -mpip install -r py.requirements/basic.txt
# python -mpip install -r py.requirements/testing.txt
# * pip-install seems to need "--user" option.
[testenv:py27]
install_command = pip install --user -U {opts} {packages}
changedir = {toxinidir}
commands=
python -mpytest {posargs:tests}
Expand All @@ -61,6 +54,13 @@ passenv =
PYTHONPATH = {toxinidir}
# MAYBE: allowlist_externals = curl

# -- VIRTUAL-ENVIRONMENT SETUP PROCEDURE: For python 2.7
# virtualenv -p python2.7 .venv_py27
# source .venv_py27
# scripts/ensurepip_python27.sh
# python -mpip install -r py.requirements/basic.txt
# python -mpip install -r py.requirements/testing.txt


[testenv:devenv]
# basepython = python2.7
Expand Down

0 comments on commit d7a40e4

Please sign in to comment.