fedora-python / tox-current-env

tox plugin to run tests in current Python environment
https://pypi.org/project/tox-current-env/
MIT License
23 stars 8 forks source link

Expose tox requires and minversion somehow #39

Closed hroncok closed 3 years ago

hroncok commented 3 years ago

See https://tox.readthedocs.io/en/latest/config.html#conf-requires

Specify python packages that need to exist alongside the tox installation for the tox build to be able to start (must be PEP-508 compliant). Use this to specify plugin requirements (or the version of virtualenv - determines the default pip, setuptools, and wheel versions the tox environments start with). If these dependencies are not specified tox will create provision_tox_env environment so that they are satisfied and delegate all calls to that.

See https://tox.readthedocs.io/en/latest/config.html#conf-minversion

Define the minimal tox version required to run; if the host’s tox version is less than this the tool will create an environment and provision it with a version of tox that satisfies this under provision_tox_env.

Given a config file like this:

[tox]
minversion = 3.4.0
requires =
    tox-pipenv
    setuptools >= 30.0.0

[testenv]
deps =
    pytest

We currently only print pytest with --print-deps-to=. I'd like to extend it to print:

tox >= 3.4.0
tox-pipenv
setuptools >= 30.0.0
pytest

Before I dive into it, I'd like to know whether this is a good idea or whether I shall add a new option to do this instead.

@FFY00 you currently don't use --print-deps-to= at all, is that right?

FFY00 commented 3 years ago

@FFY00 you currently don't use --print-deps-to= at all, is that right?

I don't, nothing will break :+1:

hroncok commented 3 years ago

It will also be quite tricky to actually prevent the provision step if tox determines it is needed. It happens before any plugin code is executed :confused: We might want to document this instead.

hroncok commented 3 years ago

It will also be quite tricky to actually prevent the provision step if tox determines it is needed.

https://github.com/tox-dev/tox/issues/1921