generated from neutrons/python_project_template
-
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
Open
darshdinger
wants to merge
21
commits into
next
Choose a base branch
from
ewm11764-migrate-SNAPWrap-to-PIXI-clean
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c09cf29
git commit -m "Complete migration from Conda to PIXI environment mana…
darshdinger 3e496b3
Incorrect versioning syntax
darshdinger 680bcda
Remove conda recipe and related files
darshdinger 3984f64
Add updated pixi.lock
darshdinger c5ce5b8
Update github workflows
darshdinger ec1c39e
Address more comments
darshdinger 3d3c31b
More comments
darshdinger ff9c7be
Update channels.
darshdinger 9b3815d
Revert package.yml and update
darshdinger 99273f1
Update pixi.lock
darshdinger 99bd328
More comments
darshdinger 7839542
Migrate from setuptools to hatchling and address review comments
darshdinger 56bcbb0
Fix build-conda
darshdinger 2508911
Add conda recipe and update build task to use conda-build
darshdinger a8d0f7b
Update pixi.lock and pyproject.toml for SNAPWrap migration to PIXI
darshdinger 4a93f65
fix pixi build
glass-ships a6c09fc
patch PR to help with pixi stuff
glass-ships d05d8e0
fix task name
glass-ships d2b3234
run package test on PRs
glass-ships b5f3e25
Add docs and add workbench launch command
darshdinger b79c5ec
Merge pull request #69 from neutrons/ewm11764-glass-patch
walshmm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: conda packaging and deployment | ||
| name: pixi packaging and deployment | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
@@ -9,31 +9,17 @@ 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 from environment_development.yml" | ||
| pixi-version: v0.41.4 | ||
| manifest-path: pyproject.toml | ||
| - name: build conda 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 | ||
| echo "build and verify conda package" | ||
| pixi run verify-conda | ||
| - name: upload conda package to anaconda | ||
| shell: bash -l {0} | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| env: | ||
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | ||
|
|
@@ -43,30 +29,24 @@ 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 | ||
| pixi run -- 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 | ||
| - 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 | ||
| pixi-version: v0.41.4 | ||
| manifest-path: pyproject.toml | ||
| - name: build pypi package | ||
| run: | | ||
| # build the package | ||
| VERSION=$(versioningit .) python -m build | ||
| pixi run build-pypi | ||
| # publish your distributions here (need to setup on PyPI first) | ||
| - name: Publish package distributions to PyPI | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} | ||
darshdinger marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: build conda package | ||
| 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 "build and verify conda package" | ||
| pixi run verify-conda | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,4 +17,4 @@ 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" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.