Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 56 additions & 8 deletions .github/workflows/matrix-and-codecov-on-merge-to-main.yml
Copy link
Contributor Author

@bobleesj bobleesj Nov 27, 2024

Choose a reason for hiding this comment

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

Once this PR is merged, I can create issues to use reusable workflow for the following .yml files - after we figure out py 3.13 windows build problem.

Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,59 @@ on:
workflow_dispatch:

jobs:
matrix-coverage:
uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
with:
project: diffpy.pdffit2
c_extension: true
headless: false
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
coverage:
defaults:
run:
shell: bash -l {0}

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: ["3.10", "3.11", "3.12"]
env:
LATEST_PYTHON_VERSION: "3.12"
steps:
- name: Check out diffpy.pdffit2
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false
python-version: ${{ matrix.python-version }}

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install diffpy.pdffit2 and requirements
run: |
conda install --file requirements/conda.txt
conda install --file requirements/test.txt
conda install --file requirements/build.txt
python -m pip install . --no-deps

- name: Start Xvfb for ubuntu-latest only
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y xvfb
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x16 &

- name: Validate diffpy.pdfffit2
run: |
pytest --cov
coverage report -m
codecov

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/publish-docs-on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy Documentation on Release

on:
release:
types: [published]
workflow_dispatch:

jobs:
docs:
defaults:
run:
shell: bash -l {0}

runs-on: macos-latest
steps:
- name: Check out diffpy.pdffit2
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches branches and tags

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false
python-version: 3.12

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install diffpy.pdffit2 and docs requirements
run: |
conda install --file requirements/conda.txt
conda install --file requirements/docs.txt
conda install --file requirements/build.txt
python -m pip install . --no-deps

- name: build documents
run: make -C doc html

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/build/html
52 changes: 44 additions & 8 deletions .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,47 @@ on:
workflow_dispatch:

jobs:
tests-on-pr:
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
with:
project: diffpy.pdffit2
c_extension: true
headless: false
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
validate:
defaults:
run:
shell: bash -l {0}

runs-on: ubuntu-latest
steps:
- name: Check out diffpy.pdffit2
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false
python-version: 3.12

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install diffpy.pdffit2 and requirements
run: |
conda install --file requirements/conda.txt
conda install --file requirements/test.txt
conda install --file requirements/build.txt
python -m pip install . --no-deps


- name: Validate diffpy.pdffit2
run: |
pytest --cov
coverage report -m
codecov

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions news/py313.rst → news/py312.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**Added:**

* Python 3.13 support
* Python 3.10, 3.11, 3.12 support

**Changed:**

Expand All @@ -12,7 +12,7 @@

**Removed:**

* Python 3.10 support
* Python <= 3.9 support

**Fixed:**

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ maintainers = [
description = "PDFfit2 - real space structure refinement program."
keywords = ["PDF", "structure refinement"]
readme = "README.rst"
requires-python = ">=3.11, <3.14"
requires-python = ">=3.10, <3.13"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
Expand All @@ -25,9 +25,9 @@ classifiers = [
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Scientific/Engineering :: Physics',
'Topic :: Scientific/Engineering :: Chemistry',
]
Expand Down
Loading