Skip to content

makukha/virtualenv-multipython

Repository files navigation

virtualenv-multipython

virtualenv discovery plugin for multipython

python versions pypi tested with multipython uses docsub license

Note

virtualenv-multipython has twin plugin tox-multipython that serves similar purpose for tox 3

This virtualenv plugin comes pre-installed in multipython Docker image and is responsible for resolving tox environment name to Python executable. Most probably, you don't need to install it yourself.

Environment names supported are all multipython tags, including free threading Python builds py313t and py314t. More names may be added in the future.

Behaviour

  • Loosely follow behaviour of builtin virtualenv discovery, with some important differences:
  • Try requests one by one, starting with --try-first-with; if one matches multipython tag or is an absolute path, return it to virtualenv.
  • If no version was requested at all, use sys.executable
  • If no request matched conditions above, fail to discover interpreter.
  • In particular, command names on PATH are not discovered.

Testing

There are two test suites:

  1. venv — Install virtualenv in host tag environment and create virtual environments for all target tags. Environment's python version must match target tag.
  2. tox4tox and virtualenv are installed in host tag environment, and tox run is executed on tox.ini with env names equal to target tags. This test includes subtests:
    • assert {env_python} version inside tox env
    • assert python version inside tox env
    • install externally built sample package in tox environment
    • execute entrypoint of sample package

Virtualenv supports discovery plugins since v20. In v20.22, it dropped support for Python <=3.6, in v20.27 it dropped support for Python 3.7.

This is why we use 6 different test setups:

  1. venv + virtualenv>=20
  2. venv + virtualenv>=20,<20.27
  3. venv + virtualenv>=20,<20.22
  4. tox4 + virtualenv>=20
  5. tox4 + virtualenv>=20,<20.27
  6. tox4 + virtualenv>=20,<20.22

Test report

When virtualenv-multipython is installed inside host tag environment, it allows to use selected ✅ target tag (create virtualenv environment or use as tox env name in env_list) and automatically discovers corresponding multipython executable. For prohibited 🚫️ target tag, python executable is not discoverable. For failing 💥 target tag, interpreter is discoverable, but virtual environment with sample package cannot be created.

Host tag and Target tags are valid multipython tags. Host tags are listed vertically (rows), target tags are listed horizontally (columns).

virtualenv>=20
  HOST    TARGETS
——————    A B C D E F G H I J K L M
py314t  A ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
py313t  B ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py314  C ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py313  D ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py312  E ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py311  F ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py310  G ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py39  H ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py38  I ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py37  J ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py36  K ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py35  L ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py27  M ✅✅✅✅✅✅✅✅✅✅✅✅✅
tox>=4,<5, virtualenv>=20
  HOST    TARGETS
——————    A B C D E F G H I J K L M
py314t  A ✅✅✅✅✅✅✅✅✅💥🚫🚫🚫
py313t  B ✅✅✅✅✅✅✅✅✅💥🚫🚫🚫
 py314  C ✅✅✅✅✅✅✅✅✅💥🚫🚫🚫
 py313  D ✅✅✅✅✅✅✅✅✅💥🚫🚫🚫
 py312  E ✅✅✅✅✅✅✅✅✅💥🚫🚫🚫
 py311  F ✅✅✅✅✅✅✅✅✅💥🚫🚫🚫
 py310  G ✅✅✅✅✅✅✅✅✅💥🚫🚫🚫
  py39  H ✅✅✅✅✅✅✅✅✅💥🚫🚫🚫
  py38  I ✅✅✅✅✅✅✅✅✅💥🚫🚫🚫
  py37  J ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py36  K . . . . . . . . . . . . .
  py35  L . . . . . . . . . . . . .
  py27  M . . . . . . . . . . . . .
virtualenv>=20,<20.27
  HOST    TARGETS
——————    A B C D E F G H I J K L M
py314t  A ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
py313t  B ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py314  C ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py313  D ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py312  E ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py311  F ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py310  G ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py39  H ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py38  I ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py37  J ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py36  K ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py35  L ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py27  M ✅✅✅✅✅✅✅✅✅✅✅✅✅
tox>=4,<5, virtualenv>=20,<20.27
  HOST    TARGETS
——————    A B C D E F G H I J K L M
py314t  A ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
py313t  B ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py314  C ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py313  D ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py312  E ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py311  F ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
 py310  G ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py39  H ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py38  I ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py37  J ✅✅✅✅✅✅✅✅✅✅🚫🚫🚫
  py36  K . . . . . . . . . . . . .
  py35  L . . . . . . . . . . . . .
  py27  M . . . . . . . . . . . . .
virtualenv>=20,<20.22
  HOST    TARGETS
——————    A B C D E F G H I J K L M
py314t  A ✅✅✅✅✅✅✅✅✅✅✅✅✅
py313t  B ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py314  C ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py313  D ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py312  E ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py311  F ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py310  G ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py39  H ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py38  I ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py37  J ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py36  K ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py35  L ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py27  M ✅✅✅✅✅✅✅✅✅✅✅✅✅
tox>=4,<5, virtualenv>=20,<20.22
  HOST    TARGETS
——————    A B C D E F G H I J K L M
py314t  A ✅✅✅✅✅✅✅✅✅✅✅✅✅
py313t  B ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py314  C ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py313  D ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py312  E ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py311  F ✅✅✅✅✅✅✅✅✅✅✅✅✅
 py310  G ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py39  H ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py38  I ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py37  J ✅✅✅✅✅✅✅✅✅✅✅✅✅
  py36  K . . . . . . . . . . . . .
  py35  L . . . . . . . . . . . . .
  py27  M . . . . . . . . . . . . .

Changelog

Check repository CHANGELOG.md