Skip to content

Commit

Permalink
Add and distribute pypi constraints (#6)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jaimergp authored Jun 20, 2024
1 parent e161599 commit 77610d1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 15 deletions.
50 changes: 35 additions & 15 deletions .github/workflows/conda.yml → .github/workflows/pins.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create conda subchannel
name: Pins

on:
push:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions versions/v0.4.19/pypi.txt
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions versions/v0.5/pypi.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 77610d1

Please sign in to comment.