v1.6.4
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel file:
bazel_dep(name = "aspect_rules_py", version = "1.6.4")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 = "6db8959662f743d9c31b6ed4c71df5b6d047407007c5256e70d56105ff487ff9",
strip_prefix = "rules_py-1.6.4",
url = "https://github.com/aspect-build/rules_py/releases/download/v1.6.4/rules_py-v1.6.4.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: don't use version 0.0.0 by @alexeagle in #626
- feat(py_venv): activate-less interpreter by @arrdem in #629
- fix(pytest): Correct starlark deps by @mgred in #637
- feat(py_venv): Replace untennable copying with symlinks by @arrdem in #644
- Fix bug in
py_venvwhen using non runfiles python interpreter by @kriscfoster in #653 - Implement env/env_inherit semantics for py_venv_binary/py_venv_test by @plobsing in #616
- chore(rules_rust): Use compile_data by @arrdem in #656
- chore(py_venv): Cherry pick in tests from #635 by @arrdem in #657
- chore(ci): Automate pre-commit runs by @arrdem in #585
- fix(py_venv): Carefully resolve executable name to identify runfiles by @arrdem in #654
- feat(pex): support building PEX archives to inherit from the sys.path by @plobsing in #619
- fix(module): Avoid subrepo use by @arrdem in #658
New Contributors
- @mgred made their first contribution in #637
- @kriscfoster made their first contribution in #653
Full Changelog: v1.6.3...v1.6.4