From eb55b1a50d988cc1f541b3228b8e548e377c537f Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Sun, 11 Oct 2026 19:42:11 -0400 Subject: [PATCH 1/4] skpkg: scikit-package to the latest workflow standard --- .github/ISSUE_TEMPLATE/release_checklist.md | 7 +- .../build-and-publish-docs-on-dispatch.yml | 18 ++++++ .../workflows/build-wheel-release-upload.yml | 64 ++++++++++++++++++- .github/workflows/check-news-item.yml | 2 +- ...rge-to-main.yml => matrix-and-codecov.yml} | 14 ++-- .github/workflows/publish-docs-on-release.yml | 13 ---- .pre-commit-config.yaml | 4 +- CODE-OF-CONDUCT.rst | 2 +- MANIFEST.in | 12 ++++ README.rst | 7 +- cookiecutter.json | 20 ++++++ docs/source/conf.py | 6 +- docs/source/img/.placeholder | 0 docs/source/snippets/.placeholder | 0 news/skpkg-update.rst | 23 +++++++ pyproject.toml | 4 +- requirements/docs.txt | 2 +- setup.py | 37 +++++++++++ src/diffpy/__init__.py | 8 +-- src/diffpy/srreal/__init__.py | 8 ++- src/diffpy/srreal/version.py | 12 ++-- tests/test_version.py | 2 +- 22 files changed, 204 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/build-and-publish-docs-on-dispatch.yml rename .github/workflows/{matrix-and-codecov-on-merge-to-main.yml => matrix-and-codecov.yml} (56%) delete mode 100644 .github/workflows/publish-docs-on-release.yml create mode 100644 MANIFEST.in create mode 100644 cookiecutter.json create mode 100644 docs/source/img/.placeholder create mode 100644 docs/source/snippets/.placeholder create mode 100644 news/skpkg-update.rst create mode 100644 setup.py diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 6107962c..56c5fca3 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -11,12 +11,13 @@ assignees: "" - [ ] 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. +- [ ] Locally rendered documentation contains all appropriate pages, tutorials, and other human-written text is up-to-date with any changes in the code. +- [ ] All API references are included. To check this, run `conda install scikit-package` and then `package build api-doc`. Review any edits made by rerendering the docs locally. - [ ] 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. +- [ ] Dispatch matrix testing to test the release on all Python versions and systems. If you do not have permission to run this workflow, tag the maintainer and say `@maintainer, please dispatch matrix testing workflow`. 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: @@ -34,7 +35,7 @@ Please let the maintainer know that all checks are done and the package is ready - [ ] 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. +- [ ] New package dependencies listed in `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock. - [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions. - [ ] Tag the maintainer for conda-forge release. diff --git a/.github/workflows/build-and-publish-docs-on-dispatch.yml b/.github/workflows/build-and-publish-docs-on-dispatch.yml new file mode 100644 index 00000000..d5e11933 --- /dev/null +++ b/.github/workflows/build-and-publish-docs-on-dispatch.yml @@ -0,0 +1,18 @@ +name: Build and Publish Docs on Dispatch + +on: + workflow_dispatch: + +jobs: + get-python-version: + uses: scikit-package/release-scripts/.github/workflows/_get-python-version-latest.yml@v0 + with: + python_version: 0 + + docs: + uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0 + with: + project: diffpy.srreal + c_extension: true + headless: false + python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }} diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index fbf2d285..98e78b0f 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -1,13 +1,29 @@ -name: Release (GitHub/PyPI) and Deploy Docs +name: Build Wheel and Release +# Trigger on tag push or manual dispatch. +# Tag and release privilege are verified inside the reusable workflow. on: workflow_dispatch: push: tags: - - "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml + - "*" + +# ── Release modality ────────────────────────────────────────────────────────── +# Three options are provided below. Only ONE job should be active at a time. +# To switch: comment out the active job and uncomment your preferred option, +# then commit the change to main before tagging a release. +# ───────────────────────────────────────────────────────────────────────────── jobs: - release: + # Option 1 (default): Release to GitHub, publish to PyPI, and deploy docs. + # + # The wheel is uploaded to PyPI so users can install with `pip install`. + # A GitHub release is created with the changelog as the release body, and + # the Sphinx documentation is rebuilt and deployed to GitHub Pages. + # + # Choose this for open-source packages distributed via PyPI and/or + # conda-forge where broad public availability is the goal. + build-release: uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.srreal @@ -16,3 +32,45 @@ jobs: secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + + # Option 2: Release to GitHub and deploy docs, without publishing to PyPI. + # + # A GitHub release is created and the Sphinx docs are deployed, but the + # wheel is not uploaded to PyPI. The source code remains publicly visible + # on GitHub and can be installed directly from there. + # + # Choose this when the package is public but you prefer to keep it off the + # default pip index — for example, if you distribute via conda-forge only, + # or if the package is not yet ready for a permanent PyPI presence. + # + # To use: comment out Option 1 above and uncomment the lines below. + # build-release-no-pypi: + # uses: scikit-package/release-scripts/.github/workflows/_build-release-github-no-pypi.yml@v0 + # with: + # project: diffpy.srreal + # c_extension: true + # maintainer_github_username: sbillinge + # secrets: + # PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + + # Option 3: Release to GitHub with wheel, license, and instructions bundled + # as a downloadable zip attached to the GitHub release asset. + # + # The wheel is built and packaged together with INSTRUCTIONS.txt and the + # LICENSE file into a zip that is attached directly to the GitHub release. + # Users with access to the (private) repo download the zip, follow the + # instructions inside, and install locally with pip. No PyPI or conda-forge + # upload occurs, and no docs are deployed. + # + # Choose this for private or restricted packages where distribution must be + # controlled: only users with repo access can download the release asset, + # making the GitHub release itself the distribution channel. + # + # To use: comment out Option 1 above and uncomment the lines below. + # build-release-private: + # uses: scikit-package/release-scripts/.github/workflows/_build-release-github-private-pure.yml@v0 + # with: + # project: diffpy.srreal + # maintainer_github_username: sbillinge + # secrets: + # PAT_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index 88908d6f..2ac3c85f 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -3,7 +3,7 @@ name: Check for News on: pull_request_target: branches: - - main + - main # GitHub does not evaluate expressions in trigger filters; edit this value if your base branch is not main jobs: check-news-item: diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov.yml similarity index 56% rename from .github/workflows/matrix-and-codecov-on-merge-to-main.yml rename to .github/workflows/matrix-and-codecov.yml index 85b03e8c..45171c63 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov.yml @@ -1,9 +1,9 @@ -name: CI +name: Matrix and Codecov on: - push: - branches: - - main + # push: + # branches: + # - main release: types: - prereleased @@ -17,11 +17,5 @@ jobs: project: diffpy.srreal c_extension: true headless: false - run: | - set -e - if [[ $(uname -s) == Linux ]]; then - python -m pip install git+https://github.com/diffpy/pyobjcryst.git@nanobind_migration_test - python -c 'import pyobjcryst._pyobjcryst' - fi secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml deleted file mode 100644 index 45fd601b..00000000 --- a/.github/workflows/publish-docs-on-release.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Deploy Documentation on Release - -on: - workflow_dispatch: - -jobs: - docs: - uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0 - with: - project: diffpy.srreal - c_extension: true - python_version: 0 - headless: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95734761..7554beef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ default_language_version: - python: python3 + python: python3.14 ci: autofix_commit_msg: | [pre-commit.ci] auto fixes from pre-commit hooks @@ -52,7 +52,7 @@ repos: - tomli # prettier - multi formatter for .json, .yml, and .md files - repo: https://github.com/pre-commit/mirrors-prettier - rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8 + rev: v4.0.0-alpha.8 hooks: - id: prettier additional_dependencies: diff --git a/CODE-OF-CONDUCT.rst b/CODE-OF-CONDUCT.rst index e8199ca5..25fafe27 100644 --- a/CODE-OF-CONDUCT.rst +++ b/CODE-OF-CONDUCT.rst @@ -67,7 +67,7 @@ Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -sb2896@columbia.edu. All complaints will be reviewed and investigated promptly and fairly. +sbillinge@ucsb.edu. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..f1a78eec --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,12 @@ +graft src +graft tests +graft requirements + +include AUTHORS.rst LICENSE*.rst README.rst + +# Exclude all bytecode files and __pycache__ directories +global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files. +global-exclude .DS_Store # Exclude Mac filesystem artifacts. +global-exclude __pycache__ # Exclude Python cache directories. +global-exclude .git* # Exclude git files and directories. +global-exclude .idea # Exclude PyCharm project settings. diff --git a/README.rst b/README.rst index 0b114161..a12b88c0 100644 --- a/README.rst +++ b/README.rst @@ -15,8 +15,8 @@ .. |Black| image:: https://img.shields.io/badge/code_style-black-black :target: https://github.com/psf/black -.. |CI| image:: https://github.com/diffpy/diffpy.srreal/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg - :target: https://github.com/diffpy/diffpy.srreal/actions/workflows/matrix-and-codecov-on-merge-to-main.yml +.. |CI| image:: https://github.com/diffpy/diffpy.srreal/actions/workflows/matrix-and-codecov.yml/badge.svg + :target: https://github.com/diffpy/diffpy.srreal/actions/workflows/matrix-and-codecov.yml .. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.srreal/branch/main/graph/badge.svg :target: https://codecov.io/gh/diffpy/diffpy.srreal @@ -25,6 +25,7 @@ :target: https://anaconda.org/conda-forge/diffpy.srreal .. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff + :target: https://github.com/diffpy/diffpy.srreal/pulls .. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.srreal :target: https://pypi.org/project/diffpy.srreal/ @@ -162,7 +163,7 @@ Before contributing, please read our `Code of Conduct `_ or email Simon Billinge at sb2896@columbia.edu. +For more information on diffpy.srreal please visit the project `web-page `_ or email the maintainers ``Simon Billinge(sbillinge@ucsb.edu)``. Acknowledgements ---------------- diff --git a/cookiecutter.json b/cookiecutter.json new file mode 100644 index 00000000..5b88946b --- /dev/null +++ b/cookiecutter.json @@ -0,0 +1,20 @@ +{ + "author_names": "Simon Billinge", + "author_emails": "sbillinge@ucsb.edu", + "maintainer_names": "Simon Billinge", + "maintainer_emails": "sbillinge@ucsb.edu", + "maintainer_github_usernames": "sbillinge", + "contributors": "Simon Billinge, Billinge Group members", + "project_name": "diffpy.srreal", + "license_holders": "diffpy.srreal contributors", + "github_username_or_orgname": "diffpy", + "github_repo_name": "diffpy.srreal", + "conda_pypi_package_dist_name": "diffpy.srreal", + "package_dir_name": "diffpy.srreal", + "project_short_description": "Calculators for PDF, bond valence sum, and other quantities based on atom pair interaction.", + "project_keywords": "PDF, BVS, atom, overlap, calculator, real-space", + "minimum_supported_python_version": "3.12", + "maximum_supported_python_version": "3.14", + "project_needs_c_code_compiled": "Yes", + "project_has_gui_tests": "No" +} diff --git a/docs/source/conf.py b/docs/source/conf.py index 6ac5e09e..c6f92c71 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# diffpy.srreal documentation build configuration file, created by +# diffpy.srreal documentation build configuration file, created by # noqa: E501 # sphinx-quickstart on Thu Jan 30 15:49:41 2014. # # This file is execfile()d with the current directory set to its @@ -26,7 +26,7 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the -# documentation root, use Path().resolve() to make it absolute, like shown here. +# documentation root, use Path().resolve() to make it absolute, like shown here. # noqa: E501 # sys.path.insert(0, str(Path(".").resolve())) sys.path.insert(0, str(Path("../..").resolve())) sys.path.insert(0, str(Path("../../src").resolve())) @@ -50,7 +50,7 @@ "sphinx.ext.intersphinx", "sphinx_rtd_theme", "sphinx_copybutton", - "m2r", + "m2r2", ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/source/img/.placeholder b/docs/source/img/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/docs/source/snippets/.placeholder b/docs/source/snippets/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/news/skpkg-update.rst b/news/skpkg-update.rst new file mode 100644 index 00000000..a5935787 --- /dev/null +++ b/news/skpkg-update.rst @@ -0,0 +1,23 @@ +**Added:** + +* No News Added: skpkg-update to the latest workflow standard + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/pyproject.toml b/pyproject.toml index db67cf9e..9541ca0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,10 +11,10 @@ name = "diffpy.srreal" dynamic = ["version"] dependencies = ["numpy"] authors = [ - { name="Simon Billinge", email="sb2896@columbia.edu" }, + {name='Simon Billinge', email='sbillinge@ucsb.edu'}, ] maintainers = [ - { name="Simon Billinge", email="sb2896@columbia.edu" }, + {name='Simon Billinge', email='sbillinge@ucsb.edu'}, ] description = "Calculators for PDF, bond valence sum, and other quantities based on atom pair interaction." keywords = ['PDF', 'BVS', 'atom', 'overlap', 'calculator', 'real-space'] diff --git a/requirements/docs.txt b/requirements/docs.txt index 5f34c6ed..1de813f9 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -2,4 +2,4 @@ sphinx sphinx_rtd_theme sphinx-copybutton doctr -m2r +m2r2 diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..c96f22e1 --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +# Extensions script for diffpy.srreal + +import os +import re +import sys +import glob +from setuptools import setup +from setuptools import Extension + +# Define extension arguments here +ext_kws = { + 'libraries' : [], + 'extra_compile_args' : [], + 'extra_link_args' : [], + 'include_dirs' : [], +} + +def create_extensions(): + "Initialize Extension objects for the setup function." + ext = Extension('diffpy.srreal.srreal', + glob.glob('src/extensions/*.cpp'), + **ext_kws) + return [ext] + + +# Extensions not included in pyproject.toml +setup_args = dict( + ext_modules = [], +) + + +if __name__ == '__main__': + setup_args['ext_modules'] = create_extensions() + setup(**setup_args) + diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 23aceba2..3adf2d59 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -2,6 +2,7 @@ ############################################################################## # # (c) 2025 The Trustees of Columbia University in the City of New York. +# (c) 2026 diffpy.srreal contributors. # All rights reserved. # # File coded by: Billinge Group members and community contributors. @@ -12,10 +13,3 @@ # See LICENSE.rst for license information. # ############################################################################## -"""Blank namespace package for module diffpy.""" - -from pkgutil import extend_path - -__path__ = extend_path(__path__, __name__) - -# End of file diff --git a/src/diffpy/srreal/__init__.py b/src/diffpy/srreal/__init__.py index 2beff97f..42ac1069 100644 --- a/src/diffpy/srreal/__init__.py +++ b/src/diffpy/srreal/__init__.py @@ -2,9 +2,10 @@ ############################################################################## # # (c) 2025 The Trustees of Columbia University in the City of New York. +# (c) 2026 diffpy.srreal contributors. # All rights reserved. # -# File coded by: Billinge Group members and community contributors. +# File coded by: Simon Billinge, Billinge Group members. # # See GitHub contributions for a more detailed list of contributors. # https://github.com/diffpy/diffpy.srreal/graphs/contributors @@ -12,10 +13,11 @@ # See LICENSE.rst for license information. # ############################################################################## -"""Tools for real space structure analysis.""" +"""Calculators for PDF, bond valence sum, and other quantities based on +atom pair interaction.""" # package version -from diffpy.srreal.version import __version__ +from diffpy.srreal.version import __version__ # noqa # silence the pyflakes syntax checker assert __version__ or True diff --git a/src/diffpy/srreal/version.py b/src/diffpy/srreal/version.py index a988772a..fe352ef9 100644 --- a/src/diffpy/srreal/version.py +++ b/src/diffpy/srreal/version.py @@ -2,12 +2,13 @@ ############################################################################## # # (c) 2025 The Trustees of Columbia University in the City of New York. +# (c) 2026 diffpy.srreal contributors. # All rights reserved. # -# File coded by: Billinge Group members and community contributors. +# File coded by: Simon Billinge, Billinge Group members. # # See GitHub contributions for a more detailed list of contributors. -# https://github.com/diffpy/diffpy.srreal/graphs/contributors +# https://github.com/diffpy/diffpy.srreal/graphs/contributors # noqa: E501 # # See LICENSE.rst for license information. # @@ -20,12 +21,7 @@ # obtain version information from importlib.metadata import PackageNotFoundError, version -FALLBACK_VERSION = "1.3.0" - try: __version__ = version("diffpy.srreal") except PackageNotFoundError: - __version__ = FALLBACK_VERSION - - -# End of file + __version__ = "unknown" diff --git a/tests/test_version.py b/tests/test_version.py index d50b30db..92fee874 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,6 +1,6 @@ """Unit tests for __version__.py.""" -import diffpy.srreal +import diffpy.srreal # noqa def test_package_version(): From 5ec288dbb4de9c3afd153551755ea80a40a41bce Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 11 Oct 2026 23:45:43 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit hooks --- setup.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/setup.py b/setup.py index c96f22e1..2c4dce9f 100644 --- a/setup.py +++ b/setup.py @@ -2,36 +2,36 @@ # Extensions script for diffpy.srreal +import glob import os import re import sys -import glob -from setuptools import setup -from setuptools import Extension + +from setuptools import Extension, setup # Define extension arguments here ext_kws = { - 'libraries' : [], - 'extra_compile_args' : [], - 'extra_link_args' : [], - 'include_dirs' : [], + "libraries": [], + "extra_compile_args": [], + "extra_link_args": [], + "include_dirs": [], } + def create_extensions(): "Initialize Extension objects for the setup function." - ext = Extension('diffpy.srreal.srreal', - glob.glob('src/extensions/*.cpp'), - **ext_kws) + ext = Extension( + "diffpy.srreal.srreal", glob.glob("src/extensions/*.cpp"), **ext_kws + ) return [ext] # Extensions not included in pyproject.toml setup_args = dict( - ext_modules = [], + ext_modules=[], ) -if __name__ == '__main__': - setup_args['ext_modules'] = create_extensions() +if __name__ == "__main__": + setup_args["ext_modules"] = create_extensions() setup(**setup_args) - From 204aa5613866bc74559f5317f34adfa02dc7b5d8 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Sun, 11 Oct 2026 20:01:11 -0400 Subject: [PATCH 3/4] chore: fix pre-commit --- pyproject.toml | 1 + setup.py | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9541ca0a..b69f1645 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ requires = [ "scikit-build-core>=0.10", "setuptools-scm>=8", "nanobind>=3.1,<4", + "setuptools>=62.0", ] build-backend = "scikit_build_core.build" diff --git a/setup.py b/setup.py index 2c4dce9f..535011bc 100644 --- a/setup.py +++ b/setup.py @@ -3,9 +3,6 @@ # Extensions script for diffpy.srreal import glob -import os -import re -import sys from setuptools import Extension, setup From e28bcc1ff0a648e5299392cc7f19787bcbbd6853 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Sun, 11 Oct 2026 20:04:27 -0400 Subject: [PATCH 4/4] chore: delete unnecessary setup.py and fix workflow and precommit config --- .github/workflows/matrix-and-codecov.yml | 6 +++++ .pre-commit-config.yaml | 2 +- pyproject.toml | 1 - setup.py | 34 ------------------------ 4 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 setup.py diff --git a/.github/workflows/matrix-and-codecov.yml b/.github/workflows/matrix-and-codecov.yml index 45171c63..91367907 100644 --- a/.github/workflows/matrix-and-codecov.yml +++ b/.github/workflows/matrix-and-codecov.yml @@ -17,5 +17,11 @@ jobs: project: diffpy.srreal c_extension: true headless: false + run: | + set -e + if [[ $(uname -s) == Linux ]]; then + python -m pip install git+https://github.com/diffpy/pyobjcryst.git@nanobind_migration_test + python -c 'import pyobjcryst._pyobjcryst' + fi secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7554beef..ec7ea40f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ default_language_version: - python: python3.14 + python: python3 ci: autofix_commit_msg: | [pre-commit.ci] auto fixes from pre-commit hooks diff --git a/pyproject.toml b/pyproject.toml index b69f1645..9541ca0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,6 @@ requires = [ "scikit-build-core>=0.10", "setuptools-scm>=8", "nanobind>=3.1,<4", - "setuptools>=62.0", ] build-backend = "scikit_build_core.build" diff --git a/setup.py b/setup.py deleted file mode 100644 index 535011bc..00000000 --- a/setup.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python - -# Extensions script for diffpy.srreal - -import glob - -from setuptools import Extension, setup - -# Define extension arguments here -ext_kws = { - "libraries": [], - "extra_compile_args": [], - "extra_link_args": [], - "include_dirs": [], -} - - -def create_extensions(): - "Initialize Extension objects for the setup function." - ext = Extension( - "diffpy.srreal.srreal", glob.glob("src/extensions/*.cpp"), **ext_kws - ) - return [ext] - - -# Extensions not included in pyproject.toml -setup_args = dict( - ext_modules=[], -) - - -if __name__ == "__main__": - setup_args["ext_modules"] = create_extensions() - setup(**setup_args)