-
Notifications
You must be signed in to change notification settings - Fork 5
CI: test that runs pdf pack examples in CI #40
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 4 commits
1e2632f
856596e
c379a11
522c561
ac32634
3840f07
f02c948
bce5b86
6d2764e
0ef05db
4d70e15
f1c2ac2
5b27183
d0e17cf
89e89bb
f6ad035
9408042
b2fd64a
666707d
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,61 @@ | ||
| name: Test PDF Pack Scripts | ||
|
|
||
| on: | ||
| push: | ||
| branches: main | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test-conda: | ||
| name: conda-${{ matrix.python-version }}-${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| python-version: [3.11, 3.12, 3.13] # requires manual update | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up conda | ||
| uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| channels: conda-forge | ||
| - name: Install diffpy.cmi | ||
| run: | | ||
| conda install -y diffpy.cmi | ||
| - name: Run diffpy.cmi scripts from docs/examples | ||
| shell: bash | ||
| run: | | ||
| set -e | ||
| export MPLBACKEND=Agg | ||
| for script in docs/examples/ch*/solutions/diffpy-cmi/*.py; do | ||
| python "$script" | ||
| done | ||
|
|
||
| test-pip: | ||
| name: pip-${{ matrix.python-version }}-${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| python-version: [3.11, 3.12, 3.13] # requires manual update | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install diffpy.cmi (pip) | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install diffpy.cmi | ||
| - name: Run diffpy.cmi scripts from docs/examples | ||
| shell: bash | ||
| run: | | ||
| set -e | ||
| export MPLBACKEND=Agg | ||
| for script in docs/examples/ch*/solutions/diffpy-cmi/*.py; do | ||
| python "$script" | ||
| done |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,7 @@ | |
|
|
||
| # If we want to run using multiprocessors, we can switch this to 'True'. | ||
| # This requires that the 'psutil' python package installed. | ||
| RUN_PARALLEL = True | ||
| RUN_PARALLEL = False | ||
|
Contributor
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. Requires psutil to be installed or it throws an error
Contributor
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. We don't want to do this either. Is there a reason not to install psutil? or make it conditional on whether psutil is installed? We don't want to change the behavior of the examples just so the CI will run. |
||
|
|
||
|
|
||
| # Functions that will carry out the refinement ################## | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| **Added:** | ||
|
|
||
| * Add CI for testing examples of the PDF pack. | ||
|
|
||
| **Changed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Deprecated:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Removed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Fixed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Security:** | ||
|
|
||
| * <news item> |
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.
The examples create these dirs. This prevents any accidental commits of the data
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.
this is not good. This is precisely what we want to avoid (test-generated junk). How do the examples decide where to write these files? Can you copy the files to tmpdir and then run them?