Skip to content

Commit

Permalink
DEVELOPMENT SUPPORT: Fix tox for python 2.7
Browse files Browse the repository at this point in the history
* Need to use "pip install --user ..." for now
* Scripts seem no longer to be installed

HINT: Seems to be related to virtualenv and macOS 12 Monterey
SEE:  pypa/virtualenv#2284
  • Loading branch information
jenisys committed Mar 20, 2022
1 parent 8f43e80 commit 3cb7d44
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@
#
# Run tox, like:
#
# tox -e py27
# tox -e py37
# tox -e py27 # Runs tox with python 2.7
# tox -e py39 # Runs tox with python 3.9
# tox # Runs tox with all installed python versions.
# tox --parallel # Runs tox in parallel mode w/ all envs.
#
# SEE ALSO:
# * https://tox.readthedocs.io/en/latest/config.html
# * https://tox.readthedocs.io/en/latest/config.html
# ============================================================================
# -- ONLINE USAGE:
# PIP_INDEX_URL = https://pypi.org/simple

[tox]
minversion = 3.10.0
envlist = py39, py310, py38, pypy, pypy3, doctest
envlist = py39, py27, py310, py38, pypy, pypy3, doctest
skip_missing_interpreters = True
sitepackages = False
indexserver =
Expand All @@ -44,19 +46,29 @@ setenv =
PYSETUP_BOOTSTRAP = no


# -- HINT: "pytest" script is no longer installed for Python 2.7.
# XFAIL: tox -e py27 -- Due to a pip install problem (disabled in: envlist).
# -- SPECIAL CASE:
# RELATED: https://github.com/pypa/virtualenv/issues/2284 -- macOS 12 Monterey related
# NOTES:
# * pip-install seems to need "--user" option.
# * Script(s) do not seem to be installed any more (actually to $HOME/User area).
[testenv:py27]
install_command = pip install --user -U {opts} {packages}
changedir = {toxinidir}
commands =
pytest {posargs:tests}
deps =
commands=
python -m pytest {posargs:tests}
deps=
{[testenv]deps}
setenv =
PYTHONPATH={toxinidir}
TOXRUN = yes
PYSETUP_BOOTSTRAP = no
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 -m pip install -r py.requirements/basic.txt
# python -m pip install -r py.requirements/testing.txt

[testenv:doctest]
basepython = python3
Expand Down

0 comments on commit 3cb7d44

Please sign in to comment.