From 9e7efc48ff7d0e89fb9bbd782931003fce694992 Mon Sep 17 00:00:00 2001 From: Yuchen Ethan Xiao Date: Tue, 10 Jun 2025 15:38:51 -0400 Subject: [PATCH 1/2] skpkg: add config files for pre-commit --- .flake8 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.flake8 b/.flake8 index 2d2cb168..04d2d0b0 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,5 @@ +# As of now, flake8 does not natively support configuration via pyproject.toml +# https://github.com/microsoft/vscode-flake8/issues/135 [flake8] exclude = .git, From 4027429cd8f713290e04239f7cad37e4d9e487fa Mon Sep 17 00:00:00 2001 From: Yuchen Ethan Xiao Date: Tue, 10 Jun 2025 15:41:58 -0400 Subject: [PATCH 2/2] skpkg: add config files readthedocs, codecov, GitHub --- .../pull_request_template.md | 15 +++++ .../workflows/build-wheel-release-upload.yml | 4 +- .github/workflows/check-news-item.yml | 2 +- .../matrix-and-codecov-on-merge-to-main.yml | 67 +++---------------- .github/workflows/publish-docs-on-release.yml | 2 +- .readthedocs.yaml | 13 ++++ 6 files changed, 40 insertions(+), 63 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md create mode 100644 .readthedocs.yaml diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 00000000..1099d862 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,15 @@ +### What problem does this PR address? + + + +### What should the reviewer(s) do? + + + + diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 1ed2e6b3..76ad272e 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -8,11 +8,11 @@ on: jobs: release: - uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.pdfgui c_extension: false - github_admin_username: sbillinge + maintainer_GITHUB_username: sbillinge secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} PAT_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index 33a188fd..63692232 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -7,6 +7,6 @@ on: jobs: check-news-item: - uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_check-news-item.yml@v0 with: project: diffpy.pdfgui 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 8fb1923b..ac39241b 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -11,62 +11,11 @@ on: workflow_dispatch: jobs: - 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.11", "3.12", "3.13"] - env: - LATEST_PYTHON_VERSION: "3.13" - steps: - - name: Check out diffpy.pdfgui - uses: actions/checkout@v4 - - - name: Initialize miniconda - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: test - miniforge-version: latest - 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.pdfgui and requirements - run: | - conda install --file requirements/test.txt - conda install wxpython diffpy.utils matplotlib-base - pip install diffpy.pdffit2==1.5.0rc1 - 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.pdfgui - run: | - if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - export DISPLAY=:99 - fi - 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 }} + matrix-coverage: + uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 + with: + project: diffpy.pdfgui + c_extension: false + headless: true + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index b4593308..e0f24785 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -7,7 +7,7 @@ on: jobs: docs: - uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 with: project: diffpy.pdfgui c_extension: false diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..47f7a017 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,13 @@ +version: 2 + +build: + os: "ubuntu-22.04" + tools: + python: "latest" + +python: + install: + - requirements: requirements/docs.txt + +sphinx: + configuration: doc/source/conf.py