Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Upgrade to tox 4 #8795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 8, 2022
Merged

Upgrade to tox 4 #8795

merged 9 commits into from
Dec 8, 2022

Conversation

adamchainz
Copy link
Contributor

@adamchainz adamchainz commented Dec 8, 2022

Copy of #458 for this repo.

tox 4 has just been released: https://fosstodon.org/@gaborbernat/109473528072009278

tox-py no longer works with it, but that’s okay since the new -f factor option fills the need to run Python 3.X tests in the Python 3.X CI run. I documented this pattern in the package install instructions: https://github.com/adamchainz/tox-py/#installation . Plus, I’ve already changed all the projects I maintain to use it, for example: adamchainz/django-htmx#296

tox 4 only supports Python 3.7+. I’ve added a temporary fork on Python version to retain running with old tox and tox-py on Python 3.6. I think we should drop Python 3.6 in a follow-up PR since it’s been EOL for a while now.

@@ -7,15 +7,6 @@ envlist =
{py311}-{django41,djangomain},
base,dist,docs,

[travis:env]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config for tox-travis, I missed removing it in #7903

Comment on lines +3 to +10
{py36,py37,py38,py39}-django30
{py36,py37,py38,py39}-django31
{py36,py37,py38,py39,py310}-django32
{py38,py39,py310}-{django40,django41,djangomain}
{py311}-{django41,djangomain}
base
dist
docs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is not necessary but it will reduce diff noise going forwards

@@ -39,7 +32,7 @@ deps =
-rrequirements/requirements-testing.txt

[testenv:dist]
commands = ./runtests.py --no-pkgroot --staticfiles {posargs}
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --no-pkgroot --staticfiles {posargs}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tox no longer allows ./runtests.py to work, failing with:

dist: failed with ./runtests.py (resolves to ./runtests.py) is not allowed, use allowlist_externals to allow it

but we can use python runtests.py instead

I also added the warning flags as added to the main [testenv] in #7900

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks Adam. Merge when you're happy — let's go! 🚀:)

tox -e base,dist,docs
tox -e dist --installpkg ./dist/djangorestframework-*.whl
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this run is no longer required because tox now uses isolated builds by default.

We need to remove it because --installpkg seems to be incompatible with deps, or some other option we're using, leading to:

ROOT: HandledError| .pkg_external is already defined as a virtualenv-cmd-builder, cannot be virtualenv-pep-517 too

@adamchainz adamchainz merged commit 59ae95b into master Dec 8, 2022
@adamchainz adamchainz deleted the tox_4 branch December 8, 2022 08:01
@auvipy auvipy added this to the 3.15 milestone Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants