Skip to content
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

Switch GitHub workflows used in CI from tox environments to nox sessions #2685

Merged
merged 47 commits into from
May 16, 2024

Conversation

namurphy
Copy link
Member

@namurphy namurphy commented May 13, 2024

Most of our GitHub workflows and heretofore been based on tox environments. However, the configuration files for tox is in an INI format, which I've perpetually had trouble understanding and maintaining. In contrast, nox is a test runner that is directly inspired by tox, with the exception that nox configuration files are written in Python.

I've spent perhaps a tenth as much time working with nox than I have with tox, and I already have a much better understanding of working with nox. For a Python project, it makes a lot of sense to configure things in Python when possible. Switching to nox will move us half of the way from removing INI files from our configuration. (The remaining files is mypy.ini, though the configuration for that will eventually go in pyproject.toml.)

In the recent past, we've had a few PRs that switched tox environments to nox sessions (#2654, #2664, #2656, #2681, #2683). This PR switches several of our GitHub workflows over from using tox environments to using nox sessions.

Closes #1734 at long last!

Important

Some of the checks are showing as "Expected" without being performed because I changed the names of some checks in this pull request without changing the names of required checks in the repository settings. So, it's expected that the "Expected" checks should be unexpected. 😅

@github-actions github-actions bot added CI Related to continuous integration GitHub Actions A continuous integration platform for automating tests and other tasks (see .github/ directory) labels May 13, 2024
@namurphy namurphy changed the title Switch GitHub workflows from tox environments to nox sessions Switch GitHub workflows used in CI from tox environments to nox sessions May 13, 2024
In the past, I've occasionally updated the OS or version of Python in one place,
but not the other. By generating names from the matrix, it'll make it more likely
that there will be self-consistency.  (Also: DRY principle)
@namurphy namurphy requested review from ejohnson-96 and removed request for a team May 13, 2024 23:18
@namurphy namurphy added test failure is unrelated For PRs which should be reviewed even if a check fails or remains uncompleted nox Related to the nox automation software labels May 14, 2024
@namurphy namurphy removed docs PlasmaPy Docs at http://docs.plasmapy.org CI Related to continuous integration GitHub Actions A continuous integration platform for automating tests and other tasks (see .github/ directory) contributor guide packaging Related to packaging or distribution nox Related to the nox automation software labels May 15, 2024
@namurphy
Copy link
Member Author

namurphy commented May 15, 2024

I removed labels to test the labeler GitHub Action after #2690. If it worked, the labels should be added back after the next push.

Update 1: Nope! Didn't work...

Update 2: Fixed it in #2691!

@github-actions github-actions bot added docs PlasmaPy Docs at http://docs.plasmapy.org CI Related to continuous integration GitHub Actions A continuous integration platform for automating tests and other tasks (see .github/ directory) contributor guide packaging Related to packaging or distribution maintenance General updates to package infrastructure documentation infrastructure python Pull requests that update Python code nox Related to the nox automation software labels May 15, 2024
Copy link
Contributor

@ejohnson-96 ejohnson-96 left a comment

Choose a reason for hiding this comment

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

There are 3 checks waiting, apart from that looks good 👍

@namurphy
Copy link
Member Author

There are 3 checks waiting, apart from that looks good 👍

The three checks that are waiting are because I changed the names of the tests in the GitHub Action, but I haven't yet gone into the repo settings to change the name of which tests are required since that would break all other PRs. I'll do that right after merging.

Thank you as always for the reviews!

@namurphy namurphy merged commit c1343b8 into PlasmaPy:main May 16, 2024
15 checks passed
@namurphy namurphy deleted the nox-in-github-actions branch May 16, 2024 16:28
@github-actions github-actions bot removed the status: ready for review PRs that are ready for code review label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Related to continuous integration contributor guide docs PlasmaPy Docs at http://docs.plasmapy.org documentation infrastructure GitHub Actions A continuous integration platform for automating tests and other tasks (see .github/ directory) maintenance General updates to package infrastructure nox Related to the nox automation software packaging Related to packaging or distribution python Pull requests that update Python code test failure is unrelated For PRs which should be reviewed even if a check fails or remains uncompleted testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run tests with Nox instead of tox
2 participants