From a3161f0e82a6aa9af48c55a50223435283dd7089 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Wed, 2 Apr 2025 20:36:30 +0000 Subject: [PATCH 1/3] [#221] New publishing github actions --- ...n-publish.yml => python-publish-sdist.yml} | 9 ++--- .github/workflows/python-publish-wheel.yml | 39 +++++++++++++++++++ 2 files changed, 43 insertions(+), 5 deletions(-) rename .github/workflows/{python-publish.yml => python-publish-sdist.yml} (78%) create mode 100644 .github/workflows/python-publish-wheel.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish-sdist.yml similarity index 78% rename from .github/workflows/python-publish.yml rename to .github/workflows/python-publish-sdist.yml index 285adc2..6e502f0 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish-sdist.yml @@ -26,10 +26,9 @@ jobs: - uses: astral-sh/setup-uv@v5 with: python-version: '3.11' - - run: uv build + - run: uv build --sdist # Check that basic features work and we didn't miss to include crucial files - - name: import test (wheel) - run: uv run --isolated --no-project -p 3.11 --with dist/*.whl datastock/tests/prepublish.py - - name: import test (source distribution) + - name: import test (sdist) run: uv run --isolated --no-project -p 3.11 --with dist/*.tar.gz datastock/tests/prepublish.py - - run: uv publish -t ${{ secrets.PYPI_API_TOKEN }} + - name: publish + run: uv publish -t ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/python-publish-wheel.yml b/.github/workflows/python-publish-wheel.yml new file mode 100644 index 0000000..f001907 --- /dev/null +++ b/.github/workflows/python-publish-wheel.yml @@ -0,0 +1,39 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package wheels + +on: + push: + tags: + - '*' + branches: + - main + release: + types: [created] + +jobs: + pypi: + name: Publish wheel to Pypi + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.8", "3.9", "3.10", "3.11"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + with: + python-version: ${{ matrix.python-version }} + - run: uv build --wheel + # Check that basic features work and we didn't miss to include crucial files + - name: import test (wheel) + run: uv run --isolated --no-project -p ${{ matrix.python-version }} --with dist/*.whl datastock/tests/prepublish.py + - name: publish + run: uv publish -t ${{ secrets.PYPI_API_TOKEN }} From 02815948b5084f0ee083e42fd0b1a637b70255cf Mon Sep 17 00:00:00 2001 From: dvezinet Date: Wed, 2 Apr 2025 20:58:24 +0000 Subject: [PATCH 2/3] [#224] Numpy<1.25 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3c75c75..23ddb69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ keywords = [ ] requires-python = ">=3.8" dependencies = [ - "numpy", + "numpy<1.25", # for astropy compatibility vs deprecated np.product "scipy", "matplotlib", # "PySide2 ; platform_system != 'Windows'", From 53697ec56f7d0dbfaeee3de12c096703797cf16c Mon Sep 17 00:00:00 2001 From: dvezinet Date: Wed, 2 Apr 2025 21:11:02 +0000 Subject: [PATCH 3/3] [#devel] changes wheel publishing strategy to not stop on first fail --- .github/workflows/python-publish-wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish-wheel.yml b/.github/workflows/python-publish-wheel.yml index f001907..be562b8 100644 --- a/.github/workflows/python-publish-wheel.yml +++ b/.github/workflows/python-publish-wheel.yml @@ -21,7 +21,7 @@ jobs: pypi: name: Publish wheel to Pypi strategy: - fail-fast: true + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11"]