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..429bc44 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 }} diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml new file mode 100644 index 0000000..f65a1b4 --- /dev/null +++ b/.github/workflows/publish-docs-on-release.yml @@ -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 diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 06a5530..13a2d17 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 }} 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:** 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', ]