Skip to content

feat(packaging): conda recipes for polars-bio and polars-config-meta - #426

Open
mwiewior wants to merge 4 commits into
masterfrom
feat/conda-packaging
Open

feat(packaging): conda recipes for polars-bio and polars-config-meta#426
mwiewior wants to merge 4 commits into
masterfrom
feat/conda-packaging

Conversation

@mwiewior

Copy link
Copy Markdown
Collaborator

Track A of the adoption roadmap (docs/superpowers/specs/2026-07-27-adoption-zero-config-first-run-design.md): make polars-bio installable with conda, so it can be picked up by nf-core modules, Snakemake wrappers and biocontainers.

Upstream pull requests opened from this work:

conda-forge/staged-recipes#34325 polars-config-meta — linter and linux_64 / osx_64 / win_64 builds all green
bioconda/bioconda-recipes#67602 polars-bio — draft, deliberately blocked on the above

What changed

The recipe in bioconda-recipe/ was already tracked but stale: version 0.21.0, datafusion >=50,<51, pyarrow >=21,<23, a typing-extensions dependency we no longer have, and py<310. It is now 0.33.0 with pins matching pyproject.toml.

It also moves to a build.sh, which is necessary rather than cosmetic:

  • rust-toolchain.toml pins channel 1.91.0. Conda builds supply their own rustc and have no rustup, so the pin has to be removed or the build fails outright.
  • Upstream CI builds PyPI wheels with -Ctarget-cpu=skylake / apple-m1 and -Dwarnings. The first emits instructions that fault on older hardware and the second turns any new compiler lint into a build failure, so RUSTFLAGS is cleared for the conda build.

Plus git in the build environment (six dependencies resolve from git tags), {{ stdlib('c') }}, run_exports, and cargo-bundle-licenses recording the 662-crate licence graph into THIRDPARTY.yml.

Two real bugs found while verifying

  • polars-config-meta is broken on import without polars. It declares dependencies = [] and lists polars as an optional extra, but __init__.py imports it at module scope. A local conda-build caught this; the conda-forge recipe declares polars as a run dependency.
  • The release workflow had a race. It fired on release-published and immediately downloaded the sdist, but publishing to PyPI is a separate workflow, so the download could 404. It now polls. It also never synced the fork before branching, which would have put unrelated commits in every bump PR.

Verification

  • bioconda-utils lint --packages polars-bioAll checks OK
  • Local conda-build against conda-forge pinning produced polars-bio-0.33.0-py312h7217057_0.conda; pip check and the packaged overlap test both pass
  • polars-config-meta built and tested as polars-config-meta-0.3.4-py_0.conda

Not included

Installation docs still say pip only. That should be updated when the packages are actually available on the channels, not before.

🤖 Generated with Claude Code

mwiewior and others added 4 commits July 27, 2026 12:23
Design for the first adoption sub-project: conda distribution and
parallel-by-default. Records the survey finding that external friction
sits entirely at the install and I/O edges rather than in the engine,
and sequences the #421 write-ordering fix ahead of flipping the
target_partitions default.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Brings the bioconda recipe up to date and adds the conda-forge recipe for
the one dependency that is not yet packaged, so polars-bio can be installed
with conda rather than pip only.

bioconda recipe (recipes/polars-bio):
- Bump 0.21.0 -> 0.33.0 with the current sdist sha256.
- Correct the pins to match pyproject.toml: datafusion >=53,<54 (was 50),
  pyarrow >=23.0.1,<25 (was >=21,<23). Drop typing-extensions, which is no
  longer a dependency.
- Require Python >=3.11 rather than >=3.10, matching requires-python.
- Move to a build.sh, which is needed to remove rust-toolchain.toml (the
  conda build supplies its own rustc and has no rustup to honour the pin)
  and to clear the -Ctarget-cpu / -Dwarnings RUSTFLAGS that upstream CI
  sets for PyPI wheels but which are wrong for a redistributable package.
- Add git, cmake and make to the build environment: six dependencies
  resolve from git tags.
- Replace the print-only test with an actual overlap query, so a package
  that imports but cannot execute fails the build.

conda-forge recipe (staged-recipes/polars-config-meta):
- Source the GitHub tag archive rather than the PyPI sdist, which omits
  LICENSE.
- Declare polars as a run dependency. Upstream lists it as an optional
  extra but imports it at module scope, so the package is broken on import
  without it; a local conda-build caught this.
- Fix the build backend to uv_build; the earlier draft said pdm-backend.

Release automation:
- Poll PyPI for the sdist instead of downloading immediately. Publishing
  is a separate workflow, so the release event can win the race and 404.
- Sync the fork against upstream before branching, so the pull request
  does not carry unrelated commits from a stale fork.
- Anchor the sed expressions and verify the substitutions took effect.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Matched against bioconda's existing Rust+maturin genomics recipe (oxbow):

- Add {{ stdlib('c') }}, which current conda-forge pinning requires and
  whose absence fails dependency resolution.
- Run cargo-bundle-licenses and ship THIRDPARTY.yml in license_file, so the
  licences of the 662-crate dependency graph are recorded.
- Add pkg-config to the build environment.

Also document a local-only trap in the README: conda-build without
conda-forge's pinning picks a macOS deployment target from the host SDK,
which can exceed the running OS. maturin then tags the wheel with that
version and the test phase fails pip check with "not supported on this
platform". Bioconda pins the target well below the runner, so this does not
affect CI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bioconda-utils lint fails a recipe without run_exports
(missing_run_exports). Pinned to the minor version rather than the major
one, since polars-bio is still 0.x with an evolving API.

Verified: 'bioconda-utils lint --packages polars-bio' reports All checks OK,
and a local conda-build of the recipe produces
polars-bio-0.33.0-py312h7217057_0.conda with pip check and the overlap
smoke test passing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant