From 2f90f7390e6aeef0936911bc786ccd82bcf55323 Mon Sep 17 00:00:00 2001 From: Chin-Yun Yu Date: Sat, 21 Jun 2025 10:15:01 +0100 Subject: [PATCH 1/5] feat: add pyproject.toml for build system configuration --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..cfc2eb2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools", + "torch", +] +build-backend = "setuptools.build_meta" \ No newline at end of file From 1b7c47849cda20407a66fe570abda1a6bddb3e25 Mon Sep 17 00:00:00 2001 From: Chin-Yun Yu Date: Sat, 21 Jun 2025 10:15:10 +0100 Subject: [PATCH 2/5] bump version to 0.7.2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f8f3864..12d922b 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ ) library_name = "torchlpc" -VERSION = "0.7.1" +VERSION = "0.7.2" MAINTAINER = "Chin-Yun Yu" EMAIL = "chin-yun.yu@qmul.ac.uk" From e508c771f651f30a38196fa5f9a06abf3b5e945f Mon Sep 17 00:00:00 2001 From: Chin-Yun Yu Date: Sat, 21 Jun 2025 10:41:18 +0100 Subject: [PATCH 3/5] deprecate setup.py command --- .github/workflows/python-package.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6a609c7..9e604c3 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -52,13 +52,11 @@ jobs: export CXX=$(brew --prefix llvm@15)/bin/clang++ export LDFLAGS="-L/usr/local/opt/libomp/lib" export CPPFLAGS="-I/usr/local/opt/libomp/include" - python setup.py build - find build/ -name "_C*.so" -exec cp {} ./torchlpc/ \; + python -m pip install -e . - name: Build CPP extension with g++ if: matrix.os == 'ubuntu-latest' run: | - python setup.py build - find build/ -name "_C*.so" -exec cp {} ./torchlpc/ \; + python -m pip install -e . - name: Test with pytest run: | pytest From 7bc48df671cb3deb70c122104e039eb5ffcb5276 Mon Sep 17 00:00:00 2001 From: Chin-Yun Yu Date: Sat, 21 Jun 2025 10:48:03 +0100 Subject: [PATCH 4/5] fix: use build to build source-only distribution --- .github/workflows/python-publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9c4d368..aa1d56b 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -33,10 +33,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools numpy - pip install torch --index-url https://download.pytorch.org/whl/cpu + pip install setuptools build - name: Build package - run: python setup.py sdist + run: python -m build --sdist - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: From b6ccda300367fc4f838417b27dac777c865e865e Mon Sep 17 00:00:00 2001 From: Chin-Yun Yu Date: Sat, 21 Jun 2025 10:48:24 +0100 Subject: [PATCH 5/5] fix: add numpy to build requirements --- pyproject.toml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cfc2eb2..264626a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,3 @@ [build-system] -requires = [ - "setuptools", - "torch", -] -build-backend = "setuptools.build_meta" \ No newline at end of file +requires = ["setuptools", "torch", "numpy"] +build-backend = "setuptools.build_meta"