qiskit-experiments icon indicating copy to clipboard operation
qiskit-experiments copied to clipboard

Replace `tox` with `nox`

Open coruscating opened this issue 1 year ago • 2 comments

Summary

This PR replaces tox with nox, an attractive alternative with configuration purely in Python.

Details and comments

The recent issues with tox have been well-documented (see https://github.com/Qiskit/rustworkx/pull/851 for one). nox is used by quite a few big projects, including pip. Besides the Python configuration file, it has a command-line interface similar to tox but with more options, such as tags. For example, now you can run nox -t ci to run the exact suite of builds that the CI uses.

Potential caveats to using nox:

  • By default, nox passes all environmental variables unlike tox. If there are ever specific variables we don't want to pass, they need to be manually overwritten (See https://github.com/wntrblm/nox/issues/253).
  • Possibly slower performance. I saw a comment mention this but it was a few years old. We'll see how fast the CI on this PR runs.

coruscating avatar Apr 01 '23 04:04 coruscating

On the first CI run, the performance seems slightly better than tox. Almost all test builds ran 1-4 minutes faster with the exception of docs, which was a few minutes slower.

A note for migrating from tox: nox provides the tox-to-nox tool for generating a first pass noxfile.py from an existing tox.ini. The tool did not work for me in the 2022.11.21 release (it's a known issue: https://github.com/wntrblm/nox/issues/671), but the previous release worked fine. I still needed to update a lot of the file afterwards, but it's much faster than starting from scratch.

coruscating avatar Apr 01 '23 05:04 coruscating

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 18 '23 13:07 CLAassistant