Prepare for bzlmod release
diff --git a/.bcr/config.yml b/.bcr/config.yml new file mode 100644 index 0000000..ac951f6 --- /dev/null +++ b/.bcr/config.yml
@@ -0,0 +1,3 @@ +fixedReleaser: + login: rickeylev + email: rlevasseur@google.com
diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml new file mode 100644 index 0000000..2ab3c6d --- /dev/null +++ b/.bcr/presubmit.yml
@@ -0,0 +1,10 @@ +bcr_test_module: + module_path: "examples/bzlmod" + matrix: + platform: ["debian10", "macos", "ubuntu2004", "windows"] + tasks: + run_tests: + name: "Run test module" + platform: ${{ platform }} + test_targets: + - "//..."
diff --git a/.bcr/source.template.json b/.bcr/source.template.json new file mode 100644 index 0000000..a3bd62f --- /dev/null +++ b/.bcr/source.template.json
@@ -0,0 +1,5 @@ +{ + "integrity": "", + "strip_prefix": "{REPO}-{VERSION}", + "url": "https://github.com/{OWNER}/{REPO}/archive/refs/tags/{TAG}.tar.gz" +}
diff --git a/.bcr/template.metadata.json b/.bcr/template.metadata.json new file mode 100644 index 0000000..7b16b53 --- /dev/null +++ b/.bcr/template.metadata.json
@@ -0,0 +1,20 @@ +{ + "homepage": "https://github.com/bazelbuild/rules_python", + "maintainers": [ + { + "name": "Richard Levasseur", + "email": "rlevasseur@google.com", + "github": "rickeylev" + }, + { + "name": "Thulio Ferraz Assis", + "email": "thulio@aspect.dev", + "github": "f0rmiga" + } + ], + "repository": [ + "github:bazelbuild/rules_python" + ], + "versions": [], + "yanked_versions": {} +}
diff --git a/.github/workflows/workspace_snippet.sh b/.github/workflows/workspace_snippet.sh index 6fdaad3..9a51d06 100755 --- a/.github/workflows/workspace_snippet.sh +++ b/.github/workflows/workspace_snippet.sh
@@ -9,7 +9,40 @@ SHA=$(git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip | shasum -a 256 | awk '{print $1}') cat << EOF -WORKSPACE setup: +## Using Bzlmod with Bazel 6 + +Add to your \`MODULE.bazel\` file: + +\`\`\`starlark +bazel_dep(name = "rules_python", version = "${TAG}") + +pip = use_extension("@rules_python//python:extensions.bzl", "pip") + +pip.parse( + name = "pip", + requirements_lock = "//:requirements_lock.txt", +) + +use_repo(pip, "pip") + +# (Optional) Register a specific python toolchain instead of using the host version +python = use_extension("@rules_python//python:extensions.bzl", "python") + +python.toolchain( + name = "python3_9", + python_version = "3.9", +) + +use_repo(python, "python3_9_toolchains") + +register_toolchains( + "@python3_9_toolchains//:all", +) +\`\`\` + +## Using WORKSPACE: + +Paste this snippet into your \`WORKSPACE\` file: \`\`\`starlark load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")