Update dependency rules_python to v1 - autoclosed #270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.37.2
->1.1.0
0.37.2
->1.1.0
Release Notes
bazelbuild/rules_python (rules_python)
v1.1.0
Compare Source
{#v1-1-0-changed}
Changed
version, per our Bazel support matrix. Earlier versions are not
tested by CI, so functionality cannot be guaranteed.
pip.parse
) From now we will make fewer calls to indexes whenfetching the metadata from SimpleAPI. The calls will be done in parallel to
each index separately, so the extension evaluation time might slow down if
not using {bzl:obj}
pip.parse.experimental_index_url_overrides
.pip.parse
) Only query SimpleAPI for packages that havesha values in the
requirements.txt
file.the version-aware rules are now simply aliases for the base rules. The
python_version
attribute is still used to specify the Python version.pip
to 24.3.1 andpackaging
to 24.2.{#v1-1-0-deprecations}
Deprecations
//python/config_settings:transitions.bzl
and itspy_binary
andpy_test
wrappers are deprecated. Use the regular rules instead.
{#v1-1-0-fixed}
Fixed
toolchains that search PATH to be used for the wheel builder tool.
whl_library
will now not have envmarker information allowing
bazel query
to work in cases where thewhl
isavailable for all of the platforms and the sdist can be built. This fix is
for both WORKSPACE and
bzlmod
setups.Fixes #2450.
Parameter Syntax. (#2396)
pip_parse.experimental_requirement_cycles
and{bzl:obj}
pip_parse.use_hub_alias_dependencies
together now works whenusing WORKSPACE files.
are now printing more details and include the currently active flag
values. Fixes #2466.
PyPI packages used in {bzl:obj}
whl_library
during therepository_rule
phasechange. Fixes #2468.
setup.py
files by default. To restorethis behavior, apply the
# gazelle:python_ignore_files setup.py
directive.whenever
PATH
changes. Fixes#2551.
{#v1-1-0-added}
Added
include_stub_packages
flag tomodules_mapping
. When set toTrue
, thisautomatically includes corresponding stub packages for third-party libraries
that are present and used (e.g.,
boto3
→boto3-stubs
), improvingtype-checking support.
{obj}
experimental_index_url
usage or the regularpip.parse
usage.To select the free-threaded interpreter in the repo phase, please use
the documented env variables.
Fixes #2386.
.pyi
files) and type-checkingonly dependencies added. See {obj}
py_library.pyi_srcs
andpy_library.pyi_deps
(and the same named attributes forpy_binary
andpy_test
).pyi_srcs
to include*.pyi
files.PyInfo
has new fields to aid static analysis tools:{obj}
direct_original_sources
, {obj}direct_pyi_files
,{obj}
transitive_original_sources
, {obj}transitive_pyi_files
.{#v1-1-0-removed}
Removed
find_requirements
in//python:defs.bzl
has been removed.{#v1-0-0}
v1.0.0
Compare Source
{#v1-0-0-changed}
Changed
Breaking:
Please consider depending on the flags defined in
//python/config_setting/...
and the@platforms
package instead.MACOS_NAME
and thearch
attribute in the
PLATFORMS
list, please update your code to respect the newvalues. The values now correspond to the values available in the
@platforms//
package constraint values.host_platform
andinterpreter
constants are no longer createdin the
toolchain
generated alias.bzl
files. If you need to access thehost interpreter during the
repository_rule
evaluation, please use the@python_{version}_host//:python
targets created by{bzl:obj}
python_register_toolchains
and{bzl:obj}
python_register_multi_toolchains
macros or the {bzl:obj}python
bzlmod extension.
pip.parse.parse_all_requirements_files
attribute has been removed.See notes in the previous versions about what to do.
Other changes:
strip_prefix
field forzstd
archives.pip_parse.extra_hub_aliases
now works in WORKSPACE files.--bootstrap_impl=script
, a binary-specific (butotherwise empty) virtual env is used to customize
sys.path
initialization.{#v1-0-0-fixed}
Fixed
uname
to get the value of the host platform.files which is useful when including different PyTorch builds (e.g. <pytorch+cpu> vs <pytorch+cu118> ) for different target platforms.
Fixes (2337).
uv
binary for aarch64-apple-darwin.Fixes (2411).
--bootstrap_impl=scipt
) Usingsys.executable
willuse the same
sys.path
setup as the calling binary.(2169).
hardcoded in Bazel, WORKSPACE mode.
compile_pip_requirements
no longer fails on Windows when--enable_runfiles
is not enabled.compile_pip_requirements
now correctly updates files in the source tree on Windows when--windows_enable_symlinks
is not enabled.libpython
targetdefined by a repository template. This enables stable ABI builds of Python extensions
on Windows (by defining Py_LIMITED_API).
py_test
andpy_binary
targets no longer incorrectly remove thefirst
sys.path
entry when using {obj}--bootstrap_impl=script
{#v1-0-0-added}
Added
details can be logged by setting
RULES_PYTHON_GAZELLE_VERBOSE=1
.they would like to use through
RULES_PYTHON_REPO_TOOLCHAIN_{VERSION}_{OS}_{ARCH}
env variable setting. Forexample, this allows one to use
freethreaded
python interpreter in therepository_rule
to build a wheel fromsdist
.muslc
libc have been addedfor the latest toolchain versions for each minor Python version. You can control
the toolchain selection by using the
{bzl:obj}
//python/config_settings:py_linux_libc
build flag.py_runtime_info.site_init_template
and{obj}
PyRuntimeInfo.site_init_template
for specifying the template to use toinitialize the interpreter via venv startup hooks.
{#v1-0-0-removed}
Removed
pypi_install_dependencies
macro that has been included in{bzl:obj}
py_repositories
for a long time.DEFAULT_PYTHON_VERSION
frominterpreters.bzl
file. Ifyou need the version, please use it from the
versions.bzl
file instead.{#v0-40-0}
v0.40.0
Compare Source
{#v0-40-changed}
Changed
{#v0-40-fixed}
Fixed
(2414).
{#v0-40-added}
Added
{#v0-40-removed}
Removed
requirements.txt
for thetwine
dependencies.Please use
requirements_linux.txt
instead.zstd
support and remove attributesfor customizing the
zstd
binary to be used forzstd
archives in the{bzl:obj}
python_repository
repository_rule. This affects the{bzl:obj}
python_register_toolchains
and{bzl:obj}
python_register_multi_toolchains
callers in theWORKSPACE
.{#v0-39-0}
v0.39.0
Compare Source
{#v0-39-0-changed}
Changed
bzlmod
spoke repositories have changed asall of the given
requirements.txt
files are now parsed bydefault
, totemporarily restore the behavior, you can use
{bzl:obj}
pip.parse.extra_hub_aliases
, which will be removed or made noop inthe future.
{#v0-39-0-fixed}
Fixed
@bazel_tools//tools/python:autodetecting_toolchain
is being used(#2364).
{#v0-39-0-added}
Added
the config flag
//python/config_settings:py_freethreaded
to toggle theselection of the free-threaded toolchains.
py_runtime.abi_flags
attribute and{obj}
PyRuntimeInfo.abi_flags
field added.{#v0-39-0-removed}
Removed
{#v0-38-0}
v0.38.0
Compare Source
{#v0-38-0-changed}
Changed
version used; this for Bazel 8+ support (previously version was rules_cc 0.0.9
and no protobuf version specified)
(2310).
for the
twine
publishing rule.--no-build-isolation
to allow non-hermetic sdist buildsby default. Users wishing to keep this argument and to enforce more hermetic
builds can do so by passing the argument in
pip.parse#extra_pip_args
pip.parse.whl_modifications
now normalizes the given whl namesand now
pyyaml
andPyYAML
will both work.pip.parse
spoke repository naming will be changed in an upcomingrelease in places where the users specify different package versions per
platform in the same hub repository. The naming of the spoke repos is
considered an implementation detail and we advise the users to use the
hub
repository directly and make use of {bzl:obj}
pip.parse.extra_hub_aliases
feature added in this release.
{#v0-38-0-fixed}
Fixed
whl_library
s(617).
pip.parse.experimental_index_url
is set, we need to stillpass the
extra_pip_args
value when building ansdist
.which fixes usage of the said wheels using standard package managers.
same lock file irrespective if
experimental_index_url
is set by any moduleor not. To opt into this behavior, set
pip.parse.parse_all_requirements_files
, which will become thedefault in future releases leading up to
1.0.0
. Fixes#2268. A known
issue is that it may break
bazel query
and in these use cases it isadvisable to use
cquery
or switch todownload_only = True
{#v0-38-0-added}
Added
twine
publishing rules have beenupdated to have a new convention:
requirements_darwin.txt
,requirements_linux.txt
,requirements_windows.txt
for each respective OSand one extra file
requirements_universal.txt
if you prefer a single file.The
requirements.txt
file may be removed in the future.//python/features.bzl#features.version
pip.parse.extra_hub_aliases
can now be used to expose extratargets created by annotations in whl repositories.
Fixes #2187.
pip.parse
now supportswhl-only
setup usingdownload_only = True
where users can specify multiple requirements filesand use the
pip
backend to do the downloading. This was only available forusers setting {bzl:obj}
pip.parse.experimental_index_url
, but now users havemore options whilst we continue to work on stabilizing the experimental feature.
{#v0-37-2}
Configuration
📅 Schedule: Branch creation - "* 0-3 * * 1" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.