From 51773c7f5f9c82d570e4430607e15919993eecbe Mon Sep 17 00:00:00 2001 From: dofuuz <8174871+dofuuz@users.noreply.github.com> Date: Wed, 16 Aug 2023 01:03:49 +0900 Subject: [PATCH 1/8] Fix build --- .github/workflows/build-dist.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-dist.yml b/.github/workflows/build-dist.yml index b658be5..17392dd 100644 --- a/.github/workflows/build-dist.yml +++ b/.github/workflows/build-dist.yml @@ -29,6 +29,7 @@ jobs: # Skip builds(save time / avoid build error) CIBW_SKIP: "cp36-* pp* *-musllinux_* *_i686 *-win32" CIBW_ARCHS_MACOS: x86_64 arm64 + CIBW_BUILD_FRONTEND: "build" - uses: actions/upload-artifact@v3 with: @@ -59,6 +60,7 @@ jobs: CIBW_ARCHS_LINUX: aarch64 CIBW_BUILD: cp*-manylinux_aarch64 CIBW_SKIP: "cp36-*" + CIBW_BUILD_FRONTEND: "build" - uses: actions/upload-artifact@v3 with: @@ -78,7 +80,7 @@ jobs: submodules: true - name: Build sdist - run: pipx run build --sdist + run: python -m build --sdist - uses: actions/upload-artifact@v3 with: From 46a840d6a05ff9af2850b5726ebe0ba0406cefbd Mon Sep 17 00:00:00 2001 From: dofuuz <8174871+dofuuz@users.noreply.github.com> Date: Wed, 16 Aug 2023 01:09:43 +0900 Subject: [PATCH 2/8] Fix build (2) --- .github/workflows/build-dist.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-dist.yml b/.github/workflows/build-dist.yml index 17392dd..764e1b7 100644 --- a/.github/workflows/build-dist.yml +++ b/.github/workflows/build-dist.yml @@ -80,7 +80,9 @@ jobs: submodules: true - name: Build sdist - run: python -m build --sdist + run: | + python -m pip install build + python -m build --sdist - uses: actions/upload-artifact@v3 with: From b243246344d3184a57954f1a43f0220516fc3bcc Mon Sep 17 00:00:00 2001 From: mckeum Date: Wed, 16 Aug 2023 11:17:23 +0900 Subject: [PATCH 3/8] Fix libsoxr_version (2) --- .github/workflows/build-dist.yml | 63 +++++++++++++++++--------------- setup.py | 26 +++++++++---- 2 files changed, 52 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build-dist.yml b/.github/workflows/build-dist.yml index 764e1b7..f3a7df1 100644 --- a/.github/workflows/build-dist.yml +++ b/.github/workflows/build-dist.yml @@ -21,6 +21,7 @@ jobs: steps: - uses: actions/checkout@v3 with: + fetch-depth: 0 submodules: true - name: Build wheels @@ -40,36 +41,37 @@ jobs: with: files: ./wheelhouse/*.whl - build_archs: - name: Build wheels manylinux_aarch64 - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - with: - platforms: all - - - name: Build wheels - uses: pypa/cibuildwheel@v2.14.1 - env: - CIBW_ARCHS_LINUX: aarch64 - CIBW_BUILD: cp*-manylinux_aarch64 - CIBW_SKIP: "cp36-*" - CIBW_BUILD_FRONTEND: "build" - - - uses: actions/upload-artifact@v3 - with: - path: ./wheelhouse/*.whl - - - uses: softprops/action-gh-release@v1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - with: - files: ./wheelhouse/*.whl + # build_archs: + # name: Build wheels manylinux_aarch64 + # runs-on: ubuntu-20.04 + + # steps: + # - uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # submodules: true + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v2 + # with: + # platforms: all + + # - name: Build wheels + # uses: pypa/cibuildwheel@v2.14.1 + # env: + # CIBW_ARCHS_LINUX: aarch64 + # CIBW_BUILD: cp*-manylinux_aarch64 + # CIBW_SKIP: "cp36-*" + # CIBW_BUILD_FRONTEND: "build" + + # - uses: actions/upload-artifact@v3 + # with: + # path: ./wheelhouse/*.whl + + # - uses: softprops/action-gh-release@v1 + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + # with: + # files: ./wheelhouse/*.whl build_sdist: name: Build source distribution @@ -77,6 +79,7 @@ jobs: steps: - uses: actions/checkout@v3 with: + fetch-depth: 0 submodules: true - name: Build sdist diff --git a/setup.py b/setup.py index c5a67c0..31c5d3f 100644 --- a/setup.py +++ b/setup.py @@ -13,11 +13,12 @@ from distutils.ccompiler import get_default_compiler from setuptools import setup, Extension from setuptools.command.sdist import sdist +from wheel.bdist_wheel import bdist_wheel SYS_LIBSOXR = False -# python -m build -C=--build-option=--use-system-libsoxr +# python -m build -C--build-option=--use-system-libsoxr if '--use-system-libsoxr' in sys.argv: sys.argv.remove('--use-system-libsoxr') SYS_LIBSOXR = True @@ -38,6 +39,7 @@ def include_dirs(self, dirs): self._include = dirs +# Submodule versioning def get_git_version(cwd=''): try: result = subprocess.run( @@ -47,8 +49,8 @@ def get_git_version(cwd=''): ver = result.stdout.strip() return ver except Exception as e: - logging.warning(f'Error retrieving submodule version: {e}') - return 'unknown' + logging.warning(f'Can not get {cwd} version: {e}') + return None CSOXR_VERSION_C = ''' @@ -57,13 +59,23 @@ def get_git_version(cwd=''): ''' -class SDistBundledCommand(sdist): - def run(self): - ver = get_git_version('libsoxr') +def write_csoxr_version(): + ver = get_git_version('libsoxr') + if ver: with open(f'src/soxr/_csoxr_version.c', 'wt') as f: f.write(CSOXR_VERSION_C % (ver)) logging.info(f'libsoxr version: {ver}') + +class CustomSDistCmd(sdist): + def run(self): + write_csoxr_version() + super().run() + + +class CustomWheelCmd(bdist_wheel): + def run(self): + write_csoxr_version() super().run() @@ -142,6 +154,6 @@ def run(self): else: logging.info('Building Python-SoXR using bundled libsoxr...') setup( - cmdclass={'sdist': SDistBundledCommand}, + cmdclass={'sdist': CustomSDistCmd, 'bdist_wheel': CustomWheelCmd}, ext_modules=cythonize(extensions, language_level='3'), ) From 7e1309b8b67b854aeab9fcefa8ac2f12a40a89d2 Mon Sep 17 00:00:00 2001 From: mckeum Date: Wed, 16 Aug 2023 11:21:18 +0900 Subject: [PATCH 4/8] Try (3) --- .github/workflows/build-dist.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-dist.yml b/.github/workflows/build-dist.yml index f3a7df1..89ed0fe 100644 --- a/.github/workflows/build-dist.yml +++ b/.github/workflows/build-dist.yml @@ -97,7 +97,8 @@ jobs: files: dist/*.tar.gz upload_pypi: - needs: [build_wheels, build_archs, build_sdist] + # needs: [build_wheels, build_archs, build_sdist] + needs: [build_wheels, build_sdist] runs-on: ubuntu-latest # upload to PyPI on every tag starting with 'v' if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') From f79e5aa388005e516d907d516c3674a591a27b3f Mon Sep 17 00:00:00 2001 From: Myungchul Keum <8174871+dofuuz@users.noreply.github.com> Date: Mon, 28 Aug 2023 10:10:54 +0900 Subject: [PATCH 5/8] Revert --- .github/workflows/build-dist.yml | 65 ++++++++++++++++---------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-dist.yml b/.github/workflows/build-dist.yml index 89ed0fe..90f4fa9 100644 --- a/.github/workflows/build-dist.yml +++ b/.github/workflows/build-dist.yml @@ -41,37 +41,37 @@ jobs: with: files: ./wheelhouse/*.whl - # build_archs: - # name: Build wheels manylinux_aarch64 - # runs-on: ubuntu-20.04 - - # steps: - # - uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # submodules: true - - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v2 - # with: - # platforms: all - - # - name: Build wheels - # uses: pypa/cibuildwheel@v2.14.1 - # env: - # CIBW_ARCHS_LINUX: aarch64 - # CIBW_BUILD: cp*-manylinux_aarch64 - # CIBW_SKIP: "cp36-*" - # CIBW_BUILD_FRONTEND: "build" - - # - uses: actions/upload-artifact@v3 - # with: - # path: ./wheelhouse/*.whl - - # - uses: softprops/action-gh-release@v1 - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - # with: - # files: ./wheelhouse/*.whl + build_archs: + name: Build wheels manylinux_aarch64 + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: true + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: all + + - name: Build wheels + uses: pypa/cibuildwheel@v2.14.1 + env: + CIBW_ARCHS_LINUX: aarch64 + CIBW_BUILD: cp*-manylinux_aarch64 + CIBW_SKIP: "cp36-*" + CIBW_BUILD_FRONTEND: "build" + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + - uses: softprops/action-gh-release@v1 + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + with: + files: ./wheelhouse/*.whl build_sdist: name: Build source distribution @@ -97,8 +97,7 @@ jobs: files: dist/*.tar.gz upload_pypi: - # needs: [build_wheels, build_archs, build_sdist] - needs: [build_wheels, build_sdist] + needs: [build_wheels, build_archs, build_sdist] runs-on: ubuntu-latest # upload to PyPI on every tag starting with 'v' if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') From acb72d8350c38069de13a5df623032249417a86d Mon Sep 17 00:00:00 2001 From: dofuuz <8174871+dofuuz@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:22:01 +0900 Subject: [PATCH 6/8] Test Python 3.12 --- .github/workflows/build-dist.yml | 4 ++-- .github/workflows/run-test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-dist.yml b/.github/workflows/build-dist.yml index 90f4fa9..7cde42f 100644 --- a/.github/workflows/build-dist.yml +++ b/.github/workflows/build-dist.yml @@ -25,7 +25,7 @@ jobs: submodules: true - name: Build wheels - uses: pypa/cibuildwheel@v2.14.1 + uses: pypa/cibuildwheel@v2.16.0 env: # Skip builds(save time / avoid build error) CIBW_SKIP: "cp36-* pp* *-musllinux_* *_i686 *-win32" @@ -57,7 +57,7 @@ jobs: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v2.14.1 + uses: pypa/cibuildwheel@v2.16.0 env: CIBW_ARCHS_LINUX: aarch64 CIBW_BUILD: cp*-manylinux_aarch64 diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index b497d35..d89996c 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -9,7 +9,7 @@ jobs: build: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "pypy3.9"] + python-version: ["3.9", "3.10", "3.11", "3.12", "pypy3.9"] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} From f42b9f903e899ea6cd6828817938c4f846ee3474 Mon Sep 17 00:00:00 2001 From: dofuuz <8174871+dofuuz@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:32:01 +0900 Subject: [PATCH 7/8] Test Python 3.12 (2) --- .github/workflows/run-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index d89996c..5c725f7 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -9,7 +9,7 @@ jobs: build: strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "pypy3.9"] + python-version: ["3.9", "3.10", "3.11", "3.12-dev", "pypy3.9"] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} From 4b774301abe71efbc2314a46412d0a7e18e2e174 Mon Sep 17 00:00:00 2001 From: dofuuz <8174871+dofuuz@users.noreply.github.com> Date: Wed, 4 Oct 2023 21:50:55 +0900 Subject: [PATCH 8/8] Bump Python to 3.12.0 release --- .github/workflows/build-dist.yml | 4 ++-- .github/workflows/run-test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-dist.yml b/.github/workflows/build-dist.yml index 7cde42f..b015301 100644 --- a/.github/workflows/build-dist.yml +++ b/.github/workflows/build-dist.yml @@ -25,7 +25,7 @@ jobs: submodules: true - name: Build wheels - uses: pypa/cibuildwheel@v2.16.0 + uses: pypa/cibuildwheel@v2.16.2 env: # Skip builds(save time / avoid build error) CIBW_SKIP: "cp36-* pp* *-musllinux_* *_i686 *-win32" @@ -57,7 +57,7 @@ jobs: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v2.16.0 + uses: pypa/cibuildwheel@v2.16.2 env: CIBW_ARCHS_LINUX: aarch64 CIBW_BUILD: cp*-manylinux_aarch64 diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 5c725f7..d89996c 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -9,7 +9,7 @@ jobs: build: strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12-dev", "pypy3.9"] + python-version: ["3.9", "3.10", "3.11", "3.12", "pypy3.9"] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }}