-
Notifications
You must be signed in to change notification settings - Fork 1
"Modernize" GitHub Wrokflows #18
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
Changes from all commits
cf43d4f
0f8b8fd
63b206a
1246caf
3cc97ce
906b493
da1252d
d02a2e1
2bed441
91ca114
5557b9a
b3cc46f
e2dbfc1
e822c24
4823b10
4626a12
2b4b907
c1af3d0
b3b076c
ade581c
bd0bbad
1c40391
c62570a
fe677e3
f7ac2ad
491af31
afc343a
06a430a
a37349c
230a2d8
6bff2db
b77fb69
108f4c3
5b6bae3
d03199e
0d463fd
a5427bc
83fa54e
eaa5cb7
aae0e6e
19bead0
9c86ae2
80f7e02
5a7bf8d
0d4e4de
0c2776d
6ffd298
e748b95
df14205
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||
| name: Install and Import | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: | ||||||
| - main | ||||||
| - v0.*.x | ||||||
| tags: | ||||||
| - v* | ||||||
| pull_request: | ||||||
| workflow_dispatch: | ||||||
|
|
||||||
| permissions: {} # disables all GitHub permissions for the workflow | ||||||
|
|
||||||
| jobs: | ||||||
| pip-install-and-import: | ||||||
| name: Installation with pip & import (py-${{ matrix.python }}) | ||||||
| runs-on: ${{ matrix.os }} | ||||||
|
|
||||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| python: ['3.8', '3.10', '3.11', '3.12', '3.13'] | ||||||
| os: [ubuntu-latest] | ||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout code | ||||||
| uses: actions/checkout@v3 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| with: | ||||||
| fetch-depth: 1 | ||||||
|
|
||||||
| - name: Set up Python | ||||||
| uses: actions/setup-python@v5 | ||||||
| with: | ||||||
| python-version: ${{ matrix.python }} | ||||||
| cache: pip | ||||||
| - name: Install plasmapy_sphinx with pip | ||||||
| run: pip install . | ||||||
| - name: Import plasmapy_sphinx | ||||||
| run: python -c "import plasmapy_sphinx" | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,8 @@ on: | |
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: {} # disables all GitHub permissions for the workflow | ||
|
|
||
| jobs: | ||
| documentation: | ||
| name: Doc Build - py${{ matrix.python }} on ${{ matrix.os }} | ||
|
|
@@ -18,39 +20,64 @@ jobs: | |
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python: ['3.10', '3.12'] | ||
| python: ['3.8', '3.10', '3.11', '3.12', '3.13'] | ||
| os: [ubuntu-latest] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-depth: 1 | ||
|
Comment on lines
-28
to
+30
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for learning from my mistakes! 😅 |
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python }} | ||
| cache: pip | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --progress-bar off --upgrade pip | ||
| python -m pip install --progress-bar off -r requirements/docs.txt git+https://github.com/PlasmaPy/plasmapy | ||
| python -m pip install --progress-bar off -r requirements/docs.txt | ||
| sudo apt-get install graphviz pandoc | ||
| - name: Build Docs | ||
| run: | | ||
| sphinx-build ./docs ./docs/_build -n --keep-going -W -b html -q | ||
| sphinx-build ./docs ./docs/_build -n --keep-going -W -b html | ||
|
|
||
| sphinx_limits: | ||
| name: Doc Build on ${{ matrix.sphinx }} | ||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
|
|
||
| matrix: | ||
| include: | ||
| - python: '3.11' | ||
| os: ubuntu-latest | ||
| sphinx: sphinx<7.2 | ||
|
|
||
| pip-install: | ||
| name: Installation with pip | ||
| runs-on: ubuntu-latest | ||
| - python: '3.12' | ||
| os: ubuntu-latest | ||
| sphinx: sphinx<7.4 | ||
|
|
||
| - python: '3.12' | ||
| os: ubuntu-latest | ||
| sphinx: sphinx<8.2 | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-depth: 1 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.12 | ||
| - name: Install plasmapy_sphinx with pip | ||
| run: pip install . | ||
| python-version: ${{ matrix.python }} | ||
| cache: pip | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --progress-bar off --upgrade pip | ||
| python -m pip install --progress-bar off -r requirements/docs.txt "${{ matrix.sphinx }}" | ||
| sudo apt-get install graphviz pandoc | ||
| - name: Build Docs | ||
| run: | | ||
| sphinx-build ./docs ./docs/_build -n --keep-going -W -b html | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -70,13 +70,10 @@ | |||||
| # This is the same check as the one at the top of setup.py | ||||||
| import sys | ||||||
|
|
||||||
| if sys.version_info < (3, 6): # coverage: ignore | ||||||
| raise ImportError("plasmapy_sphinx does not support Python < 3.6") | ||||||
| if sys.version_info < (3, 8): # coverage: ignore | ||||||
| raise ImportError("plasmapy_sphinx does not support Python < 3.8") | ||||||
|
|
||||||
|
Comment on lines
+73
to
75
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 In reality, I can restrict building documentation to newer versions of python for those packages that have to support older version of python. |
||||||
| if sys.version_info >= (3, 8): | ||||||
| from importlib.metadata import version, PackageNotFoundError | ||||||
| else: | ||||||
| from importlib_metadata import version, PackageNotFoundError | ||||||
| from importlib.metadata import version, PackageNotFoundError | ||||||
|
|
||||||
| from plasmapy_sphinx import autodoc, automodsumm, directives, utils | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| numpydoc | ||
| packaging | ||
| pillow | ||
| plasmapy > 8.0 | ||
| pygments >= 2.11.0 | ||
| sphinx-changelog | ||
| sphinx-copybutton | ||
|
|
||
There was a problem hiding this comment.
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-directresolution strategy ofuvwould let us testplasmapy_sphinxagainst the oldest allowed versions of direct dependencies. 🤔There was a problem hiding this comment.
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.