v1.2.0
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_py", version = "1.2.0")
And also register a Python toolchain, see rules_python. For example:
# Minimum version needs:
# feat: add interpreter_version_info to py_runtime by @mattem in #1671
bazel_dep(name = "rules_python", version = "0.29.0", dev_dependency = True)
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
configure_coverage_tool = True,
python_version = "3.11",
)
Using WORKSPACE
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_py",
sha256 = "0ca24365412239cc8242664f6c0efd210ede8bc7b8d2a306036ccaf5ba09d81e",
strip_prefix = "rules_py-1.2.0",
url = "https://github.com/aspect-build/rules_py/releases/download/v1.2.0/rules_py-v1.2.0.tar.gz",
)
# Fetches the rules_py dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_py//py:repositories.bzl", "rules_py_dependencies")
rules_py_dependencies()
load("@aspect_rules_py//py:toolchains.bzl", "rules_py_toolchains")
rules_py_toolchains()
# "Installation" for rules_python
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
python_register_toolchains(
name = "python_toolchain",
python_version = "3.9",
)
py_repositories()
What's Changed
- Fix py_test with nested target name by @keith in #485
- fix: propagate
target_compatible_with
to_py_env
when creating a … by @RoyShulman in #438 - chore: test on Bazel 8.0.0 by @alexeagle in #478
- fix: make py_binary#resolutions and py_test#resolutions identical. by @njlr in #487
- refactor(ci): re-enable testing against prior release artifacts by @alexeagle in #496
- Fix py_image_layers tar options by @betaboon in #494
- feat: add coverage output to py_pytest_main by @alexeagle in #492
- chore(deps): update dependency aspect_bazel_lib to v2.10.0 by @renovate in #482
- chore: Autoformat with buildifier by @hofbi in #480
- docs/example-pytest-fixtures by @njlr in #452
- ci: Add pre-commit GitHub action by @hofbi in #500
- chore: gitignore node_modules folder by @hofbi in #499
- docs: fix example of py_image_layer by @alexeagle in #491
- chore: report the coverage from the e2e/use_release test by @alexeagle in #498
- chore: build on aspect workflows by @kormide in #505
- chore: Add typos pre-commit hook by @hofbi in #503
New Contributors
- @RoyShulman made their first contribution in #438
- @njlr made their first contribution in #487
- @betaboon made their first contribution in #494
Full Changelog: v1.1.0...v1.2.0