Code Monkey home page Code Monkey logo

tox-current-env's Introduction

tox-current-env

tox plugin to run tests in current Python environment

The tox-current-env plugin adds these options:

tox --current-env

Runs the tox testenv's commands in the current Python environment (that is, the environment where tox is invoked from and installed in). Unlike regular tox invocation, this installs no dependencies declared in deps. An attempt to run this with a Python version that doesn't match will fail (if tox is invoked from an Python 3.7 environment, any non 3.7 testenv will fail).

tox --print-deps-to=FILE

Instead of running any commands, simply prints the declared dependencies in deps to the specified FILE. This is useful for preparing the current environment for tox --current-env. Use - for FILE to print to standard output.

tox --print-extras-to=FILE

Instead of running any commands, simply prints the names of the declared extras in extras to the specified FILE. This is useful for preparing the current environment for tox --current-env. Use - for FILE to print to standard output.

It is possible to use the two printing options together, as long as the FILE is different.

Invoking tox without any of the above options should behave as regular tox invocation without this plugin. Any deviation from this behavior is considered a bug.

The plugin disables tox's way of providing a testing environment, but assumes that you supply one in some other way. Always run tox with this plugin in a fresh isolated environment, such as Python virtualenv, Linux container or chroot. See other caveats below.

Motivation

Obviously, tox was created to run tests in isolated Python virtual environments. The --current-env flag totally defeats the purpose of tox. Why would anybody do that, you might ask?

Well, it turns out that tox became too popular and gained another purpose.

The Python ecosystem now has formal specifications for many pieces of package metadata like versions or dependencies. However, there is no standardization yet for declaring test dependencies or running tests. The most popular de-facto standard for that today is tox, and we expect a future standard to evolve from tox.ini. This plugin lets us use tox's dependency lists and testing commands for environments other than Python venvs.

We hope this plugin will enable community best practices around tox configuration to grow to better accomodate non-virtualenv environments in general – for example, Linux distros, Conda, or containers.

Specifically, this plugin was created for Fedora's needs. When we package Python software as RPM packages, we try to run the project's test suite during package build. However, we need to test if the software works integrated into Fedora, not with packages downloaded from PyPI into a fresh environment. By running the tests in current environment, we can achieve that.

If you are interested in the RPM packaging part of this, see Fedora's %pyproject RPM macros.

Installation

Install this via pip:

$ python -m pip install tox-current-env

Or install the development version by cloning the git repository and pip-installing locally:

$ git clone https://github.com/fedora-python/tox-current-env
$ cd tox-current-env
$ python -m pip install -e .

Usage

When the plugin is installed, use tox with --current-env, --print-deps-to or --print-extras-to and all the other options as usual. Assuming your tox is installed on Python 3.7:

$ tox -e py37 --current-env
py37 create: /home/pythonista/projects/holy-grail/tests/.tox/py37
py37 installed: ...list of packages from the current environment...
py37 run-test-pre: PYTHONHASHSEED='3333333333'
py37 run-test: commands...
...runs tests in current environment's Python...
___________________________________ summary ____________________________________
  py37: commands succeeded
  congratulations :)

Attempting to run the py36 environment's test will fail:

$ tox -e py36 --current-env
py36 create: /home/pythonista/projects/holy-grail/tests/.tox/py36
ERROR: InterpreterMismatch: tox_current_env: interpreter versions do not match:
    in current env: (3, 7, 4, 'final', 0)
    requested: (3, 6, 9, 'final', 0)
___________________________________ summary ____________________________________
ERROR:  py36: InterpreterMismatch: tox_current_env: interpreter versions do not match:
    in current env: (3, 7, 4, 'final', 0)
    requested: (3, 6, 9, 'final', 0)

To get list of test dependencies, run:

$ tox -e py37 --print-deps-to -
py37 create: /home/pythonista/projects/holy-grail/tests/.tox/py37
py37 installed: ...you can see almost anything here...
py37 run-test-pre: PYTHONHASHSEED='3333333333'
dep1
dep2
...
___________________________________ summary ____________________________________
  py37: commands succeeded
  congratulations :)

To get a list of names of extras, run:

$ tox -e py37 --print-extras-to -
py37 create: /home/pythonista/projects/holy-grail/tests/.tox/py37
py37 installed: ...you can see almost anything here...
py37 run-test-pre: PYTHONHASHSEED='3333333333'
extra1
extra2
...
___________________________________ summary ____________________________________
  py37: commands succeeded
  congratulations :)

Caveats, warnings and limitations

tox 4

The plugin is available also for tox 4. Differences in behavior between tox 3 and 4 are these:

  • --recreate is no longer needed when you switch from the plugin back to standard tox. Tox detects it and handles the recreation automatically.
  • The plugin does not check the requested Python version nor the environment name. If you let it run for multiple environments they'll all use the same Python.
  • Deprecated --print-deps-only option is no longer available.

Use an isolated environment

Running (especially third party software's) tests in your system Python environment is dangerous. Always use this plugin in an isolated environment, such as a Linux container, virtual machine or chroot. You have been warned.

Do not rely on virtualenv details

In order to support the python command in the commands section, the current environment invocation of tox creates a fake virtual environment that just has a symbolic link to the Python executable. The link is named python even if the real interpreter's name is different (such as python3.7 or pypy). Any other commands are not linked anywhere and it is the users' responsibility to make sure such commands are in $PATH and use the correct Python. This can lead to slightly different results of tests than invoking them directly, especially if you have assumptions about sys.executable or other commands in your tests.

As a specific example, tests should invoke python -m pytest rather than assuming the pytest command is present and uses the correct version of Python.

Don't mix current-env and regular tox runs

tox caches the virtualenvs it creates, and doesn't distinguish between regular virtualenvs and --current-env. Don't mix tox --current-env, tox --print-deps-to or tox --print-extras-to runs and regular tox runs (without the flags provided by this plugin). If you ever need to do this, use tox's --recreate/-r flag to clear the cache.

The plugin should abort with a meaningful error message if this is detected, but in some corner cases (such as running tox --current-env, forcefully killing it before it finished, uninstalling the plugin, and running tox), you will get undefined results (such as installing packages from PyPI into your current environment).

Environment variables are passed by default

Since 0.0.9, all Shell environment variables are passed by default when using this plugin. The passenv tox configuration is set to *. Read the documentation for more information about passing environment variables to tox.

tox provisioning

The tested projects can specify the minimal tox version and/or additional requires needed in the environment where tox is installed. Normally, tox uses provisioning when such requirements are not met. It creates a virtual environment, installs (a newer version of) tox and the missing packages into that environment and proxies all tox invocations trough that. Unfortunately, this is undesired for tox-current-env.

  1. It is possible to invoke tox with --no-provision to prevent the provision entirely. When requirements are missing, tox fails instead of provisioning. If a path is passed as a value for --no-provision, the requirements will be serialized to the file, as JSON.
  2. The requires, if specified, are included in the results of tox --print-deps-to. This only works when they are installed (otherwise see the first point).
  3. The minimal tox version, if specified, is included in the results of tox --print-deps-to. This only works when the version requirement is satisfied (otherwise see the first point).

The recommend way to handle this is:

  1. Run tox --no-provision provision.json --print-deps-to=... or similar.
  2. If the command fails, install requirements from provision.json to the current environment and try again.

Note that the specified requirements are likely to contain other tox plugins and many of them might interfere with tox-current-env in an undesired way. If that is the case, the recommended way is to patch/sed such undesired plugins out of the configuration before running tox.

Other limitations and known bugs

The installed: line in the output of tox --print-deps-to/tox --print-extras-to shows irrelevant output (based on the content of the real or faked virtual environment).

Regardless of any Python flags used in the shebang of tox, the tests are invoked with sys.executable without any added flags (unless explicitly invoked with them in the commands section).

The current environment's Python is tested for the major and minor version only. Different interpreters with the same Python version (such as CPython and PyPy) are treated as equal.

Only Linux is supported, with special emphasis on Fedora. This plugin might work on other Unix-like systems, but does not work on Microsoft Windows.

This is alpha quality software. Use it at your on your own risk. Pull requests with improvements are welcome.

Development, issues, support

The development happens on GitHub, at the fedora-python/tox-current-env repository. You can use the issue tracker there for any discussion or send Pull Requests.

Tests

In order to run the tests, you'll need tox and Python from 3.6 to 3.10 installed. The integration tests assume all of them are available. On Fedora, you just need to dnf install tox.

Run tox to invoke the tests.

Running tests of this plugin with its own --current-env flag will most likely blow up.

License

The tox-current-env project is licensed under the so-called MIT license, full text available in the LICENSE file.

Code of Conduct

The tox-current-env project follows the Fedora's Code of Conduct.

tox-current-env's People

Contributors

encukou avatar ffy00 avatar fredrikaverpil avatar frenzymadness avatar hroncok avatar jugmac00 avatar ssbarnea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tox-current-env's Issues

No module named tox

When running tox with the --current-env argument I'm getting an error that the tox module can't be found.

$ source .venv-dev/bin/activate
$ which tox
/common/parent/path/.venv-dev/bin/tox
$ tox --current-env -e lint
/common/parent/path/.tox/.tox/bin/python: No module named tox

--print-deps-only output is hard to parse

It seems that --print-deps-only output can be parsed with:

lines = tox_output.splitlines()
summary = lines.index(' summary '.center(80, '_'))  # or a regex?
actual_deps = lines[:summary]

It would be better to have --print-deps-to-file=FILENAME option.

Expose tox requires and minversion somehow

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?

--print-deps-to runs commands_pre and commands_post

Apparently, it is possible to sepcify commands_pre and commands_post. When specified, --print-deps-to happily runs them.

To reproduce, try this one: https://github.com/orbingol/NURBS-Python/blob/v5.3.1/tox.ini#L53

[reproducer]$ python3.11 -m venv venv
[reproducer]$ . venv/bin/activate
(venv) [reproducer]$ python -m pip install 'tox<4' tox-xurrent-env
...
Successfully installed distlib-0.3.6 filelock-3.8.2 packaging-22.0 platformdirs-2.6.0 pluggy-1.0.0 py-1.11.0 six-1.16.0 tox-3.27.1 tox-current-env-0.0.8 virtualenv-20.17.1
(venv) [reproducer]$ git clone https://github.com/orbingol/NURBS-Python.git --branch v5.3.1 --depth=1
...
(venv) [reproducer]$ cd NURBS-Python/
(venv) [NURBS-Python ((v5.3.1))]$ tox -e test --print-deps-to=-
test create: .../reproducer/NURBS-Python/.tox/test
test installed: distlib==0.3.6,distlib==0.3.6,filelock==3.8.2,filelock==3.8.2,packaging==22.0,packaging==22.0,pip==21.2.3,pip==21.2.3,platformdirs==2.6.0,platformdirs==2.6.0,pluggy==1.0.0,pluggy==1.0.0,py==1.11.0,py==1.11.0,setuptools==57.4.0,setuptools==57.4.0,six==1.16.0,six==1.16.0,tox==3.27.1,tox==3.27.1,tox-current-env==0.0.8,tox-current-env==0.0.8,virtualenv==20.17.1,virtualenv==20.17.1
test run-test-pre: PYTHONHASHSEED='...'
-rrequirements.txt
pytest>=3.6.0
pytest-cov>=2.6.0
test run-test-post: commands[0] | python setup.py test -a --cov=./
Traceback (most recent call last):
  File ".../reproducer/NURBS-Python/setup.py", line 24, in <module>
    from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
ERROR: InvocationError for command .../reproducer/NURBS-Python/.tox/test/bin/python setup.py test -a --cov=./ (exited with code 1)
____________________________________________________________________________________________________________ summary ____________________________________________________________________________________________________________
ERROR:   test: commands failed

i get ModuleNotFoundError: No module named 'setuptools' because my global installation of python3.11 does not have setuptools installed. But the exact error is moot, what is relevant is that --print-deps-to should not run any commands at all.

print-deps-only: Document we don't handle recursive deps (from files, e.g. -rrequirements.txt)

Fedora report: https://bugzilla.redhat.com/show_bug.cgi?id=1808601

tox docs: https://tox.readthedocs.io/en/latest/example/basic.html#depending-on-requirements-txt-or-defining-constraints

When the dependencies are defined as:

[testenv]
deps = -rrequirements.txt

We need to read the files (recursively) and output their content.

The code that handles this now is

@tox.hookimpl
def tox_runtest(venv, redirect):
"""If --print-deps-only, prints deps instead of running tests"""
config = venv.envconfig.config
unsupported_raise(config, venv)
if config.option.print_deps_path is not None:
with open(config.option.print_deps_path, "a", encoding="utf-8") as f:
print(*venv.get_resolved_dependencies(), sep="\n", file=f)
return True
if config.option.print_deps_only:
print(*venv.get_resolved_dependencies(), sep="\n")
return True

The *venv.get_resolved_dependencies() call needs to be replaced with a custom function call. That function needs to call venv.get_resolved_dependencies() and handle "packages" that start with -r/-c specially.

/usr/bin in PATH

Currently tox-current-env adds /usr/bin to PATH before the current PATH from environment:

$ cat my-run 
#!/bin/sh
echo "PATH = $PATH"
$ cat tox.ini 
[testenv]
allowlist_externals = my-run
commands = my-run
$ env - PATH=/tmp/test /usr/bin/tox-3.9 --current-env --no-provision --recreate -e py39
ROOT: tox-gh-actions won't override envlist because tox is not running in GitHub Actions
py39: remove tox env folder /tmp/test/.tox/py39
py39: commands[0]> my-run
PATH = /tmp/test/.tox/py39/bin:/usr/bin:/tmp/test
  py39: OK (0.08=setup[0.04]+cmd[0.04] seconds)
  congratulations :) (0.54 seconds)
$ env - PATH=/tmp/test /usr/bin/tox-3.9 --no-provision --recreate -e py39
ROOT: tox-gh-actions won't override envlist because tox is not running in GitHub Actions
py39: remove tox env folder /tmp/test/.tox/py39
py39: commands[0]> my-run
PATH = /tmp/test/.tox/py39/bin:/tmp/test
  py39: OK (0.49=setup[0.46]+cmd[0.03] seconds)
  congratulations :) (0.94 seconds)
$

This usually works okay, but in a case we need to override some command in /usr/bin by pointing PATH to some other location we simply can't.

Could you please either do not add /usr/bin to PATH at all, or add it after the PATH from environment?

Thank you.

Remove `pip` dependency

Would it be possible to remove the pip dependency? At least optionally.

py38 create: /build/python-markdown2/src/python-markdown2-2.3.9/.tox/py38
ERROR: invocation failed (exit code 1), logfile: /build/python-markdown2/src/python-markdown2-2.3.9/.tox/py38/log/py38-0.log
================================== log start ===================================
/build/python-markdown2/src/python-markdown2-2.3.9/.tox/py38/bin/python: No module named pip

=================================== log end ====================================
___________________________________ summary ____________________________________
ERROR:   py38: InvocationError for command /build/python-markdown2/src/python-markdown2-2.3.9/.tox/py38/bin/python -m pip freeze (exited with code 1)

It seems like it comes from https://github.com/tox-dev/tox/blob/23dd96f5a6891fb13e298ea941bd457931421ffd/src/tox/config/__init__.py#L846.

If I understand correctly, it could be done here, I can send a PR, just let me know how you want to proceed. Do you want to add an option to disable this check? Do you want to replace the command with an alternative one?

python -m pip freeze could be replaced with importlib.metadata:

python -c 'import importlib.metadata; print("\n".join("{}=={}".format(d.metadata.get("name"), d.version) for d in importlib.metadata.distributions()))'

Plugin incompatible with various valid tox deps like --editable

Any project using pip commands inside deps will break when using tox-current-env because plugin has no idea what to. do with these.

That is even more problematic as that approach of installing dependencies is the only working method for projects that already dropped setup.py and which cannot use the classic tox commands due to known tox bugs.

Traceback (most recent call last):
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 421, in main
    generate_requires(
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 358, in generate_requires
    generate_tox_requirements(toxenv, requirements)
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 311, in generate_tox_requirements
    packages = convert_requirements_txt(deplines)
  File "/usr/lib/rpm/redhat/pyproject_requirements_txt.py", line 63, in convert_requirements_txt
    raise ValueError(f'{filename}: unsupported requirements file option: {line}')
ValueError: <requirements file>: unsupported requirements file option: --editable=.[docker,lint,podman,test,windows]
error: Bad exit status from /var/tmp/rpm-tmp.BW9H1d (%prep)
    line 30: second Description
    Bad exit status from /var/tmp/rpm-tmp.BW9H1d (%prep)

Running from within a virtualenv

I wanted to use tox --current-env from within a virtualenv. I could not find anything in the README indicating that it doesn't fundamentally work.

However, since tox-current-env just symlinks the python executable of the virtualenv, the normal mechanism of virtualenv to set sys.path relative to the path of the python executable does not seem to apply and none of the site-packages of the virtualenv are available in tox-current-env's fake virtualenv.

I'm wondering if this is intentional, then maybe the documentation could be improved. Otherwise maybe symlink the lib directory of the virtualenv or possibly setting PYTHONPATH could help such that tox-current-env also works out of a virtualenv.

help to package tox-current-env on Debian

Hi!

There is RFP(Request for package) on Debian . So I am trying to package it.

Packaging it like others python package, but I am stuck in tests here.
First, what is right step to run tests? I just run tox in d/rules from here

override_dh_auto_test:
	tox 

It should work. But I am confused how to explain the results:

...
removing build/bdist.linux-x86_64/wheel
Successfully built tox_current_env-0.0.11-py3-none-any.whl
I: pybuild plugin_pyproject:122: Unpacking wheel built for python3.11 with "installer" module
   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
tox
# skipped because could not find python interpreter with spec(s): py36-p310
...
py311-tox324: install_deps> python -I -m pip install 'tox<3.25,>=3.24'
FAILED tests/test_integration_tox3.py::test_noquiet_installed_packages[None]
FAILED tests/test_integration_tox3.py::test_regular_after_first_print_deps_is_supported[--print-deps-to-file=-]
FAILED tests/test_integration_tox3.py::test_regular_after_first_print_deps_is_supported[--print-deps-to=-]
FAILED tests/test_integration_tox3.py::test_regular_after_first_print_deps_is_supported[--print-deps-only]
FAILED tests/test_integration_tox3.py::test_regular_run_native_toxenv - Asser...
============= 5 failed, 250 passed, 4 skipped, 1 xfailed in 18.15s =============
py311-tox324: exit 1 (18.60 seconds) /<<PKGBUILDDIR>>> pytest -v tests pid=3985560
py311-tox324: FAIL ✖ in 46.6 seconds
...
FAILED tests/test_integration_tox3.py::test_regular_run_native_toxenv - Asser...
FAILED tests/test_integration_tox3.py::test_noquiet_installed_packages[None]
FAILED tests/test_integration_tox3.py::test_regular_after_first_print_deps_is_supported[--print-deps-to=-]
FAILED tests/test_integration_tox3.py::test_regular_after_first_print_deps_is_supported[--print-deps-only]
FAILED tests/test_integration_tox3.py::test_regular_after_first_print_deps_is_supported[--print-deps-to-file=-]
============= 5 failed, 250 passed, 4 skipped, 1 xfailed in 14.10s =============
...
================== 185 passed, 2 skipped, 1 xfailed in 11.77s ==================
.pkg: _exit> python /usr/lib/python3/dist-packages/pyproject_api/_backend.py True setuptools.build_meta
  py36-tox324: SKIP (0.03 seconds)
  py36-tox3: SKIP (0.00 seconds)
  py37-tox324: SKIP (0.00 seconds)
  py37-tox3: SKIP (0.00 seconds)
  py37-tox4: SKIP (0.00 seconds)
  py38-tox324: SKIP (0.00 seconds)
  py38-tox3: SKIP (0.00 seconds)
  py38-tox4: SKIP (0.00 seconds)
  py39-tox324: SKIP (0.00 seconds)
  py39-tox3: SKIP (0.00 seconds)
  py39-tox4: SKIP (0.00 seconds)
  py310-tox324: SKIP (0.00 seconds)
  py310-tox3: SKIP (0.00 seconds)
  py310-tox4: SKIP (0.00 seconds)
  py311-tox324: FAIL code 1 (46.60=setup[27.99]+cmd[18.60] seconds)
  py311-tox3: FAIL code 1 (40.62=setup[26.07]+cmd[14.55] seconds)
  py311-tox4: OK (41.31=setup[29.14]+cmd[12.18] seconds)
  evaluation failed :( (128.62 seconds)

The specially failed log is here

yes, here only py311-tox4 was built ok, like py311-tox324 and py311-tox3
was built failed due to the same test failed.
The current Debain sid env is : python-3.11,
tox-4.11. So there is only one tox and python3 to test, like tox's goal.
So can I remove test_integration_tox3.py here? because Debian python team request a
test successfully for new package. In fact, this is my first time to touch tox plugin module,
if i am wrong somewhere, please let me know.
Thanks.

0.0.8: pytest is failing in few units

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-tox-current-env-0.0.8-4.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-tox-current-env-0.0.8-4.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.16, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/tox-current-env-0.0.8, configfile: tox.ini
plugins: xdist-3.1.0

[..]

sx.........................................s...s........................................................F.F.............FF..FF......F                                [100%]
================================================================================= FAILURES =================================================================================
____________________________________________________________ test_noquiet_installed_packages[--print-deps-to=-] ____________________________________________________________
[gw19] linux -- Python 3.8.16 /usr/bin/python3

flag = '--print-deps-to=-'

    @pytest.mark.parametrize("flag", [None, "--print-deps-to=-", "--current-env"])
    def test_noquiet_installed_packages(flag):
        flags = (flag,) if flag else ()
        result = tox("-e", NATIVE_TOXENV, *flags, quiet=False, check=False)
        assert f"\n{NATIVE_TOXENV} installed: " in result.stdout
        for line in result.stdout.splitlines():
            if line.startswith(f"{NATIVE_TOXENV} installed: "):
                packages = line.rpartition(" installed: ")[-1].split(",")
                break

        # default tox produces output sorted by package names
>       assert packages == sorted(
            packages, key=lambda p: p.partition("==")[0].partition(" @ ")[0].lower()
        )
E       AssertionError: assert ['Babel==2.11...=2.13.0', ...] == ['alabaster==...==0.9.0', ...]
E         At index 0 diff: 'Babel==2.11.0' != 'alabaster==0.7.12'
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/tox-current-env-0.0.8/tests/test_integration.py:619: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
py38 create: /tmp/pytest-of-tkloczko/pytest-487/popen-gw19/test_noquiet_installed_package0/projdir/.tox/py38
py38 installed: Babel==2.11.0,Brlapi==0.8.3,Jinja2==3.1.2,MarkupSafe==2.1.1,PyGObject==3.42.2,Pygments==2.13.0,Sphinx==5.3.0,alabaster==0.7.12,appdirs==1.4.4,attrs==22.1.0,build==0.9.0,charset-normalizer==3.0.1,cssselect==1.1.0,distlib==0.3.6,distro==1.8.0,dnspython==2.2.1,docutils==0.19,exceptiongroup==1.0.0,execnet==1.9.0,extras==1.0.0,filelock==3.8.0,fixtures==4.0.0,gpg==1.17.1-unknown,idna==3.4,imagesize==1.4.1,importlib-metadata==5.1.0,iniconfig==1.1.1,libcomps==0.1.19,lit==15.0.6,louis==3.24.0,lxml==4.9.1,meson==0.64.1,numpy==1.23.1,packaging==21.3,pbr==5.9.0,pep517==0.13.0,pip==22.3.1,platformdirs==2.5.2,pluggy==1.0.0,py==1.11.0,pyparsing==3.0.9,pytest==7.2.0,pytest-xdist==3.1.0,python-dateutil==2.8.2,pytz==2022.4,requests==2.28.1,rpm==4.17.0,scour==0.38.2,setuptools==65.6.3,six==1.16.0,snowballstemmer==2.2.0,sphinxcontrib-applehelp==1.0.2.dev20221204,sphinxcontrib-devhelp==1.0.2.dev20221204,sphinxcontrib-htmlhelp==2.0.0,sphinxcontrib-jsmath==1.0.1.dev20221204,sphinxcontrib-qthelp==1.0.3.dev20221204,sphinxcontrib-serializinghtml==1.1.5,testtools==2.5.0,toml==0.10.2,tomli==2.0.1,tox==3.26.0,tox-current-env==0.0.8,urllib3==1.26.12,virtualenv==20.17.0,wheel==0.38.4,zipp==3.11.0
py38 run-test-pre: PYTHONHASHSEED='3748779245'
six
py
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------

______________________________________________________________ test_noquiet_installed_packages[--current-env] ______________________________________________________________
[gw23] linux -- Python 3.8.16 /usr/bin/python3

flag = '--current-env'

    @pytest.mark.parametrize("flag", [None, "--print-deps-to=-", "--current-env"])
    def test_noquiet_installed_packages(flag):
        flags = (flag,) if flag else ()
        result = tox("-e", NATIVE_TOXENV, *flags, quiet=False, check=False)
        assert f"\n{NATIVE_TOXENV} installed: " in result.stdout
        for line in result.stdout.splitlines():
            if line.startswith(f"{NATIVE_TOXENV} installed: "):
                packages = line.rpartition(" installed: ")[-1].split(",")
                break

        # default tox produces output sorted by package names
>       assert packages == sorted(
            packages, key=lambda p: p.partition("==")[0].partition(" @ ")[0].lower()
        )
E       AssertionError: assert ['Babel==2.11...=2.13.0', ...] == ['alabaster==...==0.9.0', ...]
E         At index 0 diff: 'Babel==2.11.0' != 'alabaster==0.7.12'
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/tox-current-env-0.0.8/tests/test_integration.py:619: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
py38 create: /tmp/pytest-of-tkloczko/pytest-487/popen-gw23/test_noquiet_installed_package0/projdir/.tox/py38
py38 installed: Babel==2.11.0,Brlapi==0.8.3,Jinja2==3.1.2,MarkupSafe==2.1.1,PyGObject==3.42.2,Pygments==2.13.0,Sphinx==5.3.0,alabaster==0.7.12,appdirs==1.4.4,attrs==22.1.0,build==0.9.0,charset-normalizer==3.0.1,cssselect==1.1.0,distlib==0.3.6,distro==1.8.0,dnspython==2.2.1,docutils==0.19,exceptiongroup==1.0.0,execnet==1.9.0,extras==1.0.0,filelock==3.8.0,fixtures==4.0.0,gpg==1.17.1-unknown,idna==3.4,imagesize==1.4.1,importlib-metadata==5.1.0,iniconfig==1.1.1,libcomps==0.1.19,lit==15.0.6,louis==3.24.0,lxml==4.9.1,meson==0.64.1,numpy==1.23.1,packaging==21.3,pbr==5.9.0,pep517==0.13.0,pip==22.3.1,platformdirs==2.5.2,pluggy==1.0.0,py==1.11.0,pyparsing==3.0.9,pytest==7.2.0,pytest-xdist==3.1.0,python-dateutil==2.8.2,pytz==2022.4,requests==2.28.1,rpm==4.17.0,scour==0.38.2,setuptools==65.6.3,six==1.16.0,snowballstemmer==2.2.0,sphinxcontrib-applehelp==1.0.2.dev20221204,sphinxcontrib-devhelp==1.0.2.dev20221204,sphinxcontrib-htmlhelp==2.0.0,sphinxcontrib-jsmath==1.0.1.dev20221204,sphinxcontrib-qthelp==1.0.3.dev20221204,sphinxcontrib-serializinghtml==1.1.5,testtools==2.5.0,toml==0.10.2,tomli==2.0.1,tox==3.26.0,tox-current-env==0.0.8,urllib3==1.26.12,virtualenv==20.17.0,wheel==0.38.4,zipp==3.11.0
py38 run-test-pre: PYTHONHASHSEED='1599822279'
py38 run-test: commands[0] | python -c 'import os, sys; print(os.path.realpath(sys.exec_prefix), "is the exec_prefix")'
/usr is the exec_prefix
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------

__________________________________________________________________ test_noquiet_installed_packages[None] ___________________________________________________________________
[gw20] linux -- Python 3.8.16 /usr/bin/python3

flag = None

    @pytest.mark.parametrize("flag", [None, "--print-deps-to=-", "--current-env"])
    def test_noquiet_installed_packages(flag):
        flags = (flag,) if flag else ()
        result = tox("-e", NATIVE_TOXENV, *flags, quiet=False, check=False)
        assert f"\n{NATIVE_TOXENV} installed: " in result.stdout
        for line in result.stdout.splitlines():
            if line.startswith(f"{NATIVE_TOXENV} installed: "):
                packages = line.rpartition(" installed: ")[-1].split(",")
                break

        # default tox produces output sorted by package names
        assert packages == sorted(
            packages, key=lambda p: p.partition("==")[0].partition(" @ ")[0].lower()
        )

        # without a flag, the output must match tox defaults
        if not flag:
>           assert len(packages) == 3
E           AssertionError: assert 4 == 3
E            +  where 4 = len(['py==1.11.0', 'six==1.16.0', 'test @ file:///tmp/pytest-of-tkloczko/pytest-487/popen-gw20/test_noquiet_installed_package0/projdir/.tox/.tmp/package/1/test-0.0.0.zip', 'tox-current-env==0.0.8'])

/home/tkloczko/rpmbuild/BUILD/tox-current-env-0.0.8/tests/test_integration.py:625: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
GLOB sdist-make: /tmp/pytest-of-tkloczko/pytest-487/popen-gw20/test_noquiet_installed_package0/projdir/setup.py
py38 create: /tmp/pytest-of-tkloczko/pytest-487/popen-gw20/test_noquiet_installed_package0/projdir/.tox/py38
py38 installdeps: six, py
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
py38 inst: /tmp/pytest-of-tkloczko/pytest-487/popen-gw20/test_noquiet_installed_package0/projdir/.tox/.tmp/package/1/test-0.0.0.zip
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
py38 installed: py==1.11.0,six==1.16.0,test @ file:///tmp/pytest-of-tkloczko/pytest-487/popen-gw20/test_noquiet_installed_package0/projdir/.tox/.tmp/package/1/test-0.0.0.zip,tox-current-env==0.0.8
py38 run-test-pre: PYTHONHASHSEED='3943385495'
py38 run-test: commands[0] | python -c 'import os, sys; print(os.path.realpath(sys.exec_prefix), "is the exec_prefix")'
/tmp/pytest-of-tkloczko/pytest-487/popen-gw20/test_noquiet_installed_package0/projdir/.tox/py38 is the exec_prefix
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------

______________________________________________________________________ test_regular_run_native_toxenv ______________________________________________________________________
[gw46] linux -- Python 3.8.16 /usr/bin/python3

    def test_regular_run_native_toxenv():
        result = tox("-e", NATIVE_TOXENV)
        lines = sorted(result.stdout.splitlines()[:1])
>       assert f"/.tox/{NATIVE_TOXENV} is the exec_prefix" in lines[0]
E       assert '/.tox/py38 is the exec_prefix' in "WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration."

/home/tkloczko/rpmbuild/BUILD/tox-current-env-0.0.8/tests/test_integration.py:479: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
/tmp/pytest-of-tkloczko/pytest-487/popen-gw46/test_regular_run_native_toxenv0/projdir/.tox/py38 is the exec_prefix
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------

_________________________________________________ test_regular_after_first_print_deps_is_supported[--print-deps-to-file=-] _________________________________________________
[gw16] linux -- Python 3.8.16 /usr/bin/python3

print_deps_stdout_arg = '--print-deps-to-file=-'

    def test_regular_after_first_print_deps_is_supported(print_deps_stdout_arg):
        result = tox("-e", NATIVE_TOXENV, print_deps_stdout_arg)
        assert result.stdout.splitlines()[0] == "six"
        result = tox("-e", NATIVE_TOXENV)
        lines = sorted(result.stdout.splitlines()[:1])
        assert "--recreate" not in result.stderr
>       assert f"/.tox/{NATIVE_TOXENV} is the exec_prefix" in lines[0]
E       assert '/.tox/py38 is the exec_prefix' in "WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration."

/home/tkloczko/rpmbuild/BUILD/tox-current-env-0.0.8/tests/test_integration.py:514: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
six
py
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
/tmp/pytest-of-tkloczko/pytest-487/popen-gw16/test_regular_after_first_print0/projdir/.tox/py38 is the exec_prefix
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------


___________________________________________________ test_regular_after_first_print_deps_is_supported[--print-deps-to=-] ____________________________________________________
[gw14] linux -- Python 3.8.16 /usr/bin/python3

print_deps_stdout_arg = '--print-deps-to=-'

    def test_regular_after_first_print_deps_is_supported(print_deps_stdout_arg):
        result = tox("-e", NATIVE_TOXENV, print_deps_stdout_arg)
        assert result.stdout.splitlines()[0] == "six"
        result = tox("-e", NATIVE_TOXENV)
        lines = sorted(result.stdout.splitlines()[:1])
        assert "--recreate" not in result.stderr
>       assert f"/.tox/{NATIVE_TOXENV} is the exec_prefix" in lines[0]
E       assert '/.tox/py38 is the exec_prefix' in "WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration."

/home/tkloczko/rpmbuild/BUILD/tox-current-env-0.0.8/tests/test_integration.py:514: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
six
py
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
/tmp/pytest-of-tkloczko/pytest-487/popen-gw14/test_regular_after_first_print0/projdir/.tox/py38 is the exec_prefix
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------


___________________________________________________ test_regular_after_first_print_deps_is_supported[--print-deps-only] ____________________________________________________
[gw3] linux -- Python 3.8.16 /usr/bin/python3

print_deps_stdout_arg = '--print-deps-only'

    def test_regular_after_first_print_deps_is_supported(print_deps_stdout_arg):
        result = tox("-e", NATIVE_TOXENV, print_deps_stdout_arg)
        assert result.stdout.splitlines()[0] == "six"
        result = tox("-e", NATIVE_TOXENV)
        lines = sorted(result.stdout.splitlines()[:1])
        assert "--recreate" not in result.stderr
>       assert f"/.tox/{NATIVE_TOXENV} is the exec_prefix" in lines[0]
E       assert '/.tox/py38 is the exec_prefix' in "WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration."

/home/tkloczko/rpmbuild/BUILD/tox-current-env-0.0.8/tests/test_integration.py:514: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
six
py
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
/tmp/pytest-of-tkloczko/pytest-487/popen-gw3/test_regular_after_first_print0/projdir/.tox/py38 is the exec_prefix
___________________________________ summary ____________________________________
  py38: commands succeeded
  congratulations :)

--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------


========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_integration.py:136: This test needs python3.6, 3.7, 3.8, 3.9 and 3.10 available in $PATH
SKIPPED [1] tests/test_integration.py:117: This test needs python3.6, 3.7, 3.8, 3.9 and 3.10 available in $PATH
SKIPPED [1] tests/test_integration.py:459: This test needs python3.6, 3.7, 3.8, 3.9 and 3.10 available in $PATH
XFAIL tests/test_integration.py::test_allenvs_print_deps_to_file_print_extras_to_other_file[True-True] - reason: Unsupported combination of parameters
FAILED tests/test_integration.py::test_noquiet_installed_packages[--print-deps-to=-] - AssertionError: assert ['Babel==2.11...=2.13.0', ...] == ['alabaster==...==0.9.0', ...]
FAILED tests/test_integration.py::test_noquiet_installed_packages[--current-env] - AssertionError: assert ['Babel==2.11...=2.13.0', ...] == ['alabaster==...==0.9.0', ...]
FAILED tests/test_integration.py::test_noquiet_installed_packages[None] - AssertionError: assert 4 == 3
FAILED tests/test_integration.py::test_regular_run_native_toxenv - assert '/.tox/py38 is the exec_prefix' in "WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration."
FAILED tests/test_integration.py::test_regular_after_first_print_deps_is_supported[--print-deps-to-file=-] - assert '/.tox/py38 is the exec_prefix' in "WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration."
FAILED tests/test_integration.py::test_regular_after_first_print_deps_is_supported[--print-deps-to=-] - assert '/.tox/py38 is the exec_prefix' in "WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration."
FAILED tests/test_integration.py::test_regular_after_first_print_deps_is_supported[--print-deps-only] - assert '/.tox/py38 is the exec_prefix' in "WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration."
=========================================================== 7 failed, 122 passed, 3 skipped, 1 xfailed in 16.99s ===========================================================

Here is list of installed modules in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
appdirs                       1.4.4
attrs                         22.1.0
Babel                         2.11.0
Brlapi                        0.8.3
build                         0.9.0
charset-normalizer            3.0.1
cssselect                     1.1.0
distlib                       0.3.6
distro                        1.8.0
dnspython                     2.2.1
docutils                      0.19
exceptiongroup                1.0.0
execnet                       1.9.0
extras                        1.0.0
filelock                      3.8.0
fixtures                      4.0.0
gpg                           1.17.1-unknown
idna                          3.4
imagesize                     1.4.1
importlib-metadata            5.1.0
iniconfig                     1.1.1
Jinja2                        3.1.2
libcomps                      0.1.19
louis                         3.24.0
lxml                          4.9.1
MarkupSafe                    2.1.1
numpy                         1.23.1
packaging                     21.3
pbr                           5.9.0
pep517                        0.13.0
pip                           22.3.1
platformdirs                  2.5.2
pluggy                        1.0.0
py                            1.11.0
Pygments                      2.13.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pytest                        7.2.0
pytest-xdist                  3.1.0
python-dateutil               2.8.2
pytz                          2022.4
requests                      2.28.1
rpm                           4.17.0
scour                         0.38.2
setuptools                    65.6.3
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        5.3.0
sphinxcontrib-applehelp       1.0.2.dev20221204
sphinxcontrib-devhelp         1.0.2.dev20221204
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20221204
sphinxcontrib-qthelp          1.0.3.dev20221204
sphinxcontrib-serializinghtml 1.1.5
testtools                     2.5.0
toml                          0.10.2
tomli                         2.0.1
tox                           3.26.0
urllib3                       1.26.12
virtualenv                    20.17.0
wheel                         0.38.4
zipp                          3.11.0

Rewrite common executables to use the Python selected by tox

In jaraco/skeleton#86, @mtelka proposes to replace pytest in the tox commands with python -m pytest in order to avoid ambiguity in which Python version is used to execute the tests.

As described in that issue, making that change has other effects and would exist only to support a narrow set of uses.

Since tox-current-env is implicated in the failure and since it already re-writes the handling of python as an executable, perhaps this project should also handle other common executables (pytest to start, but maybe others) by replacing such invocations with python -m pytest or perhaps {sys.executable} $(which pytest).

This approach would address the issue more selectively and surgically where it's needed and avoid the need to adapt many (all?) downstream packages to use a non-standard approach to accommodate users of this project.

tox --print-deps-only fails if there's no python command

Currently, --print-deps-only fails if invoked without previously running --current-env or regular tox on systems without the python command:

$ tox --print-deps-only -e py37
py37 create: /tmp/pytest-of-mockbuild/pytest-0/test_data_Tox_depndencies_pypr0/cwd/.tox/py37
____________________________________________________ summary ____________________________________________________
  py37: commands succeeded
  congratulations :)
Traceback (most recent call last):
  File "/usr/bin/tox", line 11, in <module>
    load_entry_point('tox==3.13.2', 'console_scripts', 'tox')()
  File "/usr/lib/python3.7/site-packages/tox/session/__init__.py", line 44, in cmdline
    main(args)
  File "/usr/lib/python3.7/site-packages/tox/session/__init__.py", line 68, in main
    exit_code = session.runcommand()
  File "/usr/lib/python3.7/site-packages/tox/session/__init__.py", line 192, in runcommand
    return self.subcommand_test()
  File "/usr/lib/python3.7/site-packages/tox/session/__init__.py", line 220, in subcommand_test
    run_sequential(self.config, self.venv_dict)
  File "/usr/lib/python3.7/site-packages/tox/session/commands/run/sequential.py", line 9, in run_sequential
    if venv.setupenv():
  File "/usr/lib/python3.7/site-packages/tox/venv.py", line 618, in setupenv
    command_path = self.getcommandpath("python")
  File "/usr/lib/python3.7/site-packages/tox/venv.py", line 186, in getcommandpath
    "could not find executable {}".format(pipes.quote(name))
tox.exception.InvocationError: InvocationError for command could not find executable python

A solution might be to setup the same environment as in --current-env, if no environment is there.

tox >4.5.1.1 is not tested here

After #67 the higher tox version tested here is 4.5.1.1. Anything newer requires at least virtualenv>=20.23 and is never installed for tests.

Test failed on Debian armel

Hi,

I have packaged the module for Debian, but there is one test case failed that stopping the package migration to testing from sid.

The specilly log is here

 56s 4.11.3 from /usr/lib/python3/dist-packages/tox/__init__.py
 56s registered plugins:
 56s     tox-current-env-0.0.11 at /usr/lib/python3/dist-packages/tox_current_env/hooks.py
 56s 
 56s 
 56s 
 56s 
 56s =================================== FAILURES ===================================
 56s __________ test_allenvs_print_extras_to_file[--print-extras-to-file] ___________
 56s [gw6] linux -- Python 3.11.6 /usr/bin/python3.11
 56s 
 56s tmp_path = PosixPath('/tmp/pytest-of-debci/pytest-0/popen-gw6/test_allenvs_print_extras_to_f0')
 56s option = '--print-extras-to-file'
 56s 
 56s     @pytest.mark.parametrize("option", ("--print-extras-to", "--print-extras-to-file"))
 56s     def test_allenvs_print_extras_to_file(tmp_path, option):
 56s         extraspath = tmp_path / "extras"
 56s         result = tox(option, str(extraspath))
 56s         assert sorted(extraspath.read_text().splitlines()) == sorted(
 56s             ["dev", "full"] * len(envs_from_tox_ini())
 56s         )
 56s         expected = ""
 56s         for env in envs_from_tox_ini()[:-1]:
 56s             expected += f"{env}: OK\n"
 56s         expected += tox_footer(spaces=0) + "\n"
 56s >       assert prep_tox_output(result.stdout) == expected
 56s E       AssertionError: assert 'py36: OK\npy...ulations :)\n' == 'py36: OK\npy...ulations :)\n'
 56s E           py36: OK
 56s E           py37: OK
 56s E           py38: OK
 56s E         + py310: OK
 56s E           py39: OK
 56s E         - py310: OK
 56s E             py36: OK...
 56s E         
 56s E         ...Full output truncated (6 lines hidden), use '-vv' to show
 56s 
 56s /tmp/autopkgtest-lxc.4a3lx05w/downtmp/autopkgtest_tmp/tests/test_integration_tox4.py:231: AssertionError
 56s ----------------------------- Captured stdout call -----------------------------
 56s current /tmp/pytest-of-debci/pytest-0/popen-gw6/test_allenvs_print_extras_to_f0/projdir running in /tmp/pytest-of-debci/pytest-0/popen-gw6/test_allenvs_print_extras_to_f0/projdir
 56s py36: OK ✔ in 0.01 seconds
 56s py37: OK ✔ in 0.02 seconds
 56s py38: OK ✔ in 0.01 seconds
 56s py310: OK ✔ in 0.01 seconds
 56s py39: OK ✔ in 0.01 seconds
 56s   py36: OK (0.01 seconds)
 56s   py37: OK (0.02 seconds)
 56s   py38: OK (0.00 seconds)
 56s   py39: OK (0.00 seconds)
 56s   py310: OK (0.00 seconds)
 56s   py311: OK (0.01 seconds)
 56s   congratulations :) (0.13 seconds)
 56s 
 56s ----------------------------- Captured stderr call -----------------------------
 56s 
 56s =========================== short test summary info ============================
 56s FAILED tests/test_integration_tox4.py::test_allenvs_print_extras_to_file[--print-extras-to-file]

The more test results you can refer to tracker
any help will be appreciated.

Broken with newest virtualenv

Tests are broken with current virtualenv, with messages like:

_____ test_regular_after_current_is_supported _____
[gw2] linux -- Python 3.6.11 /home/pviktori/dev/tox-current-env/.tox/py36-toxmaster/bin/python

    @needs_tox38
    def test_regular_after_current_is_supported():
        result = tox("-e", NATIVE_TOXENV, "--current-env")
        assert result.stdout.splitlines()[0] == NATIVE_EXECUTABLE
        result = tox("-e", NATIVE_TOXENV)
>       assert f"/.tox/{NATIVE_TOXENV}/bin/python" in result.stdout
E       AssertionError: assert '/.tox/py36/bin/python' in '/usr/bin/python3.6\n_____ summary _____\n  py36: commands succeeded\n  congratulations :)\n'
E        +  where '/usr/bin/python3.6\n_____ summary _____\n  py36: commands succeeded\n  congratulations :)\n' = CompletedProcess(args=('/home/pviktori/dev/tox-current-env/.tox/py36-toxmaster/bin/python', '-m', 'tox', '-q', '-e', '..._____ summary _____\n  py36: commands succeeded\n  congratulations :)\n', stderr='').stdout

/home/pviktori/dev/tox-current-env/tests/test_integration.py:218: AssertionError
----- Captured stdout call -----
/home/pviktori/dev/tox-current-env/.tox/py36-toxmaster/bin/python3.6
_____ summary _____
  py36: commands succeeded
  congratulations :)

/usr/bin/python3.6
_____ summary _____
  py36: commands succeeded
  congratulations :)

----- Captured stderr call -----

Pinning virtualenv < 20.0 works around the issue.

Injecting whitelist_externals break tox.ini files using newer allowlist_externals

The line at

config.envconfigs[testenv].whitelist_externals = "*"
effectively breaks any tox.ini file that used the newer allowlist_externals by causing something like:

...
  File "/usr/lib/python3.9/site-packages/tox/venv.py", line 217, in _check_external_allowed_and_warn
    if not self.is_allowed_external(path):
  File "/usr/lib/python3.9/site-packages/tox/venv.py", line 237, in is_allowed_external
    raise tox.exception.ConfigError(
tox.exception.ConfigError: ConfigError: Either whitelist_externals or allowlist_externals might be specified, not both

Symlink pythonX and pythonX.Y

Virtualenv guarantees python to be on the path, but also python3 and python3.8. We should probably symlink those as well.
(Feedback from a tox dev I met at the sprint)

Allow paralel test execution of integration tests

Be it pyest-xdist or tox --parallel/detox, current integartion testes will fight over the tests/.tox directory. We should adapt the test suite to use temporary directories and copy files into it.

tox -e py312-tox4: TypeError: 'NoneType' object is not iterable

[tox-current-env (master)]$ tox -e py312-tox4
.pkg: _optional_hooks> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_sdist> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_wheel> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: prepare_metadata_for_build_wheel> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_sdist> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
py312-tox4: install_package> python -I -m pip install --force-reinstall --no-deps ~/tox-current-env/.tox/.tmp/package/3/tox-current-env-0.0.11.tar.gz
py312-tox4: commands[0]> pytest -v tests
============================= test session starts ==============================
platform linux -- Python 3.12.1, pytest-8.0.1, pluggy-1.4.0 -- ~/tox-current-env/.tox/py312-tox4/bin/python
cachedir: .tox/py312-tox4/.pytest_cache
rootdir: ~/tox-current-env
configfile: tox.ini
plugins: xdist-3.5.0
created: 8/8 workers
8 workers [187 items]

scheduling tests via LoadScheduling

tests/test_integration_tox4.py::test_native_toxenv_current_env 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py310] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py37] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py310] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py39] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py38] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py311] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py36] 
[gw0] [  0%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py310] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py311] 
[gw4] [  1%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py37] 
[gw2] [  1%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py39] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py38] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py310] 
[gw6] [  2%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py311] 
[gw7] [  2%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py310] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py36] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py311] 
[gw3] [  3%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py38] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py39] 
[gw5] [  3%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py36] 
[gw1] [  4%] PASSED tests/test_integration_tox4.py::test_native_toxenv_current_env 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py37] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py36] 
[gw0] [  4%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py311] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py36] 
[gw4] [  5%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py38] 
[gw6] [  5%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py36] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py39] 
[gw7] [  6%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py311] 
[gw2] [  6%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py310] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py37] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py311] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py36] 
[gw3] [  7%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py39] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py310] 
[gw5] [  8%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py37] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py38] 
[gw1] [  8%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py36] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py37] 
[gw0] [  9%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py36] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py37] 
[gw2] [  9%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py311] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py36] 
[gw6] [ 10%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py37] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py38] 
[gw7] [ 10%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py36] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py37] 
[gw4] [ 11%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py39] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py310] 
[gw1] [ 11%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py37] 
[gw3] [ 12%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py310] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py311] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py38] 
[gw5] [ 12%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py38] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py39] 
[gw0] [ 13%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py37] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py38] 
[gw4] [ 13%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py310] 
[gw6] [ 14%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py38] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py311] 
[gw2] [ 14%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py36] 
[gw7] [ 15%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py37] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py37] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py39] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py38] 
[gw5] [ 16%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py39] 
[gw1] [ 16%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py310] 
tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py39] 
[gw3] [ 17%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py311] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py36] 
[gw2] [ 17%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--pre-py37] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py37] 
[gw7] [ 18%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py38] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py37] 
[gw4] [ 18%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py311] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py311] 
[gw0] [ 19%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py39] 
[gw6] [ 19%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--pre-py39] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py36] 
[gw5] [ 20%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--both-py310] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py37] 
[gw1] [ 20%] PASSED tests/test_integration_tox4.py::test_print_deps[--print-deps-to-file=--py39] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py37] 
[gw3] [ 21%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to-file=--post-py36] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py36] 
[gw4] [ 21%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py311] 
[gw6] [ 22%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py36] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py37] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py36] 
[gw0] [ 22%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py39] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py310] 
[gw2] [ 23%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py37] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py38] 
[gw3] [ 24%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py36] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py37] 
[gw1] [ 24%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py37] 
[gw5] [ 25%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py37] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py38] 
[gw7] [ 25%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py37] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py38] 
[gw0] [ 26%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py310] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py311] 
[gw4] [ 26%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py36] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py37] 
[gw6] [ 27%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py37] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py38] 
[gw3] [ 27%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py37] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py38] 
[gw2] [ 28%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py39] 
[gw1] [ 28%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py39] 
[gw7] [ 29%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py39] 
[gw5] [ 29%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py39] 
[gw0] [ 30%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--post-py311] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py36] 
[gw4] [ 31%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py37] 
[gw6] [ 31%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py39] 
[gw3] [ 32%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py38] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py39] 
[gw2] [ 32%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py39] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py310] 
[gw7] [ 33%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py39] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py310] 
[gw5] [ 33%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py39] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py310] 
[gw4] [ 34%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py38] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py39] 
[gw6] [ 34%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py39] 
[gw0] [ 35%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py36] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py37] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py310] 
[gw1] [ 35%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py39] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py310] 
[gw3] [ 36%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py39] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py310] 
[gw2] [ 36%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py310] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py311] 
[gw4] [ 37%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py39] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py310] 
[gw0] [ 37%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py37] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py38] 
[gw5] [ 38%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py310] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py311] 
[gw7] [ 39%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py310] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py311] 
[gw6] [ 39%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py310] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py311] 
[gw1] [ 40%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py310] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py311] 
[gw3] [ 40%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py310] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py311] 
[gw4] [ 41%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py310] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py311] 
[gw0] [ 41%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py38] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py39] 
[gw2] [ 42%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py311] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py36] 
[gw6] [ 42%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to=--py311] 
tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py36] 
[gw5] [ 43%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py311] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py36] 
[gw3] [ 43%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to-file=--py311] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py36] 
[gw7] [ 44%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py311] 
tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py36] 
[gw1] [ 44%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py311] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py310] 
[gw4] [ 45%] PASSED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion[--print-deps-to-file=--py311] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py38] 
[gw0] [ 45%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py39] 
tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py310] 
[gw2] [ 46%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py36] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py36] 
[gw3] [ 47%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py36] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py37] 
[gw6] [ 47%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py36] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py310] 
[gw5] [ 48%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py36] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py38] 
[gw7] [ 48%] FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py36] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py311] 
[gw1] [ 49%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py310] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py311] 
[gw4] [ 49%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py38] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py39] 
[gw0] [ 50%] PASSED tests/test_integration_tox4.py::test_print_deps_with_commands_pre_post[--print-deps-to=--both-py310] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py38] 
[gw6] [ 50%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py310] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py311] 
[gw2] [ 51%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py36] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py37] 
[gw3] [ 51%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py37] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py38] 
[gw5] [ 52%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py38] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py39] 
[gw7] [ 52%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py311] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py36] 
[gw1] [ 53%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py311] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py36] 
[gw4] [ 54%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py39] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py310] 
[gw0] [ 54%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py38] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py39] 
[gw3] [ 55%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py38] 
[gw6] [ 55%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py311] 
tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py39] 
[gw2] [ 56%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py37] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py38] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py36] 
[gw5] [ 56%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py39] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py310] 
[gw1] [ 57%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py36] 
[gw7] [ 57%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py36] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py37] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py37] 
[gw0] [ 58%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py39] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py310] 
[gw4] [ 58%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py310] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py311] 
[gw2] [ 59%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py38] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py39] 
[gw6] [ 59%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py36] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py37] 
[gw3] [ 60%] PASSED tests/test_integration_tox4.py::test_print_extras[--print-extras-to=--py39] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py311] 
[gw5] [ 60%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py310] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py38] 
[gw1] [ 61%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py37] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py311] 
[gw7] [ 62%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py37] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py37] 
[gw0] [ 62%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py310] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py39] 
[gw4] [ 63%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--pre-py311] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py311] 
[gw2] [ 63%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--post-py39] 
tests/test_integration_tox4.py::test_allenvs_print_deps[--print-deps-to=-] 
[gw6] [ 64%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to-file=--both-py37] 
tests/test_integration_tox4.py::test_allenvs_print_extras[--print-extras-to=-] 
[gw5] [ 64%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py38] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py39] 
[gw3] [ 65%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--pre-py311] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py36] 
[gw1] [ 65%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py311] 
[gw7] [ 66%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py37] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py36] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py38] 
[gw0] [ 66%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py39] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py310] 
[gw4] [ 67%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py311] 
tests/test_integration_tox4.py::test_allenvs_print_deps[--print-deps-to-file=-] 
[gw2] [ 67%] PASSED tests/test_integration_tox4.py::test_allenvs_print_deps[--print-deps-to=-] 
tests/test_integration_tox4.py::test_allenvs_print_extras[--print-extras-to-file=-] 
[gw5] [ 68%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py39] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py310] 
[gw6] [ 68%] PASSED tests/test_integration_tox4.py::test_allenvs_print_extras[--print-extras-to=-] 
tests/test_integration_tox4.py::test_print_deps_to_file[py36] 
[gw3] [ 69%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py36] 
tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py37] 
[gw7] [ 70%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py38] 
tests/test_integration_tox4.py::test_print_deps_to_file[py39] 
[gw1] [ 70%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py36] 
tests/test_integration_tox4.py::test_print_deps_to_file[py37] 
[gw0] [ 71%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--both-py310] 
tests/test_integration_tox4.py::test_print_deps_to_file[py310] 
[gw4] [ 71%] PASSED tests/test_integration_tox4.py::test_allenvs_print_deps[--print-deps-to-file=-] 
tests/test_integration_tox4.py::test_print_deps_to_file[py311] 
[gw5] [ 72%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py310] 
tests/test_integration_tox4.py::test_print_extras_to_file[py37] 
[gw2] [ 72%] PASSED tests/test_integration_tox4.py::test_allenvs_print_extras[--print-extras-to-file=-] 
tests/test_integration_tox4.py::test_print_extras_to_file[py36] 
[gw6] [ 73%] PASSED tests/test_integration_tox4.py::test_print_deps_to_file[py36] 
tests/test_integration_tox4.py::test_print_extras_to_file[py38] 
[gw7] [ 73%] PASSED tests/test_integration_tox4.py::test_print_deps_to_file[py39] 
[gw3] [ 74%] PASSED tests/test_integration_tox4.py::test_print_extras_with_commands_pre_post[--print-extras-to=--post-py37] 
tests/test_integration_tox4.py::test_print_extras_to_file[py310] 
tests/test_integration_tox4.py::test_print_extras_to_file[py39] 
[gw0] [ 74%] PASSED tests/test_integration_tox4.py::test_print_deps_to_file[py310] 
tests/test_integration_tox4.py::test_print_extras_to_file[py311] 
[gw1] [ 75%] PASSED tests/test_integration_tox4.py::test_print_deps_to_file[py37] 
tests/test_integration_tox4.py::test_print_deps_to_file[py38] 
[gw4] [ 75%] PASSED tests/test_integration_tox4.py::test_print_deps_to_file[py311] 
tests/test_integration_tox4.py::test_allenvs_print_deps_to_file[--print-deps-to] 
[gw5] [ 76%] PASSED tests/test_integration_tox4.py::test_print_extras_to_file[py37] 
tests/test_integration_tox4.py::test_allenvs_print_deps_to_file[--print-deps-to-file] 
[gw6] [ 77%] PASSED tests/test_integration_tox4.py::test_print_extras_to_file[py38] 
[gw2] [ 77%] PASSED tests/test_integration_tox4.py::test_print_extras_to_file[py36] 
tests/test_integration_tox4.py::test_allenvs_print_extras_to_file[--print-extras-to-file] 
tests/test_integration_tox4.py::test_allenvs_print_extras_to_file[--print-extras-to] 
[gw7] [ 78%] PASSED tests/test_integration_tox4.py::test_print_extras_to_file[py310] 
tests/test_integration_tox4.py::test_allenvs_print_deps_to_existing_file 
[gw3] [ 78%] PASSED tests/test_integration_tox4.py::test_print_extras_to_file[py39] 
tests/test_integration_tox4.py::test_allenvs_print_extras_to_existing_file 
[gw0] [ 79%] PASSED tests/test_integration_tox4.py::test_print_extras_to_file[py311] 
tests/test_integration_tox4.py::test_allenvs_print_deps_to_file_print_extras_to_other_file[True-True] 
[gw1] [ 79%] PASSED tests/test_integration_tox4.py::test_print_deps_to_file[py38] 
tests/test_integration_tox4.py::test_allenvs_print_deps_to_file_print_extras_to_other_file[True-False] 
[gw4] [ 80%] PASSED tests/test_integration_tox4.py::test_allenvs_print_deps_to_file[--print-deps-to] 
tests/test_integration_tox4.py::test_allenvs_print_deps_to_file_print_extras_to_other_file[False-True] 
[gw0] [ 80%] XFAIL tests/test_integration_tox4.py::test_allenvs_print_deps_to_file_print_extras_to_other_file[True-True] 
tests/test_integration_tox4.py::test_print_deps_extras_to_stdout_is_not_possible[--print-deps-to=----print-extras-to=-] 
[gw2] [ 81%] PASSED tests/test_integration_tox4.py::test_allenvs_print_extras_to_file[--print-extras-to] 
tests/test_integration_tox4.py::test_print_deps_extras_to_stdout_is_not_possible[--print-deps-to-file=----print-extras-to-file=-] 
[gw7] [ 81%] PASSED tests/test_integration_tox4.py::test_allenvs_print_deps_to_existing_file 
tests/test_integration_tox4.py::test_print_deps_extras_to_stdout_is_not_possible[--print-deps-to-file=----print-extras-to=-] 
[gw5] [ 82%] PASSED tests/test_integration_tox4.py::test_allenvs_print_deps_to_file[--print-deps-to-file] 
tests/test_integration_tox4.py::test_allenvs_print_deps_to_file_print_extras_to_other_file[False-False] 
[gw6] [ 82%] PASSED tests/test_integration_tox4.py::test_allenvs_print_extras_to_file[--print-extras-to-file] 
tests/test_integration_tox4.py::test_print_deps_extras_to_same_file_is_not_possible 
[gw3] [ 83%] PASSED tests/test_integration_tox4.py::test_allenvs_print_extras_to_existing_file 
tests/test_integration_tox4.py::test_print_deps_extras_to_stdout_is_not_possible[--print-deps-to=----print-extras-to-file=-] 
[gw0] [ 83%] PASSED tests/test_integration_tox4.py::test_print_deps_extras_to_stdout_is_not_possible[--print-deps-to=----print-extras-to=-] 
tests/test_integration_tox4.py::test_print_deps_without_python_command[--print-deps-to-file=-] 
[gw4] [ 84%] PASSED tests/test_integration_tox4.py::test_allenvs_print_deps_to_file_print_extras_to_other_file[False-True] 
tests/test_integration_tox4.py::test_regular_run_native_toxenv 
[gw1] [ 85%] PASSED tests/test_integration_tox4.py::test_allenvs_print_deps_to_file_print_extras_to_other_file[True-False] 
tests/test_integration_tox4.py::test_regular_run 
[gw7] [ 85%] PASSED tests/test_integration_tox4.py::test_print_deps_extras_to_stdout_is_not_possible[--print-deps-to-file=----print-extras-to=-] 
tests/test_integration_tox4.py::test_recreate_environment[--print-deps-to=-] 
[gw2] [ 86%] PASSED tests/test_integration_tox4.py::test_print_deps_extras_to_stdout_is_not_possible[--print-deps-to-file=----print-extras-to-file=-] 
tests/test_integration_tox4.py::test_print_deps_without_python_command[--print-deps-to=-] 
[gw6] [ 86%] PASSED tests/test_integration_tox4.py::test_print_deps_extras_to_same_file_is_not_possible 
tests/test_integration_tox4.py::test_self_is_not_installed[True---print-deps-to=-] 
[gw3] [ 87%] PASSED tests/test_integration_tox4.py::test_print_deps_extras_to_stdout_is_not_possible[--print-deps-to=----print-extras-to-file=-] 
tests/test_integration_tox4.py::test_self_is_not_installed[True---print-extras-to=-] 
[gw5] [ 87%] PASSED tests/test_integration_tox4.py::test_allenvs_print_deps_to_file_print_extras_to_other_file[False-False] 
tests/test_integration_tox4.py::test_recreate_environment[--current-env] 
[gw0] [ 88%] PASSED tests/test_integration_tox4.py::test_print_deps_without_python_command[--print-deps-to-file=-] 
tests/test_integration_tox4.py::test_self_is_not_installed[True---current-env] 
[gw6] [ 88%] PASSED tests/test_integration_tox4.py::test_self_is_not_installed[True---print-deps-to=-] 
tests/test_integration_tox4.py::test_self_is_installed_with_regular_tox[False] 
[gw3] [ 89%] PASSED tests/test_integration_tox4.py::test_self_is_not_installed[True---print-extras-to=-] 
tests/test_integration_tox4.py::test_passenv[None] 
[gw2] [ 89%] PASSED tests/test_integration_tox4.py::test_print_deps_without_python_command[--print-deps-to=-] 
tests/test_integration_tox4.py::test_self_is_installed_with_regular_tox[True] 
[gw0] [ 90%] PASSED tests/test_integration_tox4.py::test_self_is_not_installed[True---current-env] 
tests/test_integration_tox4.py::test_passenv[__var] 
[gw3] [ 90%] PASSED tests/test_integration_tox4.py::test_passenv[None] 
tests/test_integration_tox4.py::test_pass_env[None] 
[gw0] [ 91%] PASSED tests/test_integration_tox4.py::test_passenv[__var] 
tests/test_integration_tox4.py::test_pass_env[__var] 
[gw3] [ 91%] PASSED tests/test_integration_tox4.py::test_pass_env[None] 
tests/test_integration_tox4.py::test_pass_env[*] 
[gw0] [ 92%] PASSED tests/test_integration_tox4.py::test_pass_env[__var] 
tests/test_integration_tox4.py::test_report_installed 
[gw3] [ 93%] PASSED tests/test_integration_tox4.py::test_pass_env[*] 
[gw0] [ 93%] PASSED tests/test_integration_tox4.py::test_report_installed 
[gw4] [ 94%] PASSED tests/test_integration_tox4.py::test_regular_run_native_toxenv 
tests/test_integration_tox4.py::test_self_is_not_installed[False---print-deps-to=-] 
[gw4] [ 94%] PASSED tests/test_integration_tox4.py::test_self_is_not_installed[False---print-deps-to=-] 
[gw7] [ 95%] PASSED tests/test_integration_tox4.py::test_recreate_environment[--print-deps-to=-] 
tests/test_integration_tox4.py::test_self_is_not_installed[False---current-env] 
[gw5] [ 95%] PASSED tests/test_integration_tox4.py::test_recreate_environment[--current-env] 
tests/test_integration_tox4.py::test_passenv[different list] 
[gw2] [ 96%] PASSED tests/test_integration_tox4.py::test_self_is_installed_with_regular_tox[True] 
tests/test_integration_tox4.py::test_pass_env[different\nlist] 
[gw6] [ 96%] PASSED tests/test_integration_tox4.py::test_self_is_installed_with_regular_tox[False] 
tests/test_integration_tox4.py::test_passenv[*] 
[gw7] [ 97%] PASSED tests/test_integration_tox4.py::test_self_is_not_installed[False---current-env] 
[gw5] [ 97%] PASSED tests/test_integration_tox4.py::test_passenv[different list] 
[gw6] [ 98%] PASSED tests/test_integration_tox4.py::test_passenv[*] 
[gw2] [ 98%] PASSED tests/test_integration_tox4.py::test_pass_env[different\nlist] 
[gw1] [ 99%] PASSED tests/test_integration_tox4.py::test_regular_run 
tests/test_integration_tox4.py::test_self_is_not_installed[False---print-extras-to=-] 
[gw1] [100%] PASSED tests/test_integration_tox4.py::test_self_is_not_installed[False---print-extras-to=-] 

=================================== FAILURES ===================================
________ test_print_deps_with_tox_requires[--print-deps-to-file=--py37] ________
[gw2] linux -- Python 3.12.1 ~/tox-current-env/.tox/py312-tox4/bin/python

projdir = PosixPath('/tmp/pytest-of-churchyard/pytest-23/popen-gw2/test_print_deps_with_tox_requi0/projdir')
toxenv = 'py37', print_deps_stdout_arg = '--print-deps-to-file=-'

    @pytest.mark.parametrize("toxenv", envs_from_tox_ini())
    def test_print_deps_with_tox_requires(projdir, toxenv, print_deps_stdout_arg):
        with modify_config(projdir / "tox.ini") as config:
            config["tox"]["requires"] = "\n    setuptools > 30\n    pluggy"
>       result = tox("-e", toxenv, print_deps_stdout_arg)

~/tox-current-env/tests/test_integration_tox4.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
~/tox-current-env/tests/utils.py:45: in tox
    cp = subprocess.run((sys.executable, "-m", "tox") + q + args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (('~/tox-current-env/.tox/py312-tox4/bin/python', '-m', 'tox', '-q', '-e', 'py37', ...),)
kwargs = {'cwd': '/tmp/pytest-of-churchyard/pytest-23/popen-gw2/test_print_deps_with_tox_requi0/projdir', 'encoding': 'utf-8', .../usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin', 'PIP_DISABLE_PIP_VERSION_CHECK': '1', ...}, 'stderr': -1, ...}
process = <Popen: returncode: 1 args: ('~/tox-current-...>
stdout = 'setuptools>30\npluggy\ntox\nsetuptools>30\npluggy\ntox\n'
stderr = 'Traceback (most recent call last):\n  File "<frozen runpy>", line 198, in _run_module_as_main\n  File "<frozen runpy>...elf._paths)\n                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nTypeError: \'NoneType\' object is not iterable\n'
retcode = 1

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '('~/tox-current-env/.tox/py312-tox4/bin/python', '-m', 'tox', '-q', '-e', 'py37', '--print-deps-to-file=-')' returned non-zero exit status 1.

/usr/lib64/python3.12/subprocess.py:571: CalledProcessError
----------------------------- Captured stdout call -----------------------------
current /tmp/pytest-of-churchyard/pytest-23/popen-gw2/test_print_deps_with_tox_requi0/projdir running in /tmp/pytest-of-churchyard/pytest-23/popen-gw2/test_print_deps_with_tox_requi0/projdir
setuptools>30
pluggy
tox
setuptools>30
pluggy
tox

----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/__main__.py", line 6, in <module>
    run()
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/run.py", line 19, in run
    result = main(sys.argv[1:] if args is None else args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/run.py", line 41, in main
    result = provision(state)
             ^^^^^^^^^^^^^^^^
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/provision.py", line 127, in provision
    return run_provision(provision_tox_env, state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/provision.py", line 154, in run_provision
    outcome = tox_env.execute(cmd=args, stdin=StdinSource.user_only(), show=True, run_id="provision", cwd=Path.cwd())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/tox_env/api.py", line 390, in execute
    with self.execute_async(cmd, stdin, show, cwd, run_id, executor) as status:
  File "/usr/lib64/python3.12/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/tox_env/api.py", line 420, in execute_async
    request = ExecuteRequest(cmd, cwd, self.environment_variables, stdin, run_id, allow=self._allow_externals)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/tox_env/runner.py", line 191, in environment_variables
    environment_variables = super().environment_variables
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/tox_env/api.py", line 339, in environment_variables
    result["PATH"] = self._make_path()
                     ^^^^^^^^^^^^^^^^^
  File "~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/tox_env/api.py", line 376, in _make_path
    values = dict.fromkeys(str(i) for i in self._paths)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

...

=========================== short test summary info ============================
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py37]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py37]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py37]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py37]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py38]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py38]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py38]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py38]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py39]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py39]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py39]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py39]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py310]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py310]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py310]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py310]
current ~/tox-current-env running in ~/tox-current-env
4.5.1.1 from ~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox/__init__.py
registered plugins:
    tox-current-env-0.0.11 at ~/tox-current-env/.tox/py312-tox4/lib/python3.12/site-packages/tox_current_env/hooks.py

Python 3.6.15
Python 3.7.17
Python 3.8.18
Python 3.9.18
Python 3.10.13
Python 3.11.7
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py311]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py311]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py311]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py311]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to=--py36]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_requires[--print-deps-to-file=--py36]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to=--py36]
FAILED tests/test_integration_tox4.py::test_print_deps_with_tox_minversion_and_requires[--print-deps-to-file=--py36]
============ 24 failed, 162 passed, 1 skipped, 1 xfailed in 26.23s =============
py312-tox4: exit 1 (26.67 seconds) ~/tox-current-env> pytest -v tests pid=2151539
.pkg: _exit> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  py312-tox4: FAIL code 1 (30.50=setup[3.83]+cmd[26.67] seconds)
  evaluation failed :( (30.55 seconds)

full output.txt

Possibly remove the fake virtualenv in tox_cleanup hook

If we delete the fake virtualenv in the tox_cleanup hook, we may avoid the entire "running regular after current env is unsupported" thing.

Removing and recreating the fake virtualenv is cheap.

Obviously, it has some problems - if tox is forcefully killed, the hook might not get called, so we need to keep the check forever, but it will be less likely to happen.

Migrate to tox-dev and v4 support

Hello, would you consider moving the project under the tox-dev umbrella? See documentation under https://tox.readthedocs.io/en/rewrite/plugins.html#adoption-of-a-plugin-under-tox-dev-github-organization

Furthermore, tox v4 is getting ready and we'd like to make sure this plugin is supported from day 1, we're collecting feature gaps for this under tox-dev/tox#1974. Would be great if you could join our development chat under https://discord.gg/tox so we can assist with this. If you do so please drop in a line in the #plugin chat with the name of the repository you maintain. Thanks!

Small incompatibility with tox 4.1.2

See: tox-dev/tox@a3d3ec0

tox now runs pip freeze if running in CI is detected. The problem is that our dummy installer here does not have installed method.

We can either:

  • add a dummy method returning nothing because the list of installed packages is not that important in our use cases, or
  • add a simple method inspired from https://github.com/tox-dev/tox/blob/43382af3a228c4dfc098ec50e136971553ee0035/src/tox/tox_env/python/pip/pip_install.py#L69 or
  • make our dummy installer inherit from the official one. IMHO if we'd have this it'd work because pip freeze should work for us but there is a risk that something changes upstream which breaks our expectations and it might lead to our plugin installing packages outside venv or something so we'd have to be very careful about that.

I'm not sure what is the best way forward in regard to the maintenance burden.

There is only one package in Fedora where this is an issue: https://src.fedoraproject.org/rpms/python-tornado/blob/rawhide/f/python-tornado.spec#_58

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.