build(python): simplify rpycdec vendor layout
This commit was merged in pull request #17.
This commit is contained in:
7
third_party/python/BUILD.bazel
vendored
7
third_party/python/BUILD.bazel
vendored
@@ -1,10 +1,11 @@
|
|||||||
load("@rules_python//python:defs.bzl", "py_binary")
|
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
|
||||||
|
|
||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
alias(
|
py_library(
|
||||||
name = "rpycdec",
|
name = "rpycdec",
|
||||||
actual = "//third_party/python/rpycdec-0.1.13+489e9c6:rpycdec",
|
srcs = glob(["rpycdec/src/**/*.py"]),
|
||||||
|
imports = ["rpycdec/src"],
|
||||||
)
|
)
|
||||||
|
|
||||||
py_binary(
|
py_binary(
|
||||||
|
|||||||
13
third_party/python/README.md
vendored
13
third_party/python/README.md
vendored
@@ -3,26 +3,25 @@
|
|||||||
This package exposes vendored Python dependencies through stable public Bazel targets.
|
This package exposes vendored Python dependencies through stable public Bazel targets.
|
||||||
Bazel uses `PYTHON_TOOLCHAIN_ROOT` to find the monorepo `python3` runtime.
|
Bazel uses `PYTHON_TOOLCHAIN_ROOT` to find the monorepo `python3` runtime.
|
||||||
|
|
||||||
Project code depends on aliases in `//third_party/python`.
|
Project code depends on targets in `//third_party/python`.
|
||||||
It does not depend on versioned package directories directly.
|
It does not depend on files inside vendored source directories directly.
|
||||||
|
|
||||||
Use this layout for a vendored package:
|
Use this layout for a vendored package:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
third_party/python/
|
third_party/python/
|
||||||
BUILD.bazel
|
BUILD.bazel
|
||||||
<name>-<version>/
|
<name>/
|
||||||
BUILD.bazel
|
|
||||||
LICENSE
|
LICENSE
|
||||||
pyproject.toml
|
pyproject.toml
|
||||||
src/
|
src/
|
||||||
```
|
```
|
||||||
|
|
||||||
Use the upstream package name for public aliases.
|
Use the upstream package name for library targets.
|
||||||
For command-line tools, add a `_bin` suffix to the binary target.
|
For command-line tools, add a `_bin` suffix to the binary target.
|
||||||
|
|
||||||
Preserve upstream license files and package metadata.
|
Preserve upstream license files and package metadata.
|
||||||
Keep repository Bazel files separate from upstream source when possible.
|
Keep repository Bazel files outside upstream source when possible.
|
||||||
|
|
||||||
Add optional dependencies as separate public targets.
|
Add optional dependencies as separate public targets.
|
||||||
Do not bundle optional dependencies into the primary package target.
|
Do not bundle optional dependencies into the primary package target.
|
||||||
@@ -34,7 +33,7 @@ Ariadne uses the game-bundled Ren'Py runtime for AST export.
|
|||||||
|
|
||||||
The vendored source comes from `cnfatal/rpycdec` at commit `489e9c6b8a48ed7904d7039d7787c36a03c75fe3`.
|
The vendored source comes from `cnfatal/rpycdec` at commit `489e9c6b8a48ed7904d7039d7787c36a03c75fe3`.
|
||||||
|
|
||||||
The intended public targets are:
|
The public targets are:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
//third_party/python:rpycdec
|
//third_party/python:rpycdec
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
load("@rules_python//python:defs.bzl", "py_library")
|
|
||||||
|
|
||||||
package(default_visibility = ["//third_party/python:__pkg__"])
|
|
||||||
|
|
||||||
py_library(
|
|
||||||
name = "rpycdec",
|
|
||||||
srcs = glob(["src/**/*.py"]),
|
|
||||||
imports = ["src"],
|
|
||||||
)
|
|
||||||
Reference in New Issue
Block a user