From 2ee65ca6ba042404ff2153887207faf6c6763d67 Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 16:29:54 +0000 Subject: [PATCH 01/12] add test_upload_pypi action --- .github/workflows/build.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ba10b7..d0e7004 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,17 +162,12 @@ jobs: name: cibw-sdist path: dist/*.tar.gz - upload_pypi: + test_upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest environment: pypi permissions: id-token: write - # We can also upload always, with skip-existing: true, below - # We upload on every push event (only master, above) that is a new tag - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - # Only run this step on GH release - # if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v4 with: @@ -185,5 +180,21 @@ jobs: with: skip-existing: true # To test: - # with: - # repository-url: https://test.pypi.org/legacy/ + with: + repository-url: https://test.pypi.org/legacy/ + + upload_pypi: + needs: [test_upload_pypi] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + # We can also upload always, with skip-existing: true, below + # We upload on every push event (only master, above) that is a new tag + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + # Only run this step on GH release + # if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true From a69d978b04dd2628842f467c35926909e81bf3af Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 16:31:23 +0000 Subject: [PATCH 02/12] remove extra with statement --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0e7004..95b32f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,8 +177,6 @@ jobs: merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 - with: - skip-existing: true # To test: with: repository-url: https://test.pypi.org/legacy/ From 7ce065db87a77aa05e8c1ede1d8e8ae7de165620 Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 16:38:51 +0000 Subject: [PATCH 03/12] disable failing sdist --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95b32f5..cfcc79c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -147,6 +147,7 @@ jobs: path: ./wheelhouse/*.whl build_sdist: + if: False name: Build source distribution runs-on: ubuntu-latest steps: From 8c36ad1bb6bea785bda5eee688b12a5748d06f4d Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 16:46:44 +0000 Subject: [PATCH 04/12] rm dep on sdist action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfcc79c..87154e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -164,7 +164,7 @@ jobs: path: dist/*.tar.gz test_upload_pypi: - needs: [build_wheels, build_sdist] + needs: [build_wheels] runs-on: ubuntu-latest environment: pypi permissions: From ccfbbf76ac6da747e091dd0495b11c279b92bf80 Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 16:55:27 +0000 Subject: [PATCH 05/12] Revert "rm dep on sdist action" This reverts commit 8c36ad1bb6bea785bda5eee688b12a5748d06f4d. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87154e3..cfcc79c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -164,7 +164,7 @@ jobs: path: dist/*.tar.gz test_upload_pypi: - needs: [build_wheels] + needs: [build_wheels, build_sdist] runs-on: ubuntu-latest environment: pypi permissions: From d6f8386bccc1898a00e17a0b143212758b8899ec Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 16:55:43 +0000 Subject: [PATCH 06/12] Revert "disable failing sdist" This reverts commit 7ce065db87a77aa05e8c1ede1d8e8ae7de165620. --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfcc79c..95b32f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -147,7 +147,6 @@ jobs: path: ./wheelhouse/*.whl build_sdist: - if: False name: Build source distribution runs-on: ubuntu-latest steps: From f590e7181bd273f4cd692e7a0c635cc6348de179 Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 17:18:00 +0000 Subject: [PATCH 07/12] add sdist_mode option --- .github/workflows/build.yml | 2 +- meson.build | 7 ++++--- meson.options | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95b32f5..742e6d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -155,7 +155,7 @@ jobs: submodules: true - name: Build sdist - run: pipx run build --sdist + run: pipx run build --sdist -Dsdist_mode=true - uses: actions/upload-artifact@v4 with: diff --git a/meson.build b/meson.build index 2fa6d2a..21e5722 100644 --- a/meson.build +++ b/meson.build @@ -43,9 +43,10 @@ else endif endif -# Since nothing above was required, we stop here if failed -if not blas_deps[0].found() - error('OpenBLAS or Netlib BLAS/CBLAS is required on all platforms except Windows, and was not found.') +# Since nothing above was required, we stop here if failed. +# When creating an sdist we are not compiling / linking, so don't need to fail. +if not blas_deps[0].found() and not get_option('sdist_mode'): + error('OpenBLAS or Netlib BLAS/CBLAS is required on all platforms, and was not found.') endif fs = import('fs') diff --git a/meson.options b/meson.options index ba840d4..79b5678 100644 --- a/meson.options +++ b/meson.options @@ -5,3 +5,5 @@ option('link_blas_statically', type: 'boolean', value: false, description: 'copy BLAS compiled object into SCS module(s)') option('link_mkl', type: 'boolean', value: false, description: 'link to mkl-rt library') +option('sdist_mode', type: 'boolean', value: false, + description: 'Set to true if building an sdist') From 4bde9cd9377a11d1ea0461a6d13f8ae557e30695 Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 17:24:30 +0000 Subject: [PATCH 08/12] rm colon --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 21e5722..d428a16 100644 --- a/meson.build +++ b/meson.build @@ -45,7 +45,7 @@ endif # Since nothing above was required, we stop here if failed. # When creating an sdist we are not compiling / linking, so don't need to fail. -if not blas_deps[0].found() and not get_option('sdist_mode'): +if not blas_deps[0].found() and not get_option('sdist_mode') error('OpenBLAS or Netlib BLAS/CBLAS is required on all platforms, and was not found.') endif From fba78247c9f07475871338bbf6c8f2e4ba79c5b6 Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 17:27:50 +0000 Subject: [PATCH 09/12] fix sdist flag --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 742e6d7..93327b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -155,7 +155,7 @@ jobs: submodules: true - name: Build sdist - run: pipx run build --sdist -Dsdist_mode=true + run: MESON_ARGS="-Dsdist_mode=true" pipx run build --sdist - uses: actions/upload-artifact@v4 with: From 0efe5a2a4e8aaa89f8a772673fc6932f06d97bf5 Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 17:34:34 +0000 Subject: [PATCH 10/12] actually pass flag --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93327b3..16deb3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -155,7 +155,7 @@ jobs: submodules: true - name: Build sdist - run: MESON_ARGS="-Dsdist_mode=true" pipx run build --sdist + run: pipx run build --sdist --config-setting=env.MESON_ARGS=-Dsdist_mode=true - uses: actions/upload-artifact@v4 with: From c6e44acfa9da82b682e2c28df31661c3b336106f Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 17:37:34 +0000 Subject: [PATCH 11/12] actually pass flag --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16deb3e..bd5059d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -155,7 +155,7 @@ jobs: submodules: true - name: Build sdist - run: pipx run build --sdist --config-setting=env.MESON_ARGS=-Dsdist_mode=true + run: pipx run build --sdist -Csetup-args=-Dsdist_mode=true - uses: actions/upload-artifact@v4 with: From 9a83f29bb32e746a611547f2fa1663711fb564ed Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 19:47:26 +0000 Subject: [PATCH 12/12] tweaking test since scs name taken on test.pypi.org --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd5059d..d6a2f41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,9 @@ jobs: test_upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest - environment: pypi + environment: + name: testpypi + url: https://test.pypi.org/p/test_scs permissions: id-token: write steps: