Support consumer-configured project scoping for python_version
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- build-system
Direção de pesquisa
Start by reading the python_version flag declaration in @rules_python//python/config_settings and the root module's Python configuration API; then review the target and exec transitions, including the behavior needed by the precompiler in #4335. The issue describes the desired opt-in and ownership boundary, but leaves the API design and supported Bazel versions open. Done means documenting a supported root-module option and testing target transitions and exec tools while preserving the default behavior.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Relevant Rules
@rules_python//python/config_settings:python_version and the root module's Python configuration API.
Description
I build Python extensions for multiple interpreter versions, with large Python-independent Rust/C++ libraries underneath them. The bindings need different Python configurations, but the native libraries should share a configuration when their other inputs are equal.
For example:
Python 3.11 binding -> native core
Python 3.12 binding -> native core
A version transition on a binding also reaches its native dependencies unless that setting is reset. This creates extra configured targets and can change action keys even where the native library does not use Python. Exec-only flag trimming does not address ordinary target-configured libraries.
Bazel's configurability roadmap explicitly describes project-scoped flags as a way to avoid this cache fragmentation; its public example demonstrates the mechanism.
Currently I need a source patch to make the version flag project-scoped and associate it with my project's ownership definition. I would like to configure that through a supported API.
Describe the solution you'd like
An opt-in, root-module-controlled configuration that:
- Selects project scope for the Python-version flag while preserving the existing default behavior.
- Associates the flag with a consumer-supplied
PROJECT.scldefinition, without requiring a patch to the dependency's source tree.
The consumer would own the paths for bindings, intervening aliases, Python headers/runtimes and Python-sensitive build scripts. Python-independent native dependencies would remain outside those paths. The API need not infer that boundary automatically.
Please document the supported Bazel versions and test both target transitions and exec tools. In particular, #4335 deliberately sets universal scope so Bazel 10's precompiler uses the correct interpreter. An opt-in project mode must account for that correctness requirement rather than simply replacing the default.
This request uses Bazel's existing invocation-baseline reset semantics. It does not require the separate declared-default reset proposal in bazelbuild/bazel#32178.
Describe alternatives you've considered
Patching the flag declaration and adding a project-definition alias works as a local workaround, but ties the policy to dependency implementation details. Custom reset transitions require maintaining explicit boundaries and wrappers. A supported project-scoping option would let the ruleset own the integration while the consuming project owns its dependency boundary.
- Linguagem predominante
- Starlark
- Estrelas
- 692
- Forks
- 734
- Merge médio
- 11h 2min
- PRs com merge (30d)
- 150
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de bazel-contrib/rules_python
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
bazel-contrib/rules_python#4251 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
bazel-contrib/rules_python#4164 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Release 2.5.0Abertatype: release
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 25/100
bazel-contrib/rules_python#4388 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 45/100
bazel-contrib/rules_python#4311 ·
Mantenedores costumam responder em até 1 dia
-
pip.parse ignores uv.lock dependency-edge platform markersTalvez já em andamento @kdelalic assumiu há 16 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 20/100
bazel-contrib/rules_python#4287 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de bazel-contrib/rules_python
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
FAIRmat-NFDI/nomad-distro-dev#161 ·
-
The Recommended preset turns on Import Uno DSP, which only works with the Material themeTalvez já em andamento @agneszitte assumiu hoje. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
unoplatform/uno.templates#2388 ·
Mantenedores costumam responder em até 1 dia
-
area:ci area:security phase:dev priority:p1 type:chore
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
Mantenedores costumam responder em até 1 dia
-
Bug Report: Intel Fortran Compiler Flags Applied to GNU Fortran 15 During WRF-CMAQ 6.0 CompilationAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100