• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("//python/config_settings:transition.bzl", "py_binary")
2load("//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")
3load("//tools/private:publish_deps.bzl", "publish_deps")
4
5py_console_script_binary(
6    name = "twine",
7    # We use a py_binary rule with version transitions to ensure that we do not
8    # rely on the default version of the registered python toolchain. What is more
9    # we are using this instead of `@python_versions//3.11:defs.bzl` because loading
10    # that file relies on bzlmod being enabled.
11    binary_rule = py_binary,
12    pkg = "@rules_python_publish_deps//twine",
13    python_version = "3.11",
14    script = "twine",
15    visibility = ["//visibility:public"],
16)
17
18filegroup(
19    name = "distribution",
20    srcs = [
21        "BUILD.bazel",
22        "requirements_darwin.txt",
23        "requirements_linux.txt",
24        "requirements_universal.txt",
25        "requirements_windows.txt",
26    ],
27    visibility = ["//tools:__subpackages__"],
28)
29
30# Run bazel run //private:requirements.update to update the outs
31publish_deps(
32    name = "requirements",
33    srcs = ["requirements.in"],
34    outs = {
35        "requirements_darwin.txt": "macos",
36        "requirements_linux.txt": "linux",
37        "requirements_universal.txt": "",  # universal
38        "requirements_windows.txt": "windows",
39    },
40    upgrade = True,
41    visibility = ["//private:__pkg__"],
42)
43