From 2574356de3f225e208bb40e6b2fd5cbed8baaaed Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Tue, 10 Jun 2025 19:11:30 -0400 Subject: [PATCH 1/7] skpkg: add config files for pre-commit --- .codespell/ignore_words.txt | 6 ------ .flake8 | 2 ++ .isort.cfg | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt index 749b99e2..04b4fcfa 100644 --- a/.codespell/ignore_words.txt +++ b/.codespell/ignore_words.txt @@ -4,11 +4,5 @@ ;; abbreviation for "materials" often used in a journal title mater -;; alternative use of socioeconomic -socio-economic - ;; Frobenius norm used in np.linalg.norm fro - -;; library used for Python package release, no longer used -rever diff --git a/.flake8 b/.flake8 index 5a56eddd..7b2865c1 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, diff --git a/.isort.cfg b/.isort.cfg index 6d831957..86f162b8 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,4 +1,5 @@ [settings] +# Keep import statement below line_length character limit line_length = 79 multi_line_output = 3 include_trailing_comma = True From e7e38aa0e6e0e3425ab8c049b2dde2ea5d135b1a Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Tue, 10 Jun 2025 19:12:11 -0400 Subject: [PATCH 2/7] skpkg: add config files readthedocs, codecov, GitHub --- .github/ISSUE_TEMPLATE/release_checklist.md | 27 +++++++++++++------ .../pull_request_template.md | 15 +++++++++++ .../workflows/build-wheel-release-upload.yml | 6 ++--- .github/workflows/check-news-item.yml | 2 +- .../matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/publish-docs-on-release.yml | 12 +++++++++ .readthedocs.yaml | 13 +++++++++ 7 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md create mode 100644 .github/workflows/publish-docs-on-release.yml create mode 100644 .readthedocs.yaml diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 99ab0d83..6107962c 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -6,26 +6,37 @@ labels: "release" assignees: "" --- -### PyPI/GitHub release checklist: +### PyPI/GitHub rc-release preparation checklist: - [ ] All PRs/issues attached to the release are merged. - [ ] All the badges on the README are passing. - [ ] License information is verified as correct. If you are unsure, please comment below. - [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are - missing), tutorials, and other human written text is up-to-date with any changes in the code. -- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated. + missing), tutorials, and other human-written text is up-to-date with any changes in the code. +- [ ] Installation instructions in the README, documentation, and the website are updated. - [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. - [ ] Grammar and writing quality are checked (no typos). +- [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release. -Please mention @sbillinge here when you are ready for PyPI/GitHub release. Include any additional comments necessary, such as -version information and details about the pre-release here: +Please tag the maintainer (e.g., @username) in the comment here when you are ready for the PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: -### conda-forge release checklist: +### PyPI/GitHub full-release preparation checklist: - +- [ ] Create a new conda environment and install the rc from PyPI (`pip install ==??`) +- [ ] License information on PyPI is correct. +- [ ] Docs are deployed successfully to `https:///`. +- [ ] Successfully run all tests, tutorial examples or do functional testing. +Please let the maintainer know that all checks are done and the package is ready for full release. + +### conda-forge release preparation checklist: + + + +- [ ] Ensure that the full release has appeared on PyPI successfully. - [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to `meta.yaml` in the feedstock. -- [ ] All relevant issues in the feedstock are addressed in the release PR. +- [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions. +- [ ] Tag the maintainer for conda-forge release. ### Post-release checklist 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 0b6f7d81..27fe04c1 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.morph - github_admin_username: sbillinge - + c_extension: false + 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 68490e47..b999887f 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.morph 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 4a5af435..cc9611df 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -12,7 +12,7 @@ on: jobs: matrix-coverage: - uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 with: project: diffpy.morph c_extension: false diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml new file mode 100644 index 00000000..f58afea8 --- /dev/null +++ b/.github/workflows/publish-docs-on-release.yml @@ -0,0 +1,12 @@ +name: Deploy Documentation on Release + +on: + workflow_dispatch: + +jobs: + docs: + uses: scikit-package/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 + with: + project: diffpy.morph + c_extension: false + headless: 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 From 4af26da933269a8fa6243c914773d98a8957fbed Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 03:38:28 +0000 Subject: [PATCH 3/7] [pre-commit.ci] auto fixes from pre-commit hooks --- src/diffpy/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 20e647e9..a1bb822e 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -12,7 +12,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """morph - tools for manipulating and comparing PDF data. """ From 2ecce366e4160a390bfce49066d4f7261147cc44 Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Tue, 10 Jun 2025 23:49:09 -0400 Subject: [PATCH 4/7] fix: add back deleted segments in files --- .codespell/ignore_words.txt | 6 ++++++ .gitignore | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt index 04b4fcfa..749b99e2 100644 --- a/.codespell/ignore_words.txt +++ b/.codespell/ignore_words.txt @@ -4,5 +4,11 @@ ;; abbreviation for "materials" often used in a journal title mater +;; alternative use of socioeconomic +socio-economic + ;; Frobenius norm used in np.linalg.norm fro + +;; library used for Python package release, no longer used +rever diff --git a/.gitignore b/.gitignore index 099e2948..d840f436 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,7 @@ target/ # Ipython Notebook .ipynb_checkpoints + +# version information +setup.cfg +/src/diffpy/*/version.cfg From 8aee5b6240e0bd89cc223b4a262032ca9725efcb Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Wed, 11 Jun 2025 12:11:12 -0400 Subject: [PATCH 5/7] refactor: delete setup.cfg block and remove code in init.py --- .gitignore | 4 ---- src/diffpy/__init__.py | 9 --------- 2 files changed, 13 deletions(-) diff --git a/.gitignore b/.gitignore index d840f436..099e2948 100644 --- a/.gitignore +++ b/.gitignore @@ -91,7 +91,3 @@ target/ # Ipython Notebook .ipynb_checkpoints - -# version information -setup.cfg -/src/diffpy/*/version.cfg diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index a1bb822e..d8e13db0 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -12,12 +12,3 @@ # See LICENSE.rst for license information. # ############################################################################## -"""morph - tools for manipulating and comparing PDF data. -""" - - -from pkgutil import extend_path - -__path__ = extend_path(__path__, __name__) - -# End of file From e31ce7ad0cd52fc633510cb02d267d39610c4e5a Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Wed, 11 Jun 2025 12:48:27 -0400 Subject: [PATCH 6/7] refactor: delete socioeconomic, etc from .codespell --- .codespell/ignore_words.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt index 749b99e2..04b4fcfa 100644 --- a/.codespell/ignore_words.txt +++ b/.codespell/ignore_words.txt @@ -4,11 +4,5 @@ ;; abbreviation for "materials" often used in a journal title mater -;; alternative use of socioeconomic -socio-economic - ;; Frobenius norm used in np.linalg.norm fro - -;; library used for Python package release, no longer used -rever From fc5bac15b6e84b385a062b20eed9e4374575c3b1 Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Wed, 11 Jun 2025 12:53:28 -0400 Subject: [PATCH 7/7] refactor: revert changes in .codespell to pass CI --- .codespell/ignore_words.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt index 04b4fcfa..749b99e2 100644 --- a/.codespell/ignore_words.txt +++ b/.codespell/ignore_words.txt @@ -4,5 +4,11 @@ ;; abbreviation for "materials" often used in a journal title mater +;; alternative use of socioeconomic +socio-economic + ;; Frobenius norm used in np.linalg.norm fro + +;; library used for Python package release, no longer used +rever