Skip to content

Commit 657d0db

Browse files
committed
Merge branch 'main' into aignas.chore.cleanup-legacy-pip-code-2
2 parents c94f2fa + 2e8aa91 commit 657d0db

80 files changed

Lines changed: 693 additions & 107 deletions

File tree

Some content is hidden

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

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ sphinxdocs
3333
tests/integration/compile_pip_requirements/bazel-compile_pip_requirements
3434
tests/integration/local_toolchains/bazel-local_toolchains
3535
tests/integration/py_cc_toolchain_registered/bazel-py_cc_toolchain_registered
36+
tests/integration/toolchain_target_settings/bazel-module_under_test

.bazelrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ common --incompatible_disallow_struct_provider_syntax
2525
# Makes Bazel 7 act more like Bazel 8
2626
common --incompatible_use_plus_in_repo_names
2727

28+
# Implicitly adds --config=linux|macos|windows, depending on the host platform
29+
common --enable_platform_specific_config
30+
2831
# Needed to make Windows with a py_binary in data deps work. The Bazel launcher
2932
# is used, which falls back to finding python.exe on PATH to bootstrap.
3033
# See https://github.com/bazel-contrib/rules_python/issues/3655
@@ -55,6 +58,20 @@ common --incompatible_no_implicit_file_export
5558

5659
build --lockfile_mode=update
5760

61+
# Silence spammy C++ compile warnings
62+
build:linux --copt=-Wno-deprecated-declarations
63+
build:linux --copt=-Wno-stringop-overread
64+
build:linux --copt=-Wno-sign-compare
65+
build:linux --host_copt=-Wno-deprecated-declarations
66+
build:linux --host_copt=-Wno-stringop-overread
67+
build:linux --host_copt=-Wno-sign-compare
68+
build:macos --copt=-Wno-deprecated-declarations
69+
build:macos --copt=-Wno-stringop-overread
70+
build:macos --copt=-Wno-sign-compare
71+
build:macos --host_copt=-Wno-deprecated-declarations
72+
build:macos --host_copt=-Wno-stringop-overread
73+
build:macos --host_copt=-Wno-sign-compare
74+
5875
import %workspace%/specialized_configs.bazelrc
5976

6077
try-import user.bazelrc

.bazelrc.deleted_packages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ common --deleted_packages=tests/integration/local_toolchains
3636
common --deleted_packages=tests/integration/pip_parse
3737
common --deleted_packages=tests/integration/pip_parse/empty
3838
common --deleted_packages=tests/integration/py_cc_toolchain_registered
39+
common --deleted_packages=tests/integration/toolchain_target_settings
3940
common --deleted_packages=tests/modules/another_module
4041
common --deleted_packages=tests/modules/other
4142
common --deleted_packages=tests/modules/other/nspkg_delta

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
/examples/build_file_generation/ @dougthor42 @aignas
88

99
# PyPI integration related code
10-
/python/private/pypi/ @rickeylev @aignas @groodt
11-
/tests/pypi/ @rickeylev @aignas @groodt
10+
/python/private/pypi/ @rickeylev @aignas
11+
/tests/pypi/ @rickeylev @aignas

AGENTS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ project.
55

66
Act as an expert in Bazel, rules_python, Starlark, and Python.
77

8-
DO NOT `git commit` or `git push`.
8+
DO NOT `git commit` or `git push` unless given explicit permission.
99

1010
## RULES TO ALWAYS FOLLOW AND NEVER IGNORE
1111

@@ -30,6 +30,11 @@ into the sentence, not verbatim.
3030
When adding `{versionadded}` or `{versionchanged}` sections, add them add the
3131
end of the documentation text.
3232

33+
### PR descriptions
34+
35+
Follow the advice in `CONTRIBUTING.md` for PR descriptions. PR descriptions
36+
become the commit message upon merge.
37+
3338
### Starlark style
3439

3540
For doc strings, using triple quoted strings when the doc string is more than

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,24 @@ END_UNRELEASED_TEMPLATE
6060
### Changed
6161
* (gazelle) WORKSPACE's bazel-gazelle dependency bumped from 0.36.0 to 0.47.0.
6262
The go version was also bumped from 1.21.13 to 1.22.9.
63+
* (pypi) The data files of a wheel (bin, includes, etc) are now always included
64+
as a library's data dependencies.
6365

6466
{#v0-0-0-fixed}
6567
### Fixed
6668
* (gazelle) Fixed handling of auto-included `__init__.py` files when generating `py_binary`
6769
targets ([#3729](https://github.com/bazel-contrib/rules_python/issues/3729)).
70+
* (entry_point) From now on `mypy` type checking will be skipped on the generated
71+
files ([#3126](https://github.com/bazel-contrib/rules_python/issues/3126)).
6872

6973
{#v0-0-0-added}
7074
### Added
75+
* (toolchain) Added {obj}`python.override.toolchain_target_settings` to allow
76+
adding `config_setting` labels to all registered toolchains.
7177
* (windows) Full venv support for Windows is available. Set
7278
{obj}`--venvs_site_packages=yes` to enable.
79+
* (test/binaries) When {obj}`--venv_site_packages=yes` is enabled,
80+
wheel `data`, `bin`, and `include` files are populated into the venv.
7381
* (runfiles) Added a pathlib-compatible API: {obj}`Runfiles.root()`
7482
Fixes [#3296](https://github.com/bazel-contrib/rules_python/issues/3296).
7583
* (toolchains) `3.13.12`, `3.14.3` Python toolchain from [20260325] release.

CONTRIBUTING.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ information on using pull requests.
103103

104104
[GitHub Help]: https://help.github.com/articles/about-pull-requests/
105105

106-
### Commit messages
106+
### Commit messages and PR descriptions
107107

108108
Commit messages (upon merging) and PR messages should follow the [Conventional
109109
Commits](https://www.conventionalcommits.org/) style:
@@ -139,9 +139,36 @@ Common `type`s:
139139
* `revert:` means a prior change is being reverted in some way.
140140
* `test:` means only tests are being added.
141141

142+
For the body, follow this guidance:
143+
144+
* Briefly tells *why* the change is being made. This usually means
145+
briefly describing how a bug manifests or what can't be accomplished
146+
without the feature.
147+
* Briefly gives an overview of *how* the code is changed. This is to
148+
orient readers for the diff they're about to read and understand; it's
149+
not a verbatim description of what changed.
150+
* List unrelated or notable dev-only changes at the end. e.g. formatting an
151+
old file, cleaning up testing, adding test support code, etc.
152+
142153
For the full details of types, see
143154
[Conventional Commits](https://www.conventionalcommits.org/).
144155

156+
#### PR description example
157+
158+
```
159+
fix(pypi): handle files with .exe extensions
160+
161+
Currently, if a file with `.exe` is seen, an error
162+
occurs because validation assumes unix-only filenames.
163+
This prevents using whls with pre-built .exe files in
164+
their data payload.
165+
166+
To fix, detect the target OS and use an OS-appropriate
167+
validation function.
168+
169+
* Also adds test helpers for detecting the current OS
170+
```
171+
145172
### Documenting changes
146173

147174
Changes are documented in two places: CHANGELOG.md and API docs.

MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ use_repo(
247247
"somepkg_with_build_files",
248248
"whl_library_extras_direct_dep",
249249
"whl_with_build_files",
250+
"whl_with_data1",
251+
"whl_with_data2",
250252
)
251253

252254
dev_rules_python_config = use_extension(

docs/environment-variables.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,14 @@ os, arch values are the same as the ones mentioned in the
148148

149149
When `1`, debug information about coverage behavior is printed to stderr.
150150
:::
151+
152+
## Removed Environment Variables
153+
154+
:::{versionremoved} VERSION_NEXT_FEATURE
155+
The following environment variables were removed:
156+
157+
* `RULES_PYTHON_ENABLE_PYSTAR`: Used to enable the Starlark implementation of
158+
core rules.
159+
* `RULES_PYTHON_ENABLE_PIPSTAR`: Used to enable the Starlark implementation of
160+
PyPI integration.
161+
:::

examples/pip_parse/pip_parse_test.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ def test_data(self):
5252
self.assertIsNotNone(actual)
5353
actual = self._remove_leading_dirs(actual.split(" "))
5454

55-
self.assertListEqual(
56-
actual,
57-
[
58-
"data/share/doc/packages/s3cmd/INSTALL.md",
59-
"data/share/doc/packages/s3cmd/LICENSE",
60-
"data/share/doc/packages/s3cmd/NEWS",
61-
"data/share/doc/packages/s3cmd/README.md",
62-
"data/share/man/man1/s3cmd.1",
63-
],
64-
)
55+
expected = [
56+
"bin/s3cmd",
57+
"data/share/doc/packages/s3cmd/INSTALL.md",
58+
"data/share/doc/packages/s3cmd/LICENSE",
59+
"data/share/doc/packages/s3cmd/NEWS",
60+
"data/share/doc/packages/s3cmd/README.md",
61+
"data/share/man/man1/s3cmd.1",
62+
]
63+
64+
self.assertListEqual(actual, expected)
6565

6666
def test_dist_info(self):
6767
actual = os.environ.get("WHEEL_DIST_INFO_CONTENTS")

0 commit comments

Comments
 (0)