Lines Matching +full:- +full:python +full:- +full:pip
7 # http://www.apache.org/licenses/LICENSE-2.0
15 "pip module extension for use with bzlmod"
18 load("//python:pip.bzl", "whl_library_alias")
20 "//python/pip_install:pip_repository.bzl",
28 load("//python/pip_install:requirements_parser.bzl", parse_requirements = "parse")
29 load("//python/private:normalize_name.bzl", "normalize_name")
30 load("//python/private:version_label.bzl", "version_label")
33 """Implementation of the pip.whl_mods tag class.
91 "Unable to find interpreter for pip hub '{hub_name}' for " +
93 '`python.toolchain(python_version="{version}")` call exists'
163 …"""Implementation of a class tag that creates the pip hub(s) and corresponding pip spoke, alias an…
165 This implmentation iterates through all of the `pip.parse` calls and creates
166 different pip hub repositories based on the "hub_name". Each of the
167 pip calls create spoke repos that uses a specific Python interpreter.
171 pip.parse(
172 hub_name = "pip",
177 pip.parse(
178 hub_name = "pip",
184 For instance, we have a hub with the name of "pip".
186 all of the pip spokes are collected.
188 - @@rules_python~override~pip~pip
191 Two different pip.parse statements exist in MODULE.bazel provide the hub_name "pip".
192 These definitions create two different pip spoke repositories that are
193 related to the hub "pip".
194 One spoke uses Python 3.9 and the other uses Python 3.10. This code automatically
195 determines the Python version and the interpreter.
196 Both of these pip spokes contain requirements files that includes websocket
201 - @@rules_python~override~pip~pip_39
202 - @@rules_python~override~pip~pip_310
204 The different spoke names are a combination of the hub_name and the Python version.
208 We also need repositories for the wheels that the different pip spokes contain.
209 For each Python version a different wheel repository is created. In our example
210 each pip spoke had a requirments file that contained websockets. We
213 - @@rules_python~override~pip~pip_39_websockets
214 - @@rules_python~override~pip~pip_310_websockets
221 - @@rules_python~override~pip~pip_websockets
225 the Python version.
228 hubs pointing to various different pip spokes.
230 Some other business rules notes. A hub can only have one spoke per Python version. We cannot
231 have a hub named "pip" that has two spokes that use the Python 3.9 interpreter. Second
235 This implementation reuses elements of non-bzlmod code and also reuses the first implementation
236 of pip bzlmod, but adds the capability to have multiple pip.parse calls.
250 # Used to track all the different pip hubs and the spoke pip Python
255 # dict[hub, dict[whl, dict[version, str pip]]]
256 # Where hub, whl, and pip are the repo names
267 "Duplicate cross-module pip hub named '{hub}': pip hub " +
279 "Duplicate pip python version '{version}' for hub " +
280 "'{hub}' in module '{module}': the Python versions " +
305 # statements These select statements point to the different pip
306 # whls that are based on a specific version of Python.
314 # Create the hub repository for pip.
326 The name of the repo pip dependencies will be accessible from.
330 in the hub name. Repo mapping, `use_repo(..., pip="my_modules_pip_deps")`, can
333 Within a module, the same `hub_name` can be specified to group different Python
334 versions of pip dependencies under one repository name. This allows using a
335 Python version-agnostic name when referring to pip dependencies; the
338 Typically, a module will only have a single hub of pip dependencies, but this
339 is not required. Each hub is a separate resolution of pip dependencies. This
348 The Python version to use for resolving the pip dependencies, in Major.Minor
350 If not specified, then the default Python version (as set by the root module or
353 The version specified here must have a corresponding `python.toolchain()`
410 pip.parse. If you have different pip hubs you can use a different name,
431 pip = module_extension(
433 This extension is used to make dependencies from pip available.
435 pip.parse:
436 To use, call `pip.parse()` and specify `hub_name` and your requirements file.
440 Each `pip.parse()` call configures a particular Python version. Multiple calls
441 can be made to configure different Python versions, and will be grouped by
442 the `hub_name` argument. This allows the same logical name, e.g. `@pip//numpy`
443 to automatically resolve to different, Python version-specific, libraries.
445 pip.whl_mods:
454 This tag class is used to create a pip hub and all of the spokes that are part of that hub.
455 This tag class reuses most of the pip attributes that are found in
456 @rules_python//python/pip_install:pip_repository.bzl.