From c175cfa4bc73e8cb0139cd854d2f836f6aa4ec79 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 28 Sep 2023 11:48:34 -0400 Subject: [PATCH 1/3] use PyPI upload workflow from OpenAstronomy (#214) * use OpenAstronomy PyPI upload workflow * try copying Astropy's config (may need to omit arm entries) * force CPython * fix upload event filter --- .github/workflows/build.yml | 20 ++++++++++++++++++++ .github/workflows/publish-to-pypi.yml | 16 ---------------- pyproject.toml | 6 ++++++ 3 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..9479373a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: build + +on: + release: + types: [ released ] + pull_request: + workflow_dispatch: + +jobs: + build: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1 + with: + upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }} + targets: | + - cp3?-manylinux_x86_64 + - cp3?-macosx_x86_64 + sdist: true + secrets: + pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} + diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml deleted file mode 100644 index d36fd7d2..00000000 --- a/.github/workflows/publish-to-pypi.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Publish to PyPI - -on: - release: - types: [released] - -jobs: - publish: - uses: spacetelescope/action-publish_to_pypi/.github/workflows/workflow.yml@master - with: - test: false - build_platform_wheels: true # Set to true if your package contains a C extension - secrets: - user: ${{ secrets.PYPI_USERNAME_STSCI_MAINTAINER }} - password: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} # WARNING: Do not hardcode secret values here! If you want to use a different user or password, you can override this secret by creating one with the same name in your Github repository settings. - test_password: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER_TEST }} diff --git a/pyproject.toml b/pyproject.toml index c336af4d..cf6338ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,3 +90,9 @@ exclude = [ '.tox', '.eggs', ] + +[tool.cibuildwheel.macos] +archs = ["x86_64", "arm64"] + +[tool.cibuildwheel.linux] +archs = ["auto", "aarch64"] \ No newline at end of file From 1c44870d702537a3086157ed43c40b312f76189e Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Thu, 28 Sep 2023 10:50:55 -0400 Subject: [PATCH 2/3] download WebbPSF data for downstream tests --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddf0a206..43cd6569 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,13 +42,44 @@ jobs: python-version: '3.11' - linux: test-cov-xdist coverage: 'codecov' + data: + name: retrieve data + runs-on: ubuntu-latest + outputs: + data_path: ${{ steps.data.outputs.path }} + data_hash: ${{ steps.data_hash.outputs.hash }} + steps: + # webbpsf: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - id: data + run: | + echo "path=/tmp/data" >> $GITHUB_OUTPUT + echo "webbpsf_url=https://stsci.box.com/shared/static/n1fealx9q0m6sdnass6wnyfikvxtc0zz.gz" >> $GITHUB_OUTPUT + - run: | + mkdir -p tmp/data/ + mkdir -p ${{ steps.data.outputs.path }} + - run: wget ${{ steps.data.outputs.webbpsf_url }} -O tmp/minimal-webbpsf-data.tar.gz + - run: tar -xzvf tmp/minimal-webbpsf-data.tar.gz -C tmp/data/ + - id: data_hash + run: echo "hash=${{ hashFiles( 'tmp/data' ) }}" >> $GITHUB_OUTPUT + - run: mv tmp/data/* ${{ steps.data.outputs.path }} + - uses: actions/cache@v3 + with: + path: ${{ steps.data.outputs.path }} + key: data-${{ steps.data_hash.outputs.hash }} test_downstream: uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + needs: [ data ] with: setenv: | CRDS_PATH: /tmp/crds_cache CRDS_CLIENT_RETRY_COUNT: 3 - CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 + CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 + WEBBPSF_PATH: ${{ needs.data.outputs.data_path }}/webbpsf-data + cache-path: ${{ needs.data.outputs.data_path }} + cache-key: data-${{ needs.data.outputs.data_hash }} envs: | - linux: test-jwst-cov-xdist - linux: test-romancal-cov-xdist From 70d8543f89c8b8660497d262a780294859890c9c Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Thu, 28 Sep 2023 11:40:54 -0400 Subject: [PATCH 3/3] pass env var --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index ce419dcf..2484e81e 100644 --- a/tox.ini +++ b/tox.ini @@ -60,6 +60,7 @@ deps = use_develop = true pass_env = CI + WEBBPSF_PATH set_env = devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple jwst: CRDS_SERVER_URL=https://jwst-crds.stsci.edu