-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[DEV]: add pixi.lock and add pixi to pyproject.toml #31384
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: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| name: Pixi | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "pixi.lock" | ||
| - "pyproject.toml" | ||
| - "src/**" | ||
| - "lib/**" | ||
| - ".github/workflows/pixi.yml" | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "pixi.lock" | ||
| - "pyproject.toml" | ||
| - "src/**" | ||
| - "lib/**" | ||
| - ".github/workflows/pixi.yml" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| check-lockfile: | ||
| runs-on: ubuntu-slim | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||
| with: | ||
| fetch-depth: 1 | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up pixi | ||
| uses: prefix-dev/setup-pixi@v0.9.4 | ||
| with: | ||
| pixi-version: v0.66.0 | ||
| run-install: false | ||
|
|
||
| - name: Check that pixi.lock is up to date | ||
| run: | | ||
| if ! pixi install --locked --manifest-path pyproject.toml; then | ||
| echo "::error file=pixi.lock::pixi.lock is not consistent with pyproject.toml. " \ | ||
| "Run 'pixi lock' locally and commit the updated pixi.lock." | ||
| exit 1 | ||
| fi | ||
|
|
||
| pixi-linux-install: | ||
| needs: check-lockfile | ||
| runs-on: ubuntu-slim | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||
| with: | ||
| fetch-depth: 0 | ||
|
jklymak marked this conversation as resolved.
|
||
| persist-credentials: false | ||
|
|
||
| - name: Set up pixi and install environment | ||
| uses: prefix-dev/setup-pixi@v0.9.4 | ||
| with: | ||
| pixi-version: v0.66.0 | ||
| locked: true | ||
| cache: true | ||
| cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | ||
|
|
||
| - name: Show pixi info | ||
| run: | | ||
| pixi info | ||
| pixi list | ||
|
|
||
| - name: Clean build artifacts | ||
| run: | | ||
| rm -rf build meson-logs meson-private .mesonpy-* | ||
|
|
||
| - name: Install Matplotlib editable | ||
| run: pixi run python -m pip install --config-settings=setup-args="-Db_lto=false" --editable . | ||
|
|
||
| - name: Smoke test editable install | ||
| run: | | ||
| pixi run python -c "import matplotlib; print(matplotlib.__version__)" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,6 +141,7 @@ setup. | |
|
|
||
| .. _venv: https://docs.python.org/3/library/venv.html | ||
| .. _conda: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html | ||
| .. _pixi: https://pixi.prefix.dev/ | ||
|
|
||
| .. tab-set:: | ||
|
|
||
|
|
@@ -199,6 +200,37 @@ setup. | |
|
|
||
| Remember to activate the environment whenever you start working on Matplotlib! | ||
|
|
||
| .. tab-item:: pixi environment | ||
|
|
||
| A `pixi`_ configuration is included in ``pyproject.toml`` that will | ||
| install the development dependencies:: | ||
|
|
||
| pixi install | ||
|
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. Do we need a dedicated
Member
Author
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. I suppose we could just have the one command, but I like keeping them separate so the user knows it was the pixi part that failed, not the pip install part. When these things fail they are pretty opaque...
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. Fair. OTOH the pixi install failing is quite unlikely. That‘d mean either an issue in the package infrastructure like a failing server) which is beyond our responsibility and should be rare) or it’s a configuration issue on our side. In the latter case we‘d also notice soon as this would also be broken in CI. I leave this up to you.
Member
Author
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. I'm more thinking it may fail on machines we don't test... |
||
|
|
||
| and then to install an editable version of Matplotlib:: | ||
|
|
||
| pixi run python -m pip install \ | ||
| --no-build-isolation \ | ||
| --config-settings=setup-args="-Db_lto=false" \ | ||
| --editable . | ||
|
|
||
| (the ``-Db_lto=false`` is not needed on all platforms). You can test the installation with:: | ||
|
|
||
| pixi run python -c "import matplotlib; print(matplotlib.__file__)" | ||
|
|
||
|
|
||
| .. tip:: | ||
| We provide some pixi tasks as shortcuts for common development tasks, | ||
| listed via:: | ||
|
|
||
| pixi task list | ||
|
|
||
| If you do not want to use ``pixi run`` in front of every command, run:: | ||
|
|
||
| pixi shell | ||
|
|
||
| and continue to use pixi as a python environment. | ||
|
|
||
|
|
||
| Install external dependencies | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.