Skip to content

[MAINT] Strip pip extras from build dependencies in conda recipe - #2432

Closed
ndgrigorian wants to merge 2 commits into
masterfrom
fix-conda-recipe-pip-extras
Closed

ndgrigorian wants to merge 2 commits into
masterfrom
fix-conda-recipe-pip-extras

Conversation

@ndgrigorian

@ndgrigorian ndgrigorian commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

This PR fixes conda package builds, which fail at recipe rendering since conda 26.10.0 started rejecting pip extras in match specs. The recipe copies versioneer[toml]==0.29 from [build-system].requires in pyproject.toml into host requirements, so all build_linux and build_windows jobs fail with

conda.exceptions.InvalidMatchSpec: Invalid spec 'versioneer[toml]==0.29': No key-value pairs found in square brackets, did you mean `extras=[toml]`?

The extras are now stripped from build-system requirements, producing versioneer==0.29. The toml extra only pulls in tomli on Python < 3.11, which the recipe already lists

This PR also adds a lower bound on cmake in the Linux examples environment. Since conda 26.10.0 the default solver is rattler, which avoids changing packages already installed in the environment, so a bare cmake resolves to cmake-3.5.0-3 on Python 3.14t and 3.15, and the examples fail with

CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.21...3.27 or higher is required.  You are running version 3.5.0

Requiring cmake>=3.22, the highest minimum among the examples, resolves to cmake 4.5.1, which the subsequent pybind11 cython scikit-build install keeps

Checked locally with conda 26.10.0 and conda-build 26.3.0: on master conda render reproduces the error, this branch renders and resolves versioneer 0.29, and the examples env solves reproduce cmake 3.5.0 without the bound and cmake 4.5.1 with it

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

conda 26.10 rejects specs like versioneer[toml]==0.29 when rendering the recipe
@github-actions

Copy link
Copy Markdown

@coveralls

coveralls commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 75.173%. remained the same — fix-conda-recipe-pip-extras into master

without a bound the solver keeps the installed env and picks cmake 3.5.0

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the conda dependency normalization and Linux example CMake requirement changes.

No open issues 🎉

What changed in this PR

This PR addresses conda 26.10.0 compatibility issues in package builds and Linux example CI.

Changes:

  • Strips pip extras from build-system dependencies before adding them to conda host requirements.
  • Requires CMake ≥3.22 in the Linux examples environment to prevent selection of an unsupported older version.
File Description
conda-recipe/​meta.yaml Removes extras syntax so requirements such as versioneer[toml]==0.29 become valid conda specifications.
.github/​workflows/​conda-package.yml Adds the CMake lower bound required by the Linux examples.

Review effort: Balanced

@antonwolfy antonwolfy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The recipe change fixes the render error: all build_linux and build_windows jobs pass in both workflows, including 3.15. The cmake bound does not fix the Linux examples jobs in conda-package.yml, though: both of them (3.15 cp315 and 3.14 cp314t) now fail at the changed line instead of later at CMake, see the inline comment.

The failing "Build with nightly build of DPC++ toolchain on Windows" job is unrelated: it fails in the pin/tag check step, and the same workflow fails on other branches too.

echo "Environment created"
# shellcheck disable=SC2086
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y cmake ninja $CHANNELS || exit 1
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y "cmake>=3.22" ninja $CHANNELS || exit 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both test_examples_linux jobs fail at this line:

PackagesNotFoundInChannelsError: The following packages are not available from current channels:
  - python3.14.*.*      (python3.15.*.* on the 3.15 job)

CI does not run conda 26.10.0 here. The "Install conda-index" step (conda install conda-index=... -c conda-forge) supersedes base conda with conda-forge's conda-26.7.3 while conda-rattler-solver 26.11.0 from pkgs/main stays, and it swaps certifi (the log shows Failed to export: Could not find a suitable TLS CA certificate bundle). With conda 26.10.0 and rattler locally, this exact install solves to cmake 4.x and bare cmake gives cmake-3.5.0-3, so the local check holds, just not for the conda CI ends up with.

Options: install cmake ninja pybind11 cython scikit-build in the same conda create as python/pytest/setuptools, as conda-package-cf.yml does (its examples jobs pass in this run), or keep the conda-index step from downgrading conda, e.g. by adding "conda>=26.10" to that install.

Comment thread conda-recipe/meta.yaml
Comment on lines +46 to +48
{% elif '[' in dep %}
# strip pip extras, conda does not accept them
- {{ dep.split('[')[0] ~ dep.split(']')[1] }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this branch skips the replace('_','-') of the else branch and keeps any ; marker, so a later foo_bar[x] or foo[x]; marker dep would render differently than without extras. It is fine for versioneer[toml]==0.29 today. Stripping the extras first, e.g. {% set dep = dep.split('[')[0] ~ dep.split(']')[1] if '[' in dep else dep %} at the top of the loop, would let the dep fall through to the existing branches, and the comment would not sit inside the loop.

@ndgrigorian

Copy link
Copy Markdown
Collaborator Author

Superseded by #2409

@ndgrigorian ndgrigorian closed this Dec 2, 2026
@ndgrigorian
ndgrigorian deleted the fix-conda-recipe-pip-extras branch December 4, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants