Skip to content

feat: add skip_pyc_compilation configuration option#5737

Open
wolfv wants to merge 5 commits intomainfrom
claude/expose-skip-pyc-compilation-VWEhx
Open

feat: add skip_pyc_compilation configuration option#5737
wolfv wants to merge 5 commits intomainfrom
claude/expose-skip-pyc-compilation-VWEhx

Conversation

@wolfv
Copy link
Copy Markdown
Member

@wolfv wolfv commented Mar 20, 2026

Description

This PR adds a new skip_pyc_compilation configuration option to the Python backend that allows users to skip the compilation of .py files to .pyc bytecode files during package installation.

This is useful to reduce compilation times e.g. for NumPy TSAN builds.

https://claude.ai/code/session_01NHP4pN28RENjggL18o5SST

…ython

Add `skip_pyc_compilation` field to `Python` struct in recipe_stage0 and
`PythonBackendConfig` in pixi_build_python, allowing users to set
`skip-pyc-compilation = true` in `[package.build.config]` to skip .pyc
bytecode compilation during package installation.

https://claude.ai/code/session_01NHP4pN28RENjggL18o5SST
@wolfv wolfv changed the title Add skip_pyc_compilation configuration option feat: add skip_pyc_compilation configuration option Mar 20, 2026
Copy link
Copy Markdown
Collaborator

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

rattler-build accepts a glob rather than a bool, could you quickly explain how this is plumbed through? For my use-case the bool is fine but maybe a glob would be more flexible?

claude added 2 commits March 21, 2026 06:07
rattler-build expects skip_pyc_compilation to be a list of glob patterns
(ConditionalList<String> / GlobVec), not a boolean. Update the field type
to Vec<String> in both the Python recipe struct and PythonBackendConfig.

Usage in pixi.toml:
  [package.build.config]
  skip-pyc-compilation = ["**/*.py"]

https://claude.ai/code/session_01NHP4pN28RENjggL18o5SST
…> type

The Python binding was still using `false` (bool) instead of `vec![]`
for the skip_pyc_compilation field after the type change.

https://claude.ai/code/session_01NHP4pN28RENjggL18o5SST
Copy link
Copy Markdown
Collaborator

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

currently not working:

❯ tixi build
Error:   × could not initialize the build-backend
  ├─▶   × failed to parse configuration
  │
  ╰─▶   × unknown field `skip_pyc_compilation`, expected one of `noarch`, `extra-args`, `env`, `debug-dir`, `debug_dir`, `extra-input-globs`, `compilers`, `ignore-
        │ pyproject-manifest`, `ignore-pypi-mapping`, `abi3`

Copy link
Copy Markdown
Collaborator

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

I wasn't using the build backend from source. Pushed a commit to make that possible, and now it works 🎉 thanks!

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.

3 participants