-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate from CONDA to pixi #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
c09cf29
3e496b3
680bcda
3984f64
c5ce5b8
ec1c39e
3d3c31b
ff9c7be
9b3815d
99273f1
99bd328
7839542
56bcbb0
2508911
a8d0f7b
4a93f65
a6c09fc
d05d8e0
d2b3234
b5f3e25
b79c5ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,38 +2,39 @@ name: conda packaging and deployment | |
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| push: | ||
| branches: [qa, main] | ||
| tags: ['v*'] | ||
|
|
||
| jobs: | ||
| linux: | ||
| conda-publish: | ||
| name: build and upload to Anaconda | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash -l {0} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
|
|
||
| - name: Setup Pixi | ||
| uses: prefix-dev/[email protected] | ||
| with: | ||
| auto-update-conda: true | ||
| channels: conda-forge,defaults | ||
| use-mamba: true | ||
| environment-file: environment.yml | ||
| activate-environment: test | ||
| - name: install additional dependencies | ||
| run: | | ||
| echo "installing additional dependencies from environment_development.yml" | ||
| - name: build conda package | ||
| pixi-version: v0.49.0 | ||
| manifest-path: pyproject.toml | ||
|
|
||
| - name: Build package | ||
| run: | | ||
| # set up environment | ||
| cd conda.recipe | ||
| echo "versioningit $(versioningit ../)" | ||
| # build the package | ||
| VERSION=$(versioningit ../) conda mambabuild --channel conda-forge --channel mantid/label/nightly --channel mantid-ornl --channel mantid-ornl/label/rc --channel neutrons/label/rc --output-folder . . | ||
| conda verify noarch/snapwrap*.tar.bz2 | ||
| - name: upload conda package to anaconda | ||
| shell: bash -l {0} | ||
| pixi run conda-build | ||
| mkdir -p /tmp/local-channel/linux-64 | ||
| cp *.conda /tmp/local-channel/linux-64 | ||
|
|
||
| - name: Verify conda package | ||
| uses: neutrons/conda-verify | ||
| with: | ||
| package-name: snapwrap | ||
| local-channel: /tmp/local-channel | ||
| python-version: "3.10" | ||
| extra-channels: mantid/labels/nightly neutrons | ||
|
|
||
| - name: Upload package to anaconda | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| env: | ||
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | ||
|
|
@@ -43,31 +44,4 @@ jobs: | |
| CONDA_LABEL="main" | ||
| if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi | ||
| echo pushing ${{ github.ref }} with label $CONDA_LABEL | ||
| anaconda upload --label $CONDA_LABEL conda.recipe/noarch/snapwrap*.tar.bz2 | ||
|
|
||
| pypi-publish: | ||
| name: upload release to PyPI | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash -l {0} | ||
| permissions: | ||
| # IMPORTANT: this permission is mandatory for trusted publishing | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| auto-update-conda: true | ||
| channels: conda-forge,defaults | ||
| use-mamba: true | ||
| environment-file: environment.yml | ||
| activate-environment: test | ||
| - name: build pypi package | ||
| run: | | ||
| # build the package | ||
| VERSION=$(versioningit .) python -m build | ||
| # publish your distributions here (need to setup on PyPI first) | ||
| - name: Publish package distributions to PyPI | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| pixi run anaconda upload --label $CONDA_LABEL --user neutrons snapwrap-*.conda | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: unit-test | ||
| name: pixi unit-test | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
@@ -10,38 +10,22 @@ on: | |
| jobs: | ||
| linux: | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash -l {0} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| - uses: prefix-dev/setup-[email protected] | ||
| with: | ||
| auto-update-conda: true | ||
| channels: conda-forge,defaults | ||
| use-mamba: true | ||
| environment-file: environment.yml | ||
| activate-environment: test | ||
| - name: install additional dependencies | ||
| run: | | ||
| echo "installing additional dependencies if cannot be installed from conda" | ||
| pixi-version: v0.41.4 | ||
| manifest-path: pyproject.toml | ||
| - name: run unit tests | ||
| run: | | ||
| echo "running unit tests" | ||
| python -m pytest --cov=src --cov-report=xml --cov-report=term-missing tests/ | ||
| pixi run test | ||
| - name: upload coverage to codecov | ||
| uses: codecov/codecov-action@v5 | ||
| if: | ||
| github.actor != 'dependabot[bot]' | ||
| if: github.actor != 'dependabot[bot]' | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| - name: build conda package | ||
| - name: build test | ||
| run: | | ||
| # test that the conda package builds | ||
| cd conda.recipe | ||
| echo "versioningit $(versioningit ../)" | ||
| # conda channels could have been defined in the conda-incubator, but you can copy/paste the lines | ||
| # below to build the conda package in your local machine | ||
| CHANNELS="--channel mantid/label/main --channel conda-forge --channel mantid/label/nightly --channel mantid-ornl --channel mantid-ornl/label/rc --channel neutrons/label/rc" | ||
| VERSION=$(versioningit ../) conda mambabuild $CHANNELS --output-folder . . | ||
| conda verify noarch/snapwrap*.tar.bz2 | ||
| echo "testing package build" | ||
| pixi run conda-build | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,6 @@ repos: | |
| - id: check-merge-conflict | ||
| - id: check-yaml | ||
| args: [--allow-multiple-documents] | ||
| exclude: "conda.recipe/meta.yaml" | ||
| - id: end-of-file-fixer | ||
| exclude: "tests/cis_tests/.*" | ||
| - id: trailing-whitespace | ||
|
|
@@ -17,4 +16,13 @@ repos: | |
| rev: v2.4.1 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you may want to add a hook to check that the lockfile is up to date, I've found it really convenient since I tend to forget to run "pixi lock" before committing and then CI fails and I have to make another one file commit... |
||
| hooks: | ||
| - id: codespell | ||
| exclude: ".*\\.lock$|tests/cis_tests/.*" | ||
| exclude: ".*\\.lock$|tests/cis_tests/.*|pixi\\.lock" | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: pixi-lock | ||
| name: Check pixi lock file is up to date | ||
| entry: pixi install --locked | ||
| language: system | ||
| files: ^(pixi\.toml|pyproject\.toml)$ | ||
| pass_filenames: false | ||
Uh oh!
There was an error while loading. Please reload this page.