Releases: bazel-contrib/rules_python
Releases · bazel-contrib/rules_python
0.15.1
Using Bzlmod with Bazel 6
Add to your MODULE.bazel
file:
bazel_dep(name = "rules_python", version = "0.15.1")
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:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)
http_archive(
name = "rules_python",
sha256 = "bc4e59e17c7809a5b373ba359e2c974ed2386c58634819ac5a89c0813c15705c",
strip_prefix = "rules_python-0.15.1",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.15.1.tar.gz",
)
What's Changed
- fix: pip_compile to handle multiple generated requirements.in by @f0rmiga in #909
- ci: add debian11 to the matrix by @f0rmiga in #910
Full Changelog: 0.15.0...0.15.1
0.15.0
Using Bzlmod with Bazel 6
Add to your MODULE.bazel
file:
bazel_dep(name = "rules_python", version = "0.15.0")
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:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)
http_archive(
name = "rules_python",
sha256 = "fda23c37fbacf7579f94d5e8f342d3a831140e9471b770782e83846117dd6596",
strip_prefix = "rules_python-0.15.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.15.0.tar.gz",
)
What's Changed
- Expose python3n.lib as libpython's interface_library by @jlaxson in #890
- Fix //docs:update by @philsc in #876
- fix: correct bcr metadata template filename by @kormide in #892
- fix: fix a bug where some transitive deps could not be resolved via bzlmod by @kormide in #893
- feat: multi-toolchain support by @f0rmiga in #846
- bump: python toolchain releases by @f0rmiga in #902
- Correctly reference os-specific labels from central alias repo by @jlaxson in #889
- Document how to get started working on rules_python by @rickeylev in #891
- fix: #895 append _py if ending with .py by @rbuckland in #897
- fix: missing RunEnvironmentInfo by @f0rmiga in #904
New Contributors
- @jlaxson made their first contribution in #890
- @rbuckland made their first contribution in #897
Full Changelog: 0.14.0...0.15.0
0.14.0
Using Bzlmod with Bazel 6
Add to your MODULE.bazel
file:
bazel_dep(name = "rules_python", version = "0.14.0")
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:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "a868059c8c6dd6ad45a205cca04084c652cfe1852e6df2d5aca036f6e5438380",
strip_prefix = "rules_python-0.14.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.14.0.tar.gz",
)
What's Changed
- Use bazel 5.3.1 by @hanneskaeufler in #837
- Use json.encode() by @groodt in #838
- Revert "Use bazel 5.3.1" by @hanneskaeufler in #842
- Add CI job for RBE. by @UebelAndre in #816
- Add .bzl files explicitly to toolchain tests to detect .bzl file changes by @fishcakez in #815
- Allow extra files to be added to distinfo directory within the wheel. by @pstradomski in #831
- fix: assert expected bazel version by @f0rmiga in #847
- bump: pre-commit linters by @f0rmiga in #848
- Move construction of the METADATA file from wheelmaker to .bzl by @pstradomski in #844
- Include ignore_root_user_error in repository_rule keys by @keith in #835
- Allow requirements_in to be generated by @philsc in #829
- doc: clarify location of gazelle_python.yaml by @alexeagle in #849
- bump: ubuntu version on CI by @f0rmiga in #850
- fix: replace cc_import with cc_library for libpython by @scasagrande in #820
- fix: re-enable python_3_8_10_x86_64-apple-darwin_test by @f0rmiga in #851
- refactor: ci with multiple tasks by @f0rmiga in #855
- chore: update go dependencies by @f0rmiga in #854
- Updating docs by @chrislovecnm in #868
- Updating Gazelle version in example by @chrislovecnm in #857
- Update bzlmod example to use latest Bazel release by @kormide in #867
- Remove defunct owners, add new owners by @rickeylev in #873
- Add hrfuller as code owner for pip_parse by @rickeylev in #874
- Update
pip_install
topip_parse
in README.md by @kekesh in #852 - chore: add f0rmiga as codeowner for toolchains by @f0rmiga in #875
- Support annotations on pip packages with extras. by @william-smith-skydio in #865
- Support bzlmod by @kormide in #870
- Setup fixed releaser for Publish to BCR app by @kormide in #878
- fix(determinism): copy two missing entries from data_excludes by @alexeagle in #881
- fix: make conftest.py special with gazelle by @f0rmiga in #879
New Contributors
- @hanneskaeufler made their first contribution in #837
- @fishcakez made their first contribution in #815
- @scasagrande made their first contribution in #820
- @chrislovecnm made their first contribution in #868
- @kormide made their first contribution in #867
- @rickeylev made their first contribution in #873
- @kekesh made their first contribution in #852
- @william-smith-skydio made their first contribution in #865
Full Changelog: 0.13.0...0.14.0
0.13.0
WORKSPACE setup:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "8c8fe44ef0a9afc256d1e75ad5f448bb59b81aba149b8958f02f7b3a98f5d9b4",
strip_prefix = "rules_python-0.13.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.13.0.tar.gz",
)
What's Changed
- Make gazelle_python_manifest output deterministic by @abhishekshivanna in #813
- specify timeout for gazelle manifest test by @garymm in #817
- Allow overriding config attrs in pip_parse-generated install_deps by @jvolkman in #751
- fix pip_compile pip_compile select_golden_requirements_file invocation arguments by @lripoche in #826
- Disable `//python/tests/toolchains:python_3_8_10_x86_64-apple-darwin_… by @meteorcloudy in #830
- Standardise on pip_parse by @groodt in #807
New Contributors
- @abhishekshivanna made their first contribution in #813
- @garymm made their first contribution in #817
- @lripoche made their first contribution in #826
Full Changelog: 0.12.0...0.13.0
0.12.0
WORKSPACE setup:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "b593d13bb43c94ce94b483c2858e53a9b811f6f10e1e0eedc61073bd90e58d9c",
strip_prefix = "rules_python-0.12.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.12.0.tar.gz",
)
What's Changed
- Added label to py_wheel progress message. by @UebelAndre in #791
- Add option to use "pip download" instead of "pip wheel" to download wheels for other platforms by @jesseschalken in #773
- Revert "Add option to use "pip download" instead of "pip wheel" to do… by @groodt in #808
- Fix missing python includes for Unix hosts by @UebelAndre in #809
- Fix ability to download windows toolchains on case sensitive unix systems by @UebelAndre in #797
- Revert "pip_compile: remove external/workspace_name prefix from gener… by @alexeagle in #794
- Revert "Revert "Add option to use "pip download" instead of "pip wheel" to do…" by @groodt in #811
Full Changelog: 0.11.0...0.12.0
0.11.0
WORKSPACE setup:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "c03246c11efd49266e8e41e12931090b613e12a59e6f55ba2efd29a7cb8b4258",
strip_prefix = "rules_python-0.11.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.11.0.tar.gz",
)
What's Changed
- pip-tools: 6.6.2 -> 6.8.0 by @groodt in #762
- Make hermetic interpreters compatible to disallow_empty_glob by @martis42 in #761
- [gazelle] Use filepath.WalkDir instead of filepath.Walk by @dzbarsky in #770
- Exclude static libraries and tests to reduce zipped Python executables by @tetsuok in #758
- exec_compatible_with -> target_compatible_with #704 by @molar in #747
- fix: fail if the user is root by @f0rmiga in #749
- Simplify glob pattern to exclude static libraries by @tetsuok in #771
- pip: 22.1.2 -> pip-22.2.1 by @groodt in #774
- Fix download of Windows Python toolchain on Linux by @jesseschalken in #769
- chore: remove pkginfo from bzlmod file by @alexeagle in #778
- 709/from imports by @aptenodytes-forsteri in #760
- Add a consistent
python
interpreter symlink by @mattyclarkson in #782 - Exclude unused libpython{python_version}.so to reduce the size of zipped Python executables by @tetsuok in #772
- Update Python minor toolchain versions to allow smaller Python binaries by @tetsuok in #779
- Added importlib + reqs to pip-compile for python < 3.8 by @FaQA in #781
- feat(gazelle_python_manifest): provide a target with the given name by @mattem in #787
- fix(gazelle): handle purelib and platlib packages that don't set 'Root-Is-Purelib: true' by @mattem in #768
- Ran black and isort to fix files missed by commit hook by @UebelAndre in #790
- Fix leading forward slashes in RECORD files produced by
py_wheel
. by @UebelAndre in #789 - Add type annotations to runfiles library by @dzbarsky in #764
New Contributors
- @dzbarsky made their first contribution in #770
- @tetsuok made their first contribution in #758
- @molar made their first contribution in #747
- @jesseschalken made their first contribution in #769
- @aptenodytes-forsteri made their first contribution in #760
- @mattyclarkson made their first contribution in #782
- @FaQA made their first contribution in #781
Full Changelog: 0.10.2...0.11.0
0.10.2
WORKSPACE setup:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "a3a6e99f497be089f81ec082882e40246bfd435f52f4e82f37e89449b04573f6",
strip_prefix = "rules_python-0.10.2",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.10.2.tar.gz",
)
What's Changed
- Guard python_interpreter_target workspace name on None type check. by @hrfuller in #755
- Fix for
requirements_lock
with PEP440 direct references by @groodt in #756
Full Changelog: 0.10.1...0.10.2
0.10.1
WORKSPACE setup:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "00b25b02dc4593d620fccdd6c6069a202b87ac56f8446fab1a8101da557da2c2",
strip_prefix = "rules_python-0.10.1",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.10.1.tar.gz",
)
What's Changed
- chore: support bzlmod by @alexeagle in #744
- Flatten python packages by @groodt in #743
- safely check for standalone interpreter sentinel files by @hrfuller in #750
Full Changelog: 0.10.0...0.10.1
0.10.0
WORKSPACE setup:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "56dc7569e5dd149e576941bdb67a57e19cd2a7a63cc352b62ac047732008d7e1",
strip_prefix = "rules_python-0.10.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.10.0.tar.gz",
)
What's Changed
- feat: cc_import for libpython by @f0rmiga in #727
- pip: 22.0.4 -> 22.1.2; pip-tools: 6.6.0 -> 6.6.2 by @groodt in #718
- Fix #721. Remove self-link dependency pulled in sometimes by extras by @thundergolfer in #730
- fix: versioned shared object for libpython on Linux by @f0rmiga in #729
- Support configuration variables in py_wheel "version" attirbute. by @pstradomski in #640
- Provide current_py_toolchain by @jheaff1 in #731
- Validation to ensure requirements_lock is pinned. by @groodt in #732
- Use PEP 508 rules when setting deps from extras by @mattoberle in #724
- pip_compile: remove external/workspace_name prefix from generated requirements.txt by @BoleynSu in #690
- chore: update to Bazel 5.2.0 by @alexeagle in #736
- Remove //experimental by @groodt in #738
- Use
installer
to remove custom unzip and spread code by @groodt in #715 - More verbose 'fail' msgs. Don't rely on executed tools err msg by @thundergolfer in #737
- refactor: move all re-exports to private/reexports.bzl by @mattem in #739
- Patch pip environment with xcode sdk location. by @hrfuller in #697
New Contributors
- @mattoberle made their first contribution in #724
- @BoleynSu made their first contribution in #690
Full Changelog: 0.9.0...0.10.0
0.9.0
WORKSPACE setup:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "5fa3c738d33acca3b97622a13a741129f67ef43f5fdfcec63b29374cc0574c29",
strip_prefix = "rules_python-0.9.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.9.0.tar.gz",
)
What's Changed
- Fix example link in gazelle readme by @Whoaa512 in #693
- Check return code of zstd make by @jameskuszmaul-brt in #695
- Remove duplicate method invocation in entry_point generation by @thundergolfer in #696
- Add caveat about python_register_toolchain's hermeticty to README by @thundergolfer in #698
- Handle entry_points that end with .py by @groodt in #702
- Use "shared" msvc hermetic toolchain by @jheaff1 in #694
- Init: pypa/installer by @groodt in #700
- Fixed missing bzl sources from bzl filegroup by @UebelAndre in #712
- python: Update minor toolchain versions by @phlax in #707
- Made version failure message better reflect the issue by @jdob in #717
- Fix python3.8 type compatibility by @keith in #722
- pip/deps: Bump
pip-tools
-> 6.6.0 by @phlax in #692 - Remove legacy pip_import by @groodt in #726
New Contributors
- @Whoaa512 made their first contribution in #693
- @jameskuszmaul-brt made their first contribution in #695
- @jdob made their first contribution in #717
Full Changelog: 0.8.1...0.9.0