django / daphne

Django Channels HTTP/WebSocket server
BSD 3-Clause "New" or "Revised" License
2.37k stars 266 forks source link

Upgrade to tox 4 #458

Closed adamchainz closed 1 year ago

adamchainz commented 1 year ago

tox 4 final is expected shortly: https://fosstodon.org/@gaborbernat/109428598380006519

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: https://github.com/adamchainz/django-htmx/pull/296

adamchainz commented 1 year ago

tox 4 parses setup.cfg to figure out which dependencies to install - this requires porting from the legacy setup.py to setup.cfg for this to work, plus adding a pyproject.toml for PEP 517 package builds.

There’s a bug from tox 4 rc 2+ that means the install of twisted[tls] fails - reported upstream: https://github.com/tox-dev/tox/issues/2604 . To get this to pass I pinned to RC1 but we should probably wait before merging.

gaborbernat commented 1 year ago

tox 4 parses setup.cfg to figure out which dependencies to install - this requires porting from the legacy setup.py to setup.cfg for this to work, plus adding a pyproject.toml for PEP 517 package builds.

You should not need to do anything, as while we use https://peps.python.org/pep-0621/ we fallback to https://peps.python.org/pep-0517/#prepare-metadata-for-build-wheel when getting the install dependencies. So pure setup.py should also work; just the entire process would be a bit slower.

adamchainz commented 1 year ago

You’re right - I think I must have gotten confused whilst tracking down https://github.com/tox-dev/tox/issues/2604 . But now I’ve ported, I think we should keep it, declarative metadata is much nicer :)