From 71fc87257f8c08d398221c78273813a68bc7cff9 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Tue, 30 Jul 2024 15:32:44 -0500 Subject: [PATCH 01/17] testing automated pypi release --- .github/workflows/release.yml | 86 +++++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 +- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c5aa2acd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,86 @@ +name: Publish Python Package + +on: + workflow_dispatch: + push: + # release: + # types: + # - published + +jobs: + build_sdist: + name: Build SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Build SDist + run: pipx run build --sdist + + - name: Check metadata + run: pipx run twine check dist/* + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + build_wheels: + name: Wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-13] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - uses: pypa/cibuildwheel@v2.17 + env: + CIBW_ARCHS_MACOS: auto universal2 + CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* # Skip older Python versions + CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* # Explicitly build for specified versions + + - name: Verify clean directory + run: git diff --exit-code + shell: bash + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }} + path: wheelhouse/*.whl + + upload_all: + name: Upload release + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/ + permissions: + id-token: write + + steps: + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - uses: actions/download-artifact@v4 + with: + pattern: cibw-* + path: dist + merge-multiple: true + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 175f4b8b..4f3831d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.21) # must be on the same line so that pyproject.toml can correctly identify the version -project(musica-distribution VERSION 0.7.0) +project(musica-distribution VERSION 0.7.1) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake) set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_MODULE_PATH}/SetDefaults.cmake) From 781477e92c28f2e57aad46ede0314801b028568f Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 09:28:49 -0500 Subject: [PATCH 02/17] trying to appropriately name the wheels --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5aa2acd..d0a7b184 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: path: dist/*.tar.gz build_wheels: - name: Wheels on ${{ matrix.os }} + name: Build wheels on ${{ matrix.os }} with Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -48,8 +48,8 @@ jobs: - uses: pypa/cibuildwheel@v2.17 env: CIBW_ARCHS_MACOS: auto universal2 - CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* # Skip older Python versions - CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* # Explicitly build for specified versions + CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* + CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* - name: Verify clean directory run: git diff --exit-code @@ -58,7 +58,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.os }} + name: cibw-wheels-${{ matrix.os }}-py${{ matrix.python-version }} path: wheelhouse/*.whl upload_all: From c20c872ee7210b17c0f58c9838e62c13a26bc956 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 09:50:11 -0500 Subject: [PATCH 03/17] only need one version of python to build wheels for all other versions --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0a7b184..4df806ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,8 +33,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-13] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.12"] steps: - uses: actions/checkout@v4 From 77f7ccc6398e97a6a47f2435cd414bc367241af4 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 10:00:27 -0500 Subject: [PATCH 04/17] trying to get macos to build successfully --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4df806ff..07d97cc0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,6 +48,7 @@ jobs: - uses: pypa/cibuildwheel@v2.17 env: CIBW_ARCHS_MACOS: auto universal2 + CIBW_ENVIRONMENT: CXXFLAGS="-mmacosx-version-min=10.15" CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* From 350ce54212aa5eb0a6fcaaf2f3066c00b3b3c2c1 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 10:11:49 -0500 Subject: [PATCH 05/17] excluding universal2 arch build for macos --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07d97cc0..0e2df16a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,8 +47,7 @@ jobs: - uses: pypa/cibuildwheel@v2.17 env: - CIBW_ARCHS_MACOS: auto universal2 - CIBW_ENVIRONMENT: CXXFLAGS="-mmacosx-version-min=10.15" + CIBW_ARCHS_MACOS: arm64 x86_64 CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* From d5c07e794d8af7bd477980b7ae52e7e6bd779db5 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 10:19:17 -0500 Subject: [PATCH 06/17] seeing if arm64 works --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e2df16a..56e56ac0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: - uses: pypa/cibuildwheel@v2.17 env: - CIBW_ARCHS_MACOS: arm64 x86_64 + CIBW_ARCHS_MACOS: arm64 CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* From 5d8328388a706b78910aadd94eb79ecbd24b4d75 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 10:35:50 -0500 Subject: [PATCH 07/17] trying to skip musllinux --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56e56ac0..44f5257c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,7 @@ jobs: - uses: pypa/cibuildwheel@v2.17 env: CIBW_ARCHS_MACOS: arm64 - CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* + CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* musllinux* CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* - name: Verify clean directory From 63d4d2c7c9d62918ddee2cc099cf35f184651295 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 10:51:24 -0500 Subject: [PATCH 08/17] trying to choose linux architecture support --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44f5257c..86aa5039 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,8 @@ jobs: - uses: pypa/cibuildwheel@v2.17 env: CIBW_ARCHS_MACOS: arm64 - CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* musllinux* + CIBW_ARCHS_LINUX: aarch64 x86_64 manylinux i686 ppc64le + CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* - name: Verify clean directory From d9c4ae70109232ae2601cebc585899b38faa0bd0 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 10:58:09 -0500 Subject: [PATCH 09/17] trying to skip musllinux again --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86aa5039..0632a465 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,8 +48,7 @@ jobs: - uses: pypa/cibuildwheel@v2.17 env: CIBW_ARCHS_MACOS: arm64 - CIBW_ARCHS_LINUX: aarch64 x86_64 manylinux i686 ppc64le - CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* + CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* *musllinux* CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* - name: Verify clean directory From 11f937f2926f2f684f76c18f5d7ba5dd402ed46f Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 11:23:49 -0500 Subject: [PATCH 10/17] adding intel based mac build --- .github/workflows/release.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0632a465..31e91de3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: - uses: pypa/cibuildwheel@v2.17 env: - CIBW_ARCHS_MACOS: arm64 + CIBW_ARCHS_MACOS: arm64 x86_64 CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* *musllinux* CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f3831d0..7eb90fe4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.21) # must be on the same line so that pyproject.toml can correctly identify the version -project(musica-distribution VERSION 0.7.1) +project(musica-distribution VERSION 0.7.2) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake) set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_MODULE_PATH}/SetDefaults.cmake) From 5db481c3c78456b4ec285713de6abbc75d8a90ee Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 12:18:38 -0500 Subject: [PATCH 11/17] trying to set the osx deployment target --- python/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 43c056ad..8498c73c 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,3 +1,5 @@ +SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.15) + pybind11_add_module(musica_python wrapper.cpp ${PROJECT_SOURCE_DIR}/src/micm/micm.cpp From 5d2450dcb54ada52c3cbe7bfd71383701a6564c1 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 12:31:28 -0500 Subject: [PATCH 12/17] trying a different way --- python/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 8498c73c..efc85898 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,5 +1,3 @@ -SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.15) - pybind11_add_module(musica_python wrapper.cpp ${PROJECT_SOURCE_DIR}/src/micm/micm.cpp @@ -12,6 +10,8 @@ target_link_libraries(musica_python PRIVATE nlohmann_json::nlohmann_json) target_compile_features(musica_python PUBLIC cxx_std_20) +target_compile_options(musica_python PRIVATE -mmacosx-version-min=10.15) + set_target_properties(musica_python PROPERTIES OUTPUT_NAME musica) target_include_directories(musica_python From 883e8e0693532b15497f1ac560f1cab2bbae4d25 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 12:34:05 -0500 Subject: [PATCH 13/17] that wasn't it --- python/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index efc85898..43c056ad 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -10,8 +10,6 @@ target_link_libraries(musica_python PRIVATE nlohmann_json::nlohmann_json) target_compile_features(musica_python PUBLIC cxx_std_20) -target_compile_options(musica_python PRIVATE -mmacosx-version-min=10.15) - set_target_properties(musica_python PROPERTIES OUTPUT_NAME musica) target_include_directories(musica_python From d7587746d6b1a7bafff87d0e1be5b1fcf32e2685 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 12:47:42 -0500 Subject: [PATCH 14/17] trying to force a minimum of 10.15 for macos? --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d1fe56ba..0feccafd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,4 +47,7 @@ regex = 'musica-distribution VERSION\s+(?P[0-9.]+)' path = "musica/_version.py" template = ''' version = "${version}" -''' \ No newline at end of file +''' + +[tool.cibuildwheel.macos.environment] +MACOSX_DEPLOYMENT_TARGET = "10.15" From 63410143da26a7b62ec87840ac6eb6fad2dd0e08 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 13:35:18 -0500 Subject: [PATCH 15/17] setting action trigger --- .github/workflows/release.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 31e91de3..13e944b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,10 +2,9 @@ name: Publish Python Package on: workflow_dispatch: - push: - # release: - # types: - # - published + release: + types: + - published jobs: build_sdist: From 5dde554b6557d646f81dd77a8a6ac255721afd6e Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 13:36:27 -0500 Subject: [PATCH 16/17] undoing version change --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7eb90fe4..175f4b8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.21) # must be on the same line so that pyproject.toml can correctly identify the version -project(musica-distribution VERSION 0.7.2) +project(musica-distribution VERSION 0.7.0) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake) set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_MODULE_PATH}/SetDefaults.cmake) From 2860eb5913ad6ed23624a63e549334267f2351ff Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 5 Aug 2024 14:52:11 -0500 Subject: [PATCH 17/17] correcting project name --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13e944b7..d3857ea1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,7 @@ jobs: runs-on: ubuntu-latest environment: name: pypi - url: https://pypi.org/p/ + url: https://pypi.org/p/musica permissions: id-token: write