From d0c5ca412fbd7f4898231b713cd2c6c6ba762455 Mon Sep 17 00:00:00 2001 From: chrisjbillington Date: Thu, 5 Feb 2026 17:47:13 +1100 Subject: [PATCH] Move cython extension info into pyproject.toml, delete setup.py setuptools 74.1 adds support for cython extension metadata in pyproject.toml. This obviates the need to special-case installing cython in the workflow --- .github/workflows/release.yml | 2 +- pyproject.toml | 5 ++++- setup.py | 19 ------------------- 3 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 setup.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a83ff6b..720d509 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: - name: Configure workflow id: config run: | - pip install ci-helper cython + pip install ci-helper # Load repo-specific variables and overrides: VARS_FILE=".github/workflows/release-vars.sh" diff --git a/pyproject.toml b/pyproject.toml index 1a8e571..2c443bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=64", "setuptools_scm>=8", "cython", +requires = ["setuptools>=74.1.0", "setuptools_scm>=8", "cython", "numpy>=2.0,<3; python_version>'3.8'"] build-backend = "setuptools.build_meta" @@ -10,6 +10,9 @@ local_scheme = "no-local-version" [tool.setuptools] zip-safe = false include-package-data = true +ext-modules = [ + {name = "labscript_c_extensions.runviewer.resample", sources = ["src/runviewer/resample.pyx"]} +] [tool.setuptools.packages] find = {namespaces = false} diff --git a/setup.py b/setup.py deleted file mode 100644 index e0f6c99..0000000 --- a/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -import os -from setuptools import setup -from setuptools.extension import Extension -from Cython.Distutils import build_ext - - -CMDCLASS = {"build_ext": build_ext} - -EXT_MODULES = [ - Extension( - "labscript_c_extensions.runviewer.resample", - sources=[os.path.join("src", "runviewer", "resample.pyx")], - ) -] - -setup( - cmdclass=CMDCLASS, - ext_modules=EXT_MODULES, -)