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

Finish transition from tox to Nox for current continuous integration checks and weekly tests #2694

Merged

Conversation

namurphy
Copy link
Member

@namurphy namurphy commented May 16, 2024

This PR concludes the switchover from tox to Nox. I wanted to finish this ahead of the PlasmaPy Summer School so that participants won't need to learn how to work with tox (or more specifically, tox.ini).

The changes in this PR include:

  • 📚 I added a Nox session to build docs against the development versions of Sphinx, sphinx_rtd_theme, and nbsphinx.
  • 🧪 I added a Nox session to run tests against the development versions of NumPy, Astropy, xarray, lmfit (since we had a breaking change come up recently), and pandas.
  • 🧪 I switched over weekly tests to entirely using Nox sessions
  • ♻️ I consolidated the separate workflows for building docs and running tests in CI to a single workflow.
  • ✂️ I deleted tox.ini in its entirely, and there was much rejoicing. Using tox has overall been great, except for the INI-formatted configuration files! (We still have mypy.ini...but I'm hoping that's only temporary.)
  • ✂️ I removed requirements.txt, as inspired by Requirements files need to be rethought #2647. It's not being used in CI anymore or by any Nox sessions, so we don't need it. Plus, IDEs are much more adept at getting requirements information from pyproject.toml than they used to be.
  • ✂️ I removed the requirements files used only by tox environments. These have been superseded by the requirements files used by Nox sessions.
  • ✨ I made it so that weekly tests can be run for PRs that are labeled with "run weekly tests in CI".

Some notes:

  • There were a few checks that I wasn't able to get working.
    • 🧪 Testing against the lowest-direct versions of dependencies for Python 3.11 & 3.12.
    • 🧪 Testing against the development version of h5py.
    • 🌠 Building the docs on Windows or macOS, since the sudo apt install step for pandoc and graphviz is specific to Ubuntu.
    • 🦺 I added mypy to the tests dependency set, primarily because then we won't have requirements information defined in noxfile.py that we have to update.

Remaining tasks

  • Clean up noxfile.py
  • Add more changelog entries
  • Possibly spin off some of the smaller, more isolated changes into distinct PRs.

@github-actions github-actions bot added testing CI Related to continuous integration python Pull requests that update Python code nox Related to the nox automation software labels May 16, 2024
@github-actions github-actions bot added the maintenance General updates to package infrastructure label May 16, 2024
@github-actions github-actions bot added the GitHub Actions A continuous integration platform for automating tests and other tasks (see .github/ directory) label May 16, 2024
Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.15%. Comparing base (b0cecc8) to head (e456926).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2694      +/-   ##
==========================================
+ Coverage   94.36%   95.15%   +0.79%     
==========================================
  Files         107      107              
  Lines        9458     9458              
  Branches     2184     2184              
==========================================
+ Hits         8925     9000      +75     
+ Misses        345      276      -69     
+ Partials      188      182       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

To make sure that mypy is run consistently across platforms.
I updated the conditions when this workflow happens so that it is only done
as a cron job for PlasmaPy/PlasmaPy@main, but will still run on PRs with the
appropriate label, and by workflow dispatch.
@github-actions github-actions bot added linters Code linters and autoformatters documentation infrastructure labels May 16, 2024
@namurphy namurphy changed the title Finish transition from tox to Nox for continuous integration checks Finish transition from tox to Nox for current continuous integration checks and weekly tests May 17, 2024
@namurphy namurphy marked this pull request as ready for review June 3, 2024 18:58
@namurphy namurphy requested a review from a team as a code owner June 3, 2024 18:58
@namurphy namurphy requested review from pheuer and ejohnson-96 and removed request for a team and pheuer June 3, 2024 18:58
Comment on lines +21 to +24
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run weekly tests in CI')) ||
(github.event_name == 'schedule' && github.repository == 'PlasmaPy/PlasmaPy' && github.ref == 'refs/heads/main')
Copy link
Member Author

Choose a reason for hiding this comment

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

📝 This is saying that we should run tests...

  • If we manually trigger it (via workflow dispatch)
  • It's a pull request that has been labeled with "run weekly tests in CI"
  • As a cron job if it's on the main branch of PlasmaPy/PlasmaPy.

@namurphy namurphy requested a review from sapols June 21, 2024 23:33
Copy link

@sapols sapols left a comment

Choose a reason for hiding this comment

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

I’m probably not the best person to review this since I wasn’t familiar with nox before this PR, but the motivation to move to it is clear and well documented. I see the benefits over tox so I support the move, and it looks to me like you did everything correctly here.

@sapols
Copy link

sapols commented Jun 25, 2024

How big of a deal is the one failing weekly tests check?

@namurphy
Copy link
Member Author

namurphy commented Jun 25, 2024

@sapols — Thank you kindly for the reviews! 🌱 It's much appreciated!

How big of a deal is the one failing weekly tests check?

We'll need to address the astropy-dev error before our next release, so I'll create a separate issue to look into it. The error is already occurring in our weekly tests on main, so it's unrelated to this PR.

@namurphy namurphy merged commit 162e586 into PlasmaPy:main Jun 25, 2024
37 of 38 checks passed
@namurphy namurphy deleted the nox-test-against-dev-versions-of-dependencies branch June 25, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Related to continuous integration documentation infrastructure GitHub Actions A continuous integration platform for automating tests and other tasks (see .github/ directory) linters Code linters and autoformatters 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 requirements Related to updating requirements run weekly tests in CI Add this label to PRs to additionally run weekly tests. testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants