From 77610d12cb25f2a793b4243b8af527ad7f8eec23 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 20 Jun 2024 12:09:38 +0200 Subject: [PATCH] Add and distribute pypi constraints (#6) * add pypi constraints * Upload pypi constraints * recursive tree is better * Only txt files * Only one PyPI job? * fix paths * rm empty dir * revert if's --- .github/workflows/{conda.yml => pins.yml} | 50 ++++++++++++++++------- versions/v0.4.19/pypi.txt | 5 +++ versions/v0.5/pypi.txt | 5 +++ 3 files changed, 45 insertions(+), 15 deletions(-) rename .github/workflows/{conda.yml => pins.yml} (75%) create mode 100644 versions/v0.4.19/pypi.txt create mode 100644 versions/v0.5/pypi.txt diff --git a/.github/workflows/conda.yml b/.github/workflows/pins.yml similarity index 75% rename from .github/workflows/conda.yml rename to .github/workflows/pins.yml index be29b8ce..1e83517a 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/pins.yml @@ -1,4 +1,4 @@ -name: Create conda subchannel +name: Pins on: push: @@ -29,7 +29,7 @@ jobs: id: args run: echo "versions=$(ls versions | jq -Rsc 'split("\n")[:-1]')" >> $GITHUB_OUTPUT - build: + build-conda-subchannel: needs: [prepare] runs-on: ubuntu-latest strategy: @@ -67,28 +67,48 @@ jobs: utcOffset: "+00:00" - uses: actions/upload-artifact@v4 with: - name: ${{ steps.args.outputs.subchannel-name }} + name: conda-${{ steps.args.outputs.subchannel-name }} path: ${{ steps.subchannel.outputs.output-directory }} + + build-pypi-constraints: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/upload-artifact@v4 + with: + name: pypi-napari-allversions + path: versions/*/*.txt publish-website: runs-on: ubuntu-latest if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' - needs: [build] + needs: [build-conda-subchannel, build-pypi-constraints] permissions: contents: write # to deploy to GH Pages steps: - name: Retrieve release distributions uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: - pattern: "${{ needs.build.outputs.subchannel-prefix }}*" + pattern: "*-napari-*" + - name: List artifacts + run: tree -sh + - name: Arrange directories + run: | + mkdir -p conda pypi + for d in conda-*/; do + mv $d conda/${d:6} + done + for d in pypi-napari-allversions/*; do + mv $d pypi/napari-$(basename $d) + done + rm -rf pypi-napari-allversions - name: List website files - run: ls -alh + run: tree -sh - uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 with: github_token: ${{ github.token }} publish_branch: gh-pages publish_dir: ./ - destination_dir: conda/ user_name: "github-actions[bot]" user_email: "github-actions[bot]@users.noreply.github.com" enable_jekyll: false @@ -99,34 +119,34 @@ jobs: publish-repodata: runs-on: ubuntu-latest if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' - needs: [build] + needs: [build-conda-subchannel] permissions: contents: write # to deploy to GH Releases strategy: matrix: - subdir: ${{ fromJson(needs.build.outputs.subdirs) }} - version: ${{ fromJson(needs.build.outputs.versions) }} + subdir: ${{ fromJson(needs.build-conda-subchannel.outputs.subdirs) }} + version: ${{ fromJson(needs.build-conda-subchannel.outputs.versions) }} steps: - name: Retrieve release distributions uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: - name: "${{ needs.build.outputs.subchannel-prefix }}${{ matrix.version }}" + name: "conda-${{ needs.build-conda-subchannel.outputs.subchannel-prefix }}${{ matrix.version }}" - name: List repodata files run: ls -alh ${{ matrix.subdir }}/repodata.* - name: Upload conda repodata for ${{ matrix.subdir }} uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5 with: draft: false - name: ${{ needs.build.outputs.subchannel-prefix }}${{ matrix.version }}/${{ matrix.subdir }} - tag_name: ${{ needs.build.outputs.subchannel-prefix }}${{ matrix.version }}/${{ matrix.subdir }} + name: ${{ needs.build-conda-subchannel.outputs.subchannel-prefix }}${{ matrix.version }}/${{ matrix.subdir }} + tag_name: ${{ needs.build-conda-subchannel.outputs.subchannel-prefix }}${{ matrix.version }}/${{ matrix.subdir }} files: | ${{ matrix.subdir }}/*.json ${{ matrix.subdir }}/*.json.bz2 ${{ matrix.subdir }}/*.json.zst fail_on_unmatched_files: true body: | - Repodata for `${{ needs.build.outputs.subchannel-prefix }}${{ matrix.version }}/${{ matrix.subdir }}` subchannel. - Last updated on ${{ needs.build.outputs.lastmodtime }} UTC. + Repodata for `${{ needs.build-conda-subchannel.outputs.subchannel-prefix }}${{ matrix.version }}/${{ matrix.subdir }}` subchannel. + Last updated on ${{ needs.build-conda-subchannel.outputs.lastmodtime }} UTC. See the README for more information. keepalive-job: diff --git a/versions/v0.4.19/pypi.txt b/versions/v0.4.19/pypi.txt new file mode 100644 index 00000000..dc170cdc --- /dev/null +++ b/versions/v0.4.19/pypi.txt @@ -0,0 +1,5 @@ +# constraints file (https://pip.pypa.io/en/stable/user_guide/#constraints-files) for napari v0.4.19 +PySide6 < 6.3.2 ; python_version < '3.10' +PySide6 != 6.4.3, !=6.5.0, !=6.5.1, !=6.5.1.1, !=6.5.2, != 6.5.3, != 6.6.0, != 6.6.1, != 6.6.2 ; python_version >= '3.10' and python_version < '3.12' +pyopengl!=3.1.7 +tensorstore!=0.1.38 diff --git a/versions/v0.5/pypi.txt b/versions/v0.5/pypi.txt new file mode 100644 index 00000000..b818d607 --- /dev/null +++ b/versions/v0.5/pypi.txt @@ -0,0 +1,5 @@ +# constraints file (https://pip.pypa.io/en/stable/user_guide/#constraints-files) for napari v0.5 +PySide6 < 6.3.2 ; python_version < '3.10' +PySide6 != 6.4.3, !=6.5.0, !=6.5.1, !=6.5.1.1, !=6.5.2, != 6.5.3, != 6.6.0, != 6.6.1, != 6.6.2 ; python_version >= '3.10' and python_version < '3.12' +pyopengl!=3.1.7 +tensorstore!=0.1.38