Repository navigation
Conversation
|
Thanks for drafting this PR @glemaitre. After IRL discussion, it seems that there is no configuration option in EDIT: the default pixi behavior has changed since last time I checked. Maybe this configuration option is not needed anymore. |
|
given prefix-dev/pixi#2628 (comment) I think we can go ahead with this PR. |
ogrisel
left a comment
There was a problem hiding this comment.
Here is some more feedback.
Once this PR is finalized, I would rather wait a week before merging it and push a commit that only refreshes the pixi lock file to be able to visualize the typical weekly diff we will have to review later and compare to what we currently deal with using conda-lock.
| name: Build wheel for Pull Request | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
There was a problem hiding this comment.
Why this change? It seems unrelated to the scope of the PR. We could consider this change in the context of #34006 but I would rather not mix this with the change to pixi if not needed.
| run-install: false | ||
|
|
||
| - name: Update pixi lock file | ||
| run: pixi update |
There was a problem hiding this comment.
Are we sure we want a single PR to update all the lock files at once? I think prefer distinct PRs for jobs with more experimental or more complex sets of dependencies and that are as a result likely to fail more often such as CUDA CI, free-threaded and scipy-dev.
Separate PRs allow for more focused investigative discussion threads in my opinion.
On the other hand, having many PRs, requires a bit more manual actions to approve and merge them all when everything goes well (which is 50% of the time or more in my experience). And it's also true that sometimes the failures and their resolution are somewhat correlated between lockfile update PRs.
So I am ok with either approach.
| # environments are actually exercised on the PR. scipy-dev is not | ||
| # included on purpose: it does not use pixi and installs the latest | ||
| # development dependencies at run time, independently of the lock file. | ||
| commit-message: "Update CI pixi lock file [free-threaded] [doc build]" |
| [tool.pixi.environments] | ||
| dev = { features = ["tests", "docs", "dev"] } | ||
| mkl = { features = ["mkl"], no-default-feature = true } | ||
| osx-arm64 = { features = ["osx-arm64"], no-default-feature = true } |
There was a problem hiding this comment.
I would rather stop using "osx" in build config names we control. Let's instead use "macos". The OSX naming was abandoned by Apple several years ago in favor of macOS.
| # The ubuntu_atlas and debian_32bit builds do not use a conda/pixi | ||
| # environment: they install numpy/scipy with apt and the remaining | ||
| # dependencies from a pip lock file. These two lock files are still maintained | ||
| # with the legacy `update_environments_and_lock_files.py` script. |
There was a problem hiding this comment.
Isn't it possible to also manage this via pixi? I thought pixi could be configured to set up environments with wheel packages from the PyPI distribution channel with the help of uv.
| echo "Installing numpy, scipy and pandas nightly wheels" | ||
| dev_anaconda_url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple | ||
| dev_packages="numpy scipy pandas" | ||
| pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url $dev_packages --only-binary :all: |
There was a problem hiding this comment.
Cannot this configuration of the nightly build distribution channel be also moved to a dedicated pixi feature in pyproject.toml?
| # environment, exactly like the previous conda-lock based setup. | ||
| [tool.pixi.workspace] | ||
| channels = ["conda-forge"] | ||
| platforms = ["linux-64", "linux-aarch64", "osx-64", "osx-arm64", "win-64"] |
There was a problem hiding this comment.
Let's also configure a default exclude-newer policy (for instance "7d") to make our CI more resilient against OSS Supply Chain attacks:
| uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6 | ||
| with: | ||
| pixi-version: ${{ env.PIXI_VERSION }} | ||
| manifest-path: pyproject.toml |
| pixi-version: ${{ env.PIXI_VERSION }} | ||
| manifest-path: pyproject.toml | ||
| environments: cuda | ||
| locked: true |
There was a problem hiding this comment.
I think this is the default as long as pixi.lock exists? https://github.com/prefix-dev/setup-pixi#--frozen-and---locked
| # Make the cuda environment available on the PATH of the following | ||
| # steps so that `python`/`pytest` resolve to it without `pixi run`. | ||
| # This also lets us run from outside the checkout directory. | ||
| activate-environment: cuda |
There was a problem hiding this comment.
another option is to make all of the following available as Pixi tasks, but this is fine 👍
| # environment, exactly like the previous conda-lock based setup. | ||
| [tool.pixi.workspace] | ||
| channels = ["conda-forge"] | ||
| platforms = ["linux-64", "linux-aarch64", "osx-64", "osx-arm64", "win-64"] |
There was a problem hiding this comment.
this should be adjusted to use 'rich platforms' with e.g. CUDA requirements specified at the top-level: https://pixi.prefix.dev/latest/workspace/multi_platform_configuration/#declaring-virtual-packages-per-platform.
See how we do it in SciPy at https://github.com/scipy/scipy/blob/main/pixi.toml.
| [tool.pixi.feature.cuda.system-requirements] | ||
| cuda = "12" |
| # NOTE: the scipy-dev build (numpy/scipy/pandas nightly wheels + git-master | ||
| # Cython/joblib/Pillow) is intentionally NOT managed by pixi. Those development | ||
| # versions change every day, while pixi.lock is only refreshed weekly, so | ||
| # pinning them would mean testing stale "dev" versions and churning the lock. | ||
| # That build installs its dependencies at run time instead; see the `scipy-dev` | ||
| # job in .github/workflows/unit-tests.yml and the `scipy-dev` branch in | ||
| # build_tools/github/install.sh. |
There was a problem hiding this comment.
for SciPy I think we are considering setting up a separate repository or fork to run such CI on
| # feature implicitly. The remaining environments are one per CI build and set | ||
| # ``no-default-feature`` so the default dependencies stay out of them. | ||
| # ---------------------------------------------------------------------------- | ||
| [tool.pixi.environments] |
There was a problem hiding this comment.
it's probably easier to make the 'default' environment its own environment and then not need to specify no-default-feature everywhere.
| echo "Installing numpy, scipy and pandas nightly wheels" | ||
| dev_anaconda_url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple | ||
| dev_packages="numpy scipy pandas" | ||
| pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url $dev_packages --only-binary :all: |
| # The ubuntu_atlas and debian_32bit builds do not use a conda/pixi | ||
| # environment: they install numpy/scipy with apt and the remaining | ||
| # dependencies from a pip lock file. These two lock files are still maintained | ||
| # with the legacy `update_environments_and_lock_files.py` script. |
Testing what it costs to switch to
pixifor the CI environment.