From 7c8023c0c25905fd8728ec5c9ffaa82ee55e9160 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:20:13 -0500 Subject: [PATCH 1/8] build doc on release --- .github/workflows/publish-docs-on-release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/publish-docs-on-release.yml diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml new file mode 100644 index 0000000..b517f2b --- /dev/null +++ b/.github/workflows/publish-docs-on-release.yml @@ -0,0 +1,15 @@ +name: Deploy Documentation on Release + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + docs: + permissions: + contents: write + uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 + with: + project: diffpy.pdffit2 + c_extension: true From 788b7f9cb2f2a9cca96bb69c122dbd4cfdf2b96c Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:22:34 -0500 Subject: [PATCH 2/8] Use latest macos to build doc --- .github/workflows/publish-docs-on-release.yml | 46 ++++++++++++++++--- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index b517f2b..7e9c5a6 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -7,9 +7,43 @@ on: jobs: docs: - permissions: - contents: write - uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 - with: - project: diffpy.pdffit2 - c_extension: true + 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.13 + + - 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 \ No newline at end of file From fa5677464b471b3409b475296b3d32bef9540da4 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:30:04 -0500 Subject: [PATCH 3/8] Use py3.10 to 3.12 matrix CI --- .../matrix-and-codecov-on-merge-to-main.yml | 64 ++++++++++++++++--- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index 0f2caa5..9ed76e7 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -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 }} \ No newline at end of file From a5fe28ecc62e758aa1a5637dc3cbb4afa1c29a71 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:33:47 -0500 Subject: [PATCH 4/8] Remove support for py 3.13, add support for 3.10 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8a1b15c..4f02b7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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', @@ -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', ] From 8a05f92739018689ed68602f4dbc52c9b14e6b5c Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:35:04 -0500 Subject: [PATCH 5/8] Use py 3.12 for doc building --- .github/workflows/publish-docs-on-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index 7e9c5a6..02137b8 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -25,7 +25,7 @@ jobs: auto-update-conda: true environment-file: environment.yml auto-activate-base: false - python-version: 3.13 + python-version: 3.12 - name: Conda config run: >- From a3e5da12b3b19a81e01e05e5d7357c7b7e170f8b Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:48:07 -0500 Subject: [PATCH 6/8] Use py 3.12 for test on pr --- .github/workflows/tests-on-pr.yml | 52 ++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 06a5530..71b672d 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -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 }} \ No newline at end of file From 7086a6fe6a8ffb53b4d3ee1977a770b9f2c93bb8 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:50:09 -0500 Subject: [PATCH 7/8] Add news --- news/{py313.rst => py312.rst} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename news/{py313.rst => py312.rst} (71%) diff --git a/news/py313.rst b/news/py312.rst similarity index 71% rename from news/py313.rst rename to news/py312.rst index 899bc26..301a9fd 100644 --- a/news/py313.rst +++ b/news/py312.rst @@ -1,6 +1,6 @@ **Added:** -* Python 3.13 support +* Python 3.10, 3.11, 3.12 support **Changed:** @@ -12,7 +12,7 @@ **Removed:** -* Python 3.10 support +* Python <= 3.9 support **Fixed:** From 73179b990c5a9f5ff0dedf7cf2d828e2eabc5ad4 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:50:51 -0500 Subject: [PATCH 8/8] Apply pre-commit --- .github/workflows/matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/publish-docs-on-release.yml | 2 +- .github/workflows/tests-on-pr.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index 9ed76e7..429bc44 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -66,4 +66,4 @@ jobs: if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION uses: codecov/codecov-action@v4 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index 02137b8..f65a1b4 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -46,4 +46,4 @@ jobs: uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./doc/build/html \ No newline at end of file + publish_dir: ./doc/build/html diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 71b672d..13a2d17 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -51,4 +51,4 @@ jobs: with: verbose: true fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }}