Skip to content

Commit 183e4ed

Browse files
authored
Merge pull request #103 from bobleesj/build-doc
Use non-resuable GitHub CI to run Python 3.10, 3.11, 3.12 tests
2 parents 6985866 + 73179b9 commit 183e4ed

File tree

5 files changed

+153
-20
lines changed

5 files changed

+153
-20
lines changed

.github/workflows/matrix-and-codecov-on-merge-to-main.yml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,59 @@ on:
1111
workflow_dispatch:
1212

1313
jobs:
14-
matrix-coverage:
15-
uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
16-
with:
17-
project: diffpy.pdffit2
18-
c_extension: true
19-
headless: false
20-
secrets:
21-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
14+
coverage:
15+
defaults:
16+
run:
17+
shell: bash -l {0}
18+
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
24+
python-version: ["3.10", "3.11", "3.12"]
25+
env:
26+
LATEST_PYTHON_VERSION: "3.12"
27+
steps:
28+
- name: Check out diffpy.pdffit2
29+
uses: actions/checkout@v4
30+
31+
- name: Initialize miniconda
32+
uses: conda-incubator/setup-miniconda@v3
33+
with:
34+
activate-environment: test
35+
auto-update-conda: true
36+
environment-file: environment.yml
37+
auto-activate-base: false
38+
python-version: ${{ matrix.python-version }}
39+
40+
- name: Conda config
41+
run: >-
42+
conda config --set always_yes yes
43+
--set changeps1 no
44+
45+
- name: Install diffpy.pdffit2 and requirements
46+
run: |
47+
conda install --file requirements/conda.txt
48+
conda install --file requirements/test.txt
49+
conda install --file requirements/build.txt
50+
python -m pip install . --no-deps
51+
52+
- name: Start Xvfb for ubuntu-latest only
53+
if: matrix.os == 'ubuntu-latest'
54+
run: |
55+
sudo apt-get install -y xvfb
56+
export DISPLAY=:99
57+
Xvfb :99 -screen 0 1024x768x16 &
58+
59+
- name: Validate diffpy.pdfffit2
60+
run: |
61+
pytest --cov
62+
coverage report -m
63+
codecov
64+
65+
- name: Upload coverage to Codecov
66+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION
67+
uses: codecov/codecov-action@v4
68+
env:
69+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy Documentation on Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
docs:
10+
defaults:
11+
run:
12+
shell: bash -l {0}
13+
14+
runs-on: macos-latest
15+
steps:
16+
- name: Check out diffpy.pdffit2
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Fetches branches and tags
20+
21+
- name: Initialize miniconda
22+
uses: conda-incubator/setup-miniconda@v3
23+
with:
24+
activate-environment: build
25+
auto-update-conda: true
26+
environment-file: environment.yml
27+
auto-activate-base: false
28+
python-version: 3.12
29+
30+
- name: Conda config
31+
run: >-
32+
conda config --set always_yes yes
33+
--set changeps1 no
34+
35+
- name: Install diffpy.pdffit2 and docs requirements
36+
run: |
37+
conda install --file requirements/conda.txt
38+
conda install --file requirements/docs.txt
39+
conda install --file requirements/build.txt
40+
python -m pip install . --no-deps
41+
42+
- name: build documents
43+
run: make -C doc html
44+
45+
- name: Deploy
46+
uses: peaceiris/actions-gh-pages@v4
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
publish_dir: ./doc/build/html

.github/workflows/tests-on-pr.yml

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,47 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
tests-on-pr:
12-
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
13-
with:
14-
project: diffpy.pdffit2
15-
c_extension: true
16-
headless: false
17-
secrets:
18-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
11+
validate:
12+
defaults:
13+
run:
14+
shell: bash -l {0}
15+
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check out diffpy.pdffit2
19+
uses: actions/checkout@v4
20+
21+
- name: Initialize miniconda
22+
uses: conda-incubator/setup-miniconda@v3
23+
with:
24+
activate-environment: test
25+
auto-update-conda: true
26+
environment-file: environment.yml
27+
auto-activate-base: false
28+
python-version: 3.12
29+
30+
- name: Conda config
31+
run: >-
32+
conda config --set always_yes yes
33+
--set changeps1 no
34+
35+
- name: Install diffpy.pdffit2 and requirements
36+
run: |
37+
conda install --file requirements/conda.txt
38+
conda install --file requirements/test.txt
39+
conda install --file requirements/build.txt
40+
python -m pip install . --no-deps
41+
42+
43+
- name: Validate diffpy.pdffit2
44+
run: |
45+
pytest --cov
46+
coverage report -m
47+
codecov
48+
49+
- name: Upload coverage to Codecov
50+
uses: codecov/codecov-action@v4
51+
with:
52+
verbose: true
53+
fail_ci_if_error: true
54+
token: ${{ secrets.CODECOV_TOKEN }}

news/py313.rst renamed to news/py312.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**Added:**
22

3-
* Python 3.13 support
3+
* Python 3.10, 3.11, 3.12 support
44

55
**Changed:**
66

@@ -12,7 +12,7 @@
1212

1313
**Removed:**
1414

15-
* Python 3.10 support
15+
* Python <= 3.9 support
1616

1717
**Fixed:**
1818

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ maintainers = [
1414
description = "PDFfit2 - real space structure refinement program."
1515
keywords = ["PDF", "structure refinement"]
1616
readme = "README.rst"
17-
requires-python = ">=3.11, <3.14"
17+
requires-python = ">=3.10, <3.13"
1818
classifiers = [
1919
'Development Status :: 5 - Production/Stable',
2020
'Environment :: Console',
@@ -25,9 +25,9 @@ classifiers = [
2525
'Operating System :: Microsoft :: Windows',
2626
'Operating System :: POSIX',
2727
'Operating System :: Unix',
28+
'Programming Language :: Python :: 3.10',
2829
'Programming Language :: Python :: 3.11',
2930
'Programming Language :: Python :: 3.12',
30-
'Programming Language :: Python :: 3.13',
3131
'Topic :: Scientific/Engineering :: Physics',
3232
'Topic :: Scientific/Engineering :: Chemistry',
3333
]

0 commit comments

Comments
 (0)