• Home
  • Raw
  • Download

Lines Matching +full:force +full:- +full:load +full:- +full:on +full:- +full:access

3 …ba7a1205955a45b53e854.svg?branch=main)](https://buildkite.com/bazel/python-rules-python-postsubmit)
7 This repository is the home of the core Python rules -- `py_library`,
19 …, the future-proof way to depend on Python rules is via this repository. See[`Migrating from the B…
22 [backward compatibility policy](https://docs.bazel.build/versions/master/backward-compatibility.htm…
26 …el releases. See [How to contribute](CONTRIBUTING.md) page for information on our development work…
30 - Status: Beta
31 - Full Feature Parity: No
53 Once added, you can load the rules and use them:
56 load("@rules_python//python:py_binary.bzl", "py_binary")
61 Depending on what you're doing, you likely want to do some additional
67 A default toolchain is automatically configured depending on
72 to do so depends on if you're configuring the root module or not. The root
74 is used by the version-unaware rules (e.g. `//python:py_binary.bzl` et al). For
75 submodules, it's recommended to use the version-aware rules to pin your programs
83 silently ignored if a submodule does it. Similarly, using the version-unaware
101 Pinning to a version allows targets to force that a specific Python version is
106 2. To allow incremental, per-target, upgrading to newer Python versions,
107 typically in a mono-repo situation.
109 To configure a submodule with the version-aware rules, request the particular
111 force specific versions:
122 Then use e.g. `load("@python_versions//3.11:defs.bzl", "py_binary")` to use
123 the rules that force that particular version. Multiple versions can be specified
142 To depend on a particular unreleased version, you can do the following:
145 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
158 strip_prefix = "rules_python-{}".format(VERSION),
159 …url = "https://github.com/bazelbuild/rules_python/releases/download/{}/rules_python-{}.tar.gz".for…
162 load("@rules_python//python:repositories.bzl", "py_repositories")
169 To register a hermetic Python toolchain rather than rely on a system-installed interpreter for runt…
172 load("@rules_python//python:repositories.bzl", "python_register_toolchains")
177 # We recommend using the same version your team is already standardized on.
181 load("@python_3_11//:defs.bzl", "interpreter")
183 load("@rules_python//python:pip.bzl", "pip_parse")
192 …n targets will use the toolchain's interpreter during execution, but a system-installed interpreter
194 … this toolchain. Please refer to [python-build-standalone documentation's _Quirks_ section](https:…
198 …)` and `$(PYTHON3)` ["Make" Variables](https://bazel.build/reference/be/make-variables). See the […
203 methods, you can then load the core rules in your `BUILD` files with the following:
206 load("@rules_python//python:defs.bzl", "py_binary")
218 1. [Installing third_party packages](#installing-third_party-packages)
219 2. [Using third_party packages as dependencies](#using-third_party-packages-as-dependencies
240 To add pip dependencies to your `WORKSPACE`, load the `pip_parse` function and call it to create th…
243 load("@rules_python//python:pip.bzl", "pip_parse")
251 # Load the starlark macro, which will define your dependencies.
252 load("@my_deps//:requirements.bzl", "install_deps")
259 Note that since `pip_parse` is a repository rule and therefore executes pip at WORKSPACE-evaluation…
270 re-executed to pick up a non-hermetic change to your environment (e.g.,
271 updating your system `python` interpreter), you can force it to re-execute by running
272 `bazel sync --only [pip_parse name]`.
276 …nts.txt` with a fully resolved set of dependencies using a tool such as `pip-tools` or the `compil…
281 the wheel's contents. There are two ways to access this library. The
287 load("@my_deps//:requirements.bzl", "requirement")
305 On the other hand, using `requirement()` has several drawbacks; see
306 [this issue][requirements-drawbacks] for an enumeration. If you don't
316 Bazel label names (e.g. `-`, `.`) replaced with `_`. If you need to
330 [requirements-drawbacks]: https://github.com/bazelbuild/rules_python/issues/414
338 If you need to depend on the wheel dists themselves, for instance, to pass them
351 [Gazelle](https://github.com/bazelbuild/bazel-gazelle)
360 The core rules are currently available in Bazel as built-in symbols, but this
361 form is deprecated. Instead, you should depend on rules_python in your
362 `WORKSPACE` file and load the Python rules from
367 appropriate `load()` statements and rewrite uses of `native.py_*`.
370 # Also consider using the -r flag to modify an entire workspace.
371 buildifier --lint=fix --warnings=native-py <files>
375 started](#Getting-started) above.
377 Note that Starlark-defined bundled symbols underneath