Skip to content

Commit b8b9092

Browse files
kormidealexeagle
authored andcommitted
Prepare for bzlmod release
1 parent af354c2 commit b8b9092

File tree

5 files changed

+72
-1
lines changed

5 files changed

+72
-1
lines changed

.bcr/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fixedReleaser:
2+
login: rickeylev
3+

.bcr/presubmit.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
bcr_test_module:
2+
module_path: "examples/bzlmod"
3+
matrix:
4+
platform: ["debian10", "macos", "ubuntu2004", "windows"]
5+
tasks:
6+
run_tests:
7+
name: "Run test module"
8+
platform: ${{ platform }}
9+
test_targets:
10+
- "//..."

.bcr/source.template.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"integrity": "",
3+
"strip_prefix": "{REPO}-{VERSION}",
4+
"url": "https://github.com/{OWNER}/{REPO}/archive/refs/tags/{TAG}.tar.gz"
5+
}

.bcr/template.metadata.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"homepage": "https://github.com/bazelbuild/rules_python",
3+
"maintainers": [
4+
{
5+
"name": "Richard Levasseur",
6+
"email": "[email protected]",
7+
"github": "rickeylev"
8+
},
9+
{
10+
"name": "Thulio Ferraz Assis",
11+
"email": "[email protected]",
12+
"github": "f0rmiga"
13+
}
14+
],
15+
"repository": [
16+
"github:bazelbuild/rules_python"
17+
],
18+
"versions": [],
19+
"yanked_versions": {}
20+
}

.github/workflows/workspace_snippet.sh

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,40 @@ PREFIX="rules_python-${TAG}"
99
SHA=$(git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip | shasum -a 256 | awk '{print $1}')
1010

1111
cat << EOF
12-
WORKSPACE setup:
12+
## Using Bzlmod with Bazel 6
13+
14+
Add to your \`MODULE.bazel\` file:
15+
16+
\`\`\`starlark
17+
bazel_dep(name = "rules_python", version = "${TAG}")
18+
19+
pip = use_extension("@rules_python//python:extensions.bzl", "pip")
20+
21+
pip.parse(
22+
name = "pip",
23+
requirements_lock = "//:requirements_lock.txt",
24+
)
25+
26+
use_repo(pip, "pip")
27+
28+
# (Optional) Register a specific python toolchain instead of using the host version
29+
python = use_extension("@rules_python//python:extensions.bzl", "python")
30+
31+
python.toolchain(
32+
name = "python3_9",
33+
python_version = "3.9",
34+
)
35+
36+
use_repo(python, "python3_9_toolchains")
37+
38+
register_toolchains(
39+
"@python3_9_toolchains//:all",
40+
)
41+
\`\`\`
42+
43+
## Using WORKSPACE:
44+
45+
Paste this snippet into your \`WORKSPACE\` file:
1346
1447
\`\`\`starlark
1548
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

0 commit comments

Comments
 (0)