Skip to content

Commit 18825a9

Browse files
authored
Merge branch 'main' into update-doubelstar
2 parents 5ad0d97 + 4910961 commit 18825a9

File tree

175 files changed

+5033
-2752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+5033
-2752
lines changed

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ examples/bzlmod/other_module/bazel-bin
1818
examples/bzlmod/other_module/bazel-other_module
1919
examples/bzlmod/other_module/bazel-out
2020
examples/bzlmod/other_module/bazel-testlogs
21+
examples/bzlmod/py_proto_library/foo_external
2122
examples/bzlmod_build_file_generation/bazel-bzlmod_build_file_generation
2223
examples/multi_python_versions/bazel-multi_python_versions
2324
examples/pip_parse/bazel-pip_parse

.github/workflows/create_archive_and_notes.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515

1616
set -o errexit -o nounset -o pipefail
1717

18+
# Exclude dot directories, specifically, this file so that we don't
19+
# find the substring we're looking for in our own file.
20+
# Exclude CONTRIBUTING.md because it documents how to use these strings.
21+
if grep --exclude=CONTRIBUTING.md --exclude-dir=.* VERSION_NEXT_ -r; then
22+
echo
23+
echo "Found VERSION_NEXT markers indicating version needs to be specified"
24+
exit 1
25+
fi
26+
1827
# Set by GH actions, see
1928
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
2029
TAG=${GITHUB_REF_NAME}
@@ -28,22 +37,28 @@ cat > release_notes.txt << EOF
2837
2938
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
3039
40+
For the user-facing changelog see [here](https://rules-python.readthedocs.io/en/latest/changelog.html#v${TAG//./-})
41+
3142
## Using Bzlmod
3243
3344
Add to your \`MODULE.bazel\` file:
3445
3546
\`\`\`starlark
3647
bazel_dep(name = "rules_python", version = "${TAG}")
3748
38-
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
49+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
50+
python.toolchain(
51+
python_version = "3.13",
52+
)
3953
54+
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
4055
pip.parse(
41-
hub_name = "pip",
42-
python_version = "3.11",
56+
hub_name = "pypi",
57+
python_version = "3.13",
4358
requirements_lock = "//:requirements_lock.txt",
4459
)
4560
46-
use_repo(pip, "pip")
61+
use_repo(pip, "pypi")
4762
\`\`\`
4863
4964
## Using WORKSPACE

.github/workflows/mypy.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ jobs:
2222
- uses: jpetrucciani/mypy-check@master
2323
with:
2424
requirements: 1.6.0
25-
python_version: 3.8
25+
python_version: 3.9
2626
path: 'python/runfiles'
2727
- uses: jpetrucciani/mypy-check@master
2828
with:
2929
requirements: 1.6.0
30-
python_version: 3.8
30+
python_version: 3.9
3131
path: 'tests/runfiles'
32-

CHANGELOG.md

Lines changed: 136 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# rules_python Changelog
55

66
This is a human-friendly changelog in a keepachangelog.com style format.
7-
Because this changelog is for end-user consumption of meaningful changes,only
7+
Because this changelog is for end-user consumption of meaningful changes, only
88
a summary of a release's changes is described. This means every commit is not
99
necessarily mentioned, and internal refactors or code cleanups are omitted
1010
unless they're particularly notable.
@@ -52,12 +52,113 @@ Unreleased changes template.
5252

5353
{#v0-0-0-changed}
5454
### Changed
55+
* (deps) platforms 0.0.4 -> 0.0.11
56+
* (py_wheel) Package `py_library.pyi_srcs` (`.pyi` files) in the wheel.
57+
* (py_package) Package `py_library.pyi_srcs` (`.pyi` files) in `py_package`.
58+
59+
{#v0-0-0-fixed}
60+
### Fixed
61+
* (pypi) The `ppc64le` is now pointing to the right target in the `platforms` package.
62+
* (gazelle) No longer incorrectly merge `py_binary` targets during partial updates in
63+
`file` generation mode. Fixed in [#2619](https://github.com/bazelbuild/rules_python/pull/2619).
64+
* (bzlmod) Running as root is no longer an error. `ignore_root_user_error=True`
65+
is now the default. Note that running as root may still cause spurious
66+
Bazel cache invalidation
67+
([#1169](https://github.com/bazelbuild/rules_python/issues/1169)).
68+
* (gazelle) Don't collapse depsets to a list or into args when generating the modules mapping file.
69+
Support spilling modules mapping args into a params file.
70+
* (pypi) From now on `python` invocations in repository and module extension
71+
evaluation contexts will invoke Python interpreter with `-B` to avoid
72+
creating `.pyc` files.
73+
* (deps) doublestar 4.7.1 (required for recent Gazelle versions)
74+
75+
{#v0-0-0-added}
76+
### Added
77+
* {obj}`//python/bin:python`: convenience target for directly running an
78+
interpreter. {obj}`--//python/bin:python_src` can be used to specify a
79+
binary whose interpreter to use.
80+
81+
{#v0-0-0-removed}
82+
### Removed
83+
* Nothing removed.
84+
85+
{#v1-2-0}
86+
## [1.2.0] - 2025-02-21
87+
88+
[1.2.0]: https://github.com/bazelbuild/rules_python/releases/tag/1.2.0
89+
90+
{#v1-2-0-changed}
91+
### Changed
92+
* (rules) `py_proto_library` is deprecated in favour of the
93+
implementation in https://github.com/protocolbuffers/protobuf. It will be
94+
removed in the future release.
95+
* (pypi) {obj}`pip.override` will now be ignored instead of raising an error,
96+
fixes [#2550](https://github.com/bazelbuild/rules_python/issues/2550).
97+
* (rules) deprecation warnings for deprecated symbols have been turned off by
98+
default for now and can be enabled with `RULES_PYTHON_DEPRECATION_WARNINGS`
99+
env var.
100+
* (pypi) Downgraded versions of packages: `pip` from `24.3.2` to `24.0.0` and
101+
`packaging` from `24.2` to `24.0`.
102+
103+
{#v1-2-0-fixed}
104+
### Fixed
105+
* (rules) `python_zip_file` output with `--bootstrap_impl=script` works again
106+
([#2596](https://github.com/bazelbuild/rules_python/issues/2596)).
107+
* (docs) Using `python_version` attribute for specifying python versions introduced in `v1.1.0`
108+
* (gazelle) Providing multiple input requirements files to `gazelle_python_manifest` now works correctly.
109+
* (pypi) Handle trailing slashes in pip index URLs in environment variables,
110+
fixes [#2554](https://github.com/bazelbuild/rules_python/issues/2554).
111+
* (runfiles) Runfile manifest and repository mapping files are now interpreted
112+
as UTF-8 on all platforms.
113+
* (coverage) Coverage with `--bootstrap_impl=script` is fixed
114+
([#2572](https://github.com/bazelbuild/rules_python/issues/2572)).
115+
* (pypi) Non deterministic behaviour in requirement file usage has been fixed
116+
by reverting [#2514](https://github.com/bazelbuild/rules_python/pull/2514).
117+
The related issue is [#908](https://github.com/bazelbuild/rules_python/issue/908).
118+
* (sphinxdocs) Do not crash when `tag_class` does not have a populated `doc` value.
119+
Fixes ([#2579](https://github.com/bazelbuild/rules_python/issues/2579)).
120+
* (binaries/tests) Fix packaging when using `--bootstrap_impl=script`: set
121+
{obj}`--venvs_use_declare_symlink=no` to have it not create symlinks at
122+
build time (they will be created at runtime instead).
123+
(Fixes [#2489](https://github.com/bazelbuild/rules_python/issues/2489))
124+
125+
{#v1-2-0-added}
126+
### Added
127+
* Nothing added.
128+
129+
{#v1-2-0-removed}
130+
### Removed
131+
* Nothing removed.
132+
133+
{#v1-1-0}
134+
## [1.1.0] - 2025-01-07
135+
136+
[1.1.0]: https://github.com/bazelbuild/rules_python/releases/tag/1.1.0
137+
138+
{#v1-1-0-changed}
139+
### Changed
140+
* (toolchains) 3.13 means 3.13.1 (previously 3.13.0)
55141
* Bazel 6 support is dropped and Bazel 7.4.1 is the minimum supported
56142
version, per our Bazel support matrix. Earlier versions are not
57143
tested by CI, so functionality cannot be guaranteed.
58-
* (deps) doublestar 4.7.1 (required for recent Gazelle versions)
59-
60-
{#v0-0-0-fixed}
144+
* ({bzl:obj}`pip.parse`) From now we will make fewer calls to indexes when
145+
fetching the metadata from SimpleAPI. The calls will be done in parallel to
146+
each index separately, so the extension evaluation time might slow down if
147+
not using {bzl:obj}`pip.parse.experimental_index_url_overrides`.
148+
* ({bzl:obj}`pip.parse`) Only query SimpleAPI for packages that have
149+
sha values in the `requirements.txt` file.
150+
* (rules) The version-aware rules have been folded into the base rules and
151+
the version-aware rules are now simply aliases for the base rules. The
152+
`python_version` attribute is still used to specify the Python version.
153+
* (pypi) Updated versions of packages: `pip` to 24.3.1 and
154+
`packaging` to 24.2.
155+
156+
{#v1-1-0-deprecations}
157+
#### Deprecations
158+
* `//python/config_settings:transitions.bzl` and its `py_binary` and `py_test`
159+
wrappers are deprecated. Use the regular rules instead.
160+
161+
{#v1-1-0-fixed}
61162
### Fixed
62163
* (py_wheel) Use the default shell environment when building wheels to allow
63164
toolchains that search PATH to be used for the wheel builder tool.
@@ -71,10 +172,22 @@ Unreleased changes template.
71172
* (pypi) Using {bzl:obj}`pip_parse.experimental_requirement_cycles` and
72173
{bzl:obj}`pip_parse.use_hub_alias_dependencies` together now works when
73174
using WORKSPACE files.
175+
* (pypi) The error messages when the wheel distributions do not match anything
176+
are now printing more details and include the currently active flag
177+
values. Fixes [#2466](https://github.com/bazelbuild/rules_python/issues/2466).
178+
* (py_proto_library) Fix import paths in Bazel 8.
179+
* (whl_library) Now the changes to the dependencies are correctly tracked when
180+
PyPI packages used in {bzl:obj}`whl_library` during the `repository_rule` phase
181+
change. Fixes [#2468](https://github.com/bazelbuild/rules_python/issues/2468).
182+
+ (gazelle) Gazelle no longer ignores `setup.py` files by default. To restore
183+
this behavior, apply the `# gazelle:python_ignore_files setup.py` directive.
184+
* Don't re-fetch whl_library, python_repository, etc. repository rules
185+
whenever `PATH` changes. Fixes
186+
[#2551](https://github.com/bazelbuild/rules_python/issues/2551).
74187

75188
[pep-695]: https://peps.python.org/pep-0695/
76189

77-
{#v0-0-0-added}
190+
{#v1-1-0-added}
78191
### Added
79192
* (gazelle) Added `include_stub_packages` flag to `modules_mapping`. When set to `True`, this
80193
automatically includes corresponding stub packages for third-party libraries
@@ -85,8 +198,24 @@ Unreleased changes template.
85198
To select the free-threaded interpreter in the repo phase, please use
86199
the documented [env](/environment-variables.html) variables.
87200
Fixes [#2386](https://github.com/bazelbuild/rules_python/issues/2386).
88-
89-
{#v0-0-0-removed}
201+
* (toolchains) Use the latest astrahl-sh toolchain release [20241206] for Python versions:
202+
* 3.9.21
203+
* 3.10.16
204+
* 3.11.11
205+
* 3.12.8
206+
* 3.13.1
207+
* (rules) Attributes for type definition files (`.pyi` files) and type-checking
208+
only dependencies added. See {obj}`py_library.pyi_srcs` and
209+
`py_library.pyi_deps` (and the same named attributes for `py_binary` and
210+
`py_test`).
211+
* (pypi) pypi-generated targets set `pyi_srcs` to include `*.pyi` files.
212+
* (providers) {obj}`PyInfo` has new fields to aid static analysis tools:
213+
{obj}`direct_original_sources`, {obj}`direct_pyi_files`,
214+
{obj}`transitive_original_sources`, {obj}`transitive_pyi_files`.
215+
216+
[20241206]: https://github.com/astral-sh/python-build-standalone/releases/tag/20241206
217+
218+
{#v1-1-0-removed}
90219
### Removed
91220
* `find_requirements` in `//python:defs.bzl` has been removed.
92221

0 commit comments

Comments
 (0)