commit | ea956ae20bac5be1e9917faabdcac3cab2965c12 | [log] [tgz] |
---|---|---|
author | brandjon <brandjon@google.com> | Thu Feb 07 13:56:27 2019 -0800 |
committer | Copybara-Service <copybara-piper@google.com> | Thu Feb 07 13:58:15 2019 -0800 |
tree | 5cf635c2636961ce94f4bd560d1338119d6aca3e | |
parent | 539bfc9870d26ab44c4912e65c08c0cc285f7d8b [diff] |
Add `--incompatible_py3_is_default` to change `py_binary` and `py_test`'s default version When this flag is enabled, `py_binary` and `py_test` targets that do not specify a version (by setting the `python_version` attribute, or its deprecated alias `default_python_version`) will default to `PY3` instead of `PY2`. In addition, the host configuration will use `PY3`, unless `--host_force_python=PY2` is set to override it. The flag requires the new version semantics (`--incompatible_allow_python_version_transitions=true`), and will fail the build if it is not set. The flag is implemented by eliminating PythonVersion#DEFAULT_TARGET_VALUE and replacing it with an accessor PythonOptions#getDefaultPythonVersion. For the case of rule transition factories in rule definitions, which previously relied on DEFAULT_TARGET_VALUE and which do not have access to a configuration, they are updated to instead pass a callback function that retrieves the default version from the configuration at the time of the transition. Work toward #6647, #7359. RELNOTES[INC]: Added --incompatible_py3_is_default to test switching the default Python version to PY3 for py_binary/py_test targets that do not specify a version. See #7359. PiperOrigin-RevId: 232939284
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel only rebuilds what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md
Bazel is released in ‘Beta’. See the product roadmap to learn about the path toward a stable 1.0 release.