Skip to content

Conversation

@rocco8773
Copy link
Member

@rocco8773 rocco8773 commented May 6, 2025

This PR updates the GitHub workflows associated with plasmapy_sphinx. This was need due to infrequent updates to plasmapy_sphinx and changes made to sphinx. What was done...

  • min Python version was bumped from 3.6 to 3.8
  • added dependency packaging
  • added dependency plasmapy > 8.0
  • check_install.yml was created to test installing and importing plasmapy_sphinx on ubuntu-latest for python 3.8, 3.10, 3.11, 3.12, and 3.13
  • updated documentation.yml workflow documentation to test on python 3.8, 3.10, 3.11, 3.12, and 3.13
  • added to documentation.yml workflow sphinx_limits to test documentation building on sphinx < 7.2, sphinx < 7.4 and sphinx < 8.2. Changes in these sphinx version were not backwards compaitble.
    • sphinx >= 8.2 broke functionality related to generate_autosummary_content(). The change dropped argument app for required keywords config, events, and registry. plasmapy_sphinx adopted a strategy to pass the expected arguments based on the installed sphinx version.
    • sphinx >= 7.4 broke functionality related to import_by_name(). The functionality changed how it was handling prefixes for the modules. I updated Automodsumm.import_by_name() to automatically remove an items prefix from its name before calling Autosummary.import_by_name().
    • sphinx >= 7.2 refactored the autodoc option :noindex to :no-index:. So our automodapi functionality can handle the more modern :no-index:, I updated ModAPIDocumenter to set the :noindex: option if :no-index: was given when using sphinx < 7.2 to build.

Note

This PR originated as PR #17, but that PR scope creeped. Thus, the workflow functionality from #17 was broken out into this PR.

rocco8773 added 30 commits May 6, 2025 16:39
… generate_autosummary_content(), who's signature changes for sphinx >= 8.0
@rocco8773 rocco8773 added CI updates continuous integrations GA upates github actions/workflows labels May 6, 2025
Copy link
Member

@namurphy namurphy left a comment

Choose a reason for hiding this comment

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

Good idea splitting this out! It's looking good so I approved it, but let me know if you'd like me to take a look at this again. I have a few thoughts and minor suggestions.

Comment on lines +73 to 75
if sys.version_info < (3, 8): # coverage: ignore
raise ImportError("plasmapy_sphinx does not support Python < 3.8")

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if sys.version_info < (3, 8): # coverage: ignore
raise ImportError("plasmapy_sphinx does not support Python < 3.8")

plasmapy_sphinx is likely only going to be used by experienced developers and 3.8 has been around for a 5 years, so my inclination would be to drop this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we should probably do that. I didn't since I'm using plasmapy_sphinx on packages that have to support older python versions, and I just want to make sure it's a non-issue before dropping support here.

In reality, I can restrict building documentation to newer versions of python for those packages that have to support older version of python.

Comment on lines -28 to +30
fetch-depth: 0
fetch-depth: 1
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for learning from my mistakes! 😅

fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v4
Copy link
Member

@namurphy namurphy May 7, 2025

Choose a reason for hiding this comment

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

Suggested change
uses: actions/setup-python@v4
uses: actions/setup-python@v5

This might need to be changed elsewhere too.


steps:
- name: Checkout code
uses: actions/checkout@v3
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
uses: actions/checkout@v3
uses: actions/checkout@v4

strategy:
fail-fast: false
matrix:
python: ['3.8', '3.10', '3.11', '3.12', '3.13']
Copy link
Member

Choose a reason for hiding this comment

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

🌠 If we wanted to be ambitious and thorough later on (not in this PR!), the lowest-direct resolution strategy of uv would let us test plasmapy_sphinx against the oldest allowed versions of direct dependencies. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Future work... I just want to get this to the next step first.

@rocco8773 rocco8773 marked this pull request as ready for review May 7, 2025 00:27
@rocco8773
Copy link
Member Author

@namurphy Thanks for the quick review...I didn't even have to request it. :)

@rocco8773 rocco8773 merged commit a8521ea into main May 7, 2025
15 checks passed
@rocco8773 rocco8773 deleted the overhaul_workflows_clean branch May 7, 2025 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI updates continuous integrations GA upates github actions/workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants