Skip to content

Releases: aspect-build/rules_py

v0.7.1

03 Mar 00:01
9ee2b08
Compare
Choose a tag to compare
v0.7.1 Pre-release
Pre-release

Using Bzlmod with Bazel 6:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_py", version = "0.7.1")

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", dev_dependency = True, version = "0.29.0")

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 = "6b47e3e20afef68c33fb0e103462d6ca35a33423c637429566c412ade555a778",
    strip_prefix = "rules_py-0.7.1",
    url = "https://github.com/aspect-build/rules_py/releases/download/v0.7.1/rules_py-v0.7.1.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()

# "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

Full Changelog: v0.7.0...v0.7.1

v0.7.0

02 Mar 17:06
334dd44
Compare
Choose a tag to compare
v0.7.0 Pre-release
Pre-release

Using Bzlmod with Bazel 6:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_py", version = "0.7.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", dev_dependency = True, version = "0.29.0")

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 = "75179b67f8c187916476c7861ff3453b437614b35cd20c763738b643f49e59f7",
    strip_prefix = "rules_py-0.7.0",
    url = "https://github.com/aspect-build/rules_py/releases/download/v0.7.0/rules_py-v0.7.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()

# "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

New Contributors

Full Changelog: v0.6.0...v0.7.0

v0.6.0

28 Feb 01:04
9b46190
Compare
Choose a tag to compare
v0.6.0 Pre-release
Pre-release

Using Bzlmod with Bazel 6:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_py", version = "0.6.0")

And also register a Python toolchain, see rules_python. For example:

bazel_dep(name = "rules_python", dev_dependency = True, version = "0.27.1")

# NB: users need this as well, until a new version of rules_python is released
archive_override(
    module_name = "rules_python",
    urls = "https://github.com/bazelbuild/rules_python/archive/52381415be9d3618130f02a821aef50de1e3af09.tar.gz",
    integrity = "sha256-pYfEFNWqygSEElDYgJsuIeDYn9oll/rZB0GcR+6rirA=",
    strip_prefix = "rules_python-52381415be9d3618130f02a821aef50de1e3af09",
)

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 = "d60bb474069d77314532c3dd36ef162ab91ef3fe6e04d60836bd922a08e9fb4b",
    strip_prefix = "rules_py-0.6.0",
    url = "https://github.com/aspect-build/rules_py/releases/download/v0.6.0/rules_py-v0.6.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()

What's Changed

  • fix: install transitive wheels reachable through resolutions by @alexeagle in #230
  • fix: use original interpreter path as 'home' value in pyvenv.cfg by @mattem in #232
  • chore(deps): update dependency bazel to v6.4.0 by @renovate in #224
  • chore(deps): update dependency rules_python to v0.27.1 by @renovate in #211
  • chore: minimal changes required to upgrade to Bazel 7 and bzlmod by @alexeagle in #234
  • fix: handle py_binary#main like rules_python does by @alexeagle in #241
  • fix: py_library add srcs to its runfiles by @alexeagle in #242
  • chore: upgrade rules_python near HEAD by @alexeagle in #245
  • chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.5.0 by @renovate in #243
  • chore(deps): update dependency bazel_gazelle to v0.35.0 by @renovate in #240
  • chore(deps): update dependency aspect_bazel_lib to v1.40.0 by @renovate in #239
  • chore: cancel previous GHA from the same PR by @gregmagolan in #254
  • chore: upgrade to Bazel 7.0.2 by @gregmagolan in #249

Full Changelog: v0.5.0...v0.6.0

v0.5.0

27 Nov 21:16
e5c2112
Compare
Choose a tag to compare
v0.5.0 Pre-release
Pre-release

Using Bzlmod with Bazel 6:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_py", version = "0.5.0")

And also register a Python toolchain, see rules_python. For example:

bazel_dep(name = "rules_python", dev_dependency = True, version = "0.22.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
    name = "python3",
    configure_coverage_tool = True,
    python_version = "3.11",
)
use_repo(python, "python3_toolchains")

register_toolchains(
    "@python3_toolchains//:all",
)

Using WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_py",
    sha256 = "e1d1023bc9ba8545dc87c6df10508d9d7c20f489f5e5c5c1e16380b33c013485",
    strip_prefix = "rules_py-0.5.0",
    url = "https://github.com/aspect-build/rules_py/releases/download/v0.5.0/rules_py-v0.5.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()

What's Changed

  • refactor: put 'git archive' config in .gitattributes by @alexeagle in #215
  • feat: support 'virtual' dependencies by @mattem in #201
  • chore(deps): update dependency bazel_gazelle to v0.34.0 by @renovate in #188
  • chore(deps): update dependency rules_python_gazelle_plugin to v0.26.0 by @renovate in #192
  • chore(deps): update dependency aspect_bazel_lib to v1.38.1 by @renovate in #187
  • fix(py_library): don't return transitive srcs as defaultinfo by @alexeagle in #221
  • chore(deps): update dependency io_bazel_rules_go to v0.42.0 by @renovate in #195
  • build(deps): bump django from 4.2.0 to 4.2.7 in /py/tests/virtual/django by @dependabot in #220
  • build(deps): bump django from 4.2.5 to 4.2.7 by @dependabot in #216
  • fix: use original interpreter path as 'home' value in pyvenv.cfg by @mattem in #226

New Contributors

Full Changelog: v0.4.0...v0.5.0

v0.4.0

19 Oct 18:57
9dc9650
Compare
Choose a tag to compare
v0.4.0 Pre-release
Pre-release

Using Bzlmod with Bazel 6:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_py", version = "0.4.0")

And also register a Python toolchain, see rules_python. For example:

bazel_dep(name = "rules_python", dev_dependency = True, version = "0.22.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
    name = "python3_9",
    configure_coverage_tool = True,
    python_version = "3.9",
)
use_repo(python, "python3_9_toolchains")

register_toolchains(
    "@python3_9_toolchains//:all",
)

Using WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_py",
    sha256 = "50b4b43491cdfc13238c29cb159b7ccacf0a1e54bd27b65ff2d5fac69af4d46f",
    strip_prefix = "rules_py-0.4.0",
    url = "https://github.com/aspect-build/rules_py/releases/download/v0.4.0/rules_py-v0.4.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()

What's Changed

  • chore(deps): update io_bazel_rules_docker digest to 8e70c6b by @renovate in #148
  • chore(deps): update dependency bazel_gazelle to v0.32.0 by @renovate in #156
  • chore(deps): update dependency aspect_bazel_lib to v1.33.0 by @renovate in #144
  • chore: update .gitignore by @mattem in #166
  • chore(deps): update aspect_gcc_toolchain digest to 4bd1f94 by @renovate in #145
  • chore: bump Python dependencies by @mattem in #167
  • Allow passing deps in py_pytest_main by @linzhp in #163
  • fix: ensure coverage providers are output from both py_library and py_binary rules by @mattem in #168
  • chore: update sqlparse by @mattem in #169
  • chore: bump bazel version to 6.3.1 by @mattem in #170
  • chore(deps): update aspect_gcc_toolchain digest to 70a8c93 by @renovate in #171
  • chore(deps): update dependency bazel to v6.3.2 by @renovate in #177
  • fix: use rlocation for interpreter location by @mattem in #182
  • chore(deps): update dependency rules_python to v0.18.0 by @renovate in #134
  • chore: update Python dependencies by @mattem in #183
  • chore(deps): update dependency bazel_skylib to v1.4.2 by @renovate in #135
  • chore(deps): update dependency io_bazel_rules_go to v0.41.0 by @renovate in #178
  • feat: expose py_venv rule, allowing creation of virtual envs from multiple targets by @mattem in #181
  • chore: skip examples in release artifact by @alexeagle in #185
  • Update readme by @alexeagle in #186
  • Add testonly and data parameters to py_pytest_main rule by @kpark-hrp in #190
  • chore: run pre-commit on all files by @alexeagle in #199
  • docs: update README by @alexeagle in #197
  • chore: update rules_python by @mattem in #200
  • chore: dogfood our rules rather than rules_python by @alexeagle in #204
  • docs: improve generated documentation by @alexeagle in #203
  • chore: use modern helper from bazel-lib by @alexeagle in #207

New Contributors

Full Changelog: v0.3.0...v0.4.0

v0.3.0

02 Jun 18:24
bb956d0
Compare
Choose a tag to compare
v0.3.0 Pre-release
Pre-release

Using Bzlmod with Bazel 6:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_py", version = "0.3.0")

And also register a Python toolchain, see rules_python. For example:

bazel_dep(name = "rules_python", dev_dependency = True, version = "0.22.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
    name = "python3_9",
    configure_coverage_tool = True,
    python_version = "3.9",
)
use_repo(python, "python3_9_toolchains")

register_toolchains(
    "@python3_9_toolchains//:all",
)

Using WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_py",
    sha256 = "d87463035d7df79b79e9a03247c463bda3623f26b7a24dd1ebee9ced2be38f4e",
    strip_prefix = "rules_py-0.3.0",
    url = "https://github.com/aspect-build/rules_py/releases/download/v0.3.0/rules_py-v0.3.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()

What's Changed

Full Changelog: v0.2.0...v0.3.0

v0.2.0

21 Feb 20:23
0bb8d01
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_py",
    sha256 = "c977cadb8703e325f02c1e6a3718e85f52b158e199654b1a28125c420588d720",
    strip_prefix = "rules_py-0.2.0",
    url = "https://github.com/aspect-build/rules_py/releases/download/v0.2.0/rules_py-v0.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()

What's Changed

  • Remove EXPERIMENTAL by @alexeagle in #115
  • Clean up all symlinks in venv by @mvukov in #112
  • chore(deps): update io_bazel_rules_docker digest to 48ad6d6 by @renovate in #108
  • chore(deps): update dependency io_bazel_rules_go to v0.37.0 by @renovate in #107
  • chore(deps): update dependency aspect_bazel_lib to v1.19.1 by @renovate in #106
  • chore(deps): update aspect_gcc_toolchain digest to ac745d4 by @renovate in #80
  • chore: update Python dependencies by @mattem in #118
  • chore(deps): update dependency bazel to v5.4.0 by @renovate in #120
  • chore(deps): bump rules_python to 0.16.1 by @mattem in #119
  • fix black and flake8 errors in generated pytest runner. by @tellett in #129
  • chore(deps): update dependency bazel_gazelle to v0.29.0 by @renovate in #128
  • chore(deps): update dependency aspect_bazel_lib to v1.23.3 by @renovate in #122
  • chore(deps): update io_bazel_rules_docker digest to e48c7cc by @renovate in #124
  • chore(deps): update dependency rules_python to v0.16.2 by @renovate in #126
  • chore(deps): update dependency pytest to v7.2.1 by @renovate in #127
  • chore(deps): update dependency packaging to v23 by @renovate in #125
  • chore(deps): update dependency iniconfig to v2 by @renovate in #123
  • chore: add workflows for new issues & PRs by @gregmagolan in #140
  • chore: remove New PR workflows as it doesn't work on forks by @gregmagolan in #141
  • release: publish release artifact by @alexeagle in #142
  • Fix/repo relative imports by @mvukov in #113
  • chore(deps): update aspect_gcc_toolchain digest to 4a03b37 by @renovate in #138
  • chore(deps): update dependency aspect_bazel_lib to v1.24.2 by @renovate in #137
  • chore(deps): update dependency io_bazel_rules_go to v0.38.1 by @renovate in #133
  • chore(deps): update io_bazel_rules_docker digest to fc729d8 by @renovate in #132
  • chore(deps): update dependency django to v4.0.9 [security] by @renovate in #139
  • chore: update renovate config by @gregmagolan in #146

New Contributors

Full Changelog: v0.1.0...v0.2.0

v0.1.0

02 Jan 21:57
8466742
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_py",
    sha256 = "66da30b09cf47ee40f2ae1c46346cc9a412940965d04899bd68d06a9d3380085",
    strip_prefix = "rules_py-0.1.0",
    url = "https://github.com/aspect-build/rules_py/archive/refs/tags/v0.1.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()

What's Changed

  • feat: py_* rules in Starlark by @mattem in #10
  • fix: ensure transitive wheels are passed from py_library by @mattem in #11
  • feat: create venv in a separate action by @mattem in #12
  • fix: don't pass kwargs to py_venv rule by @mattem in #16
  • fix: ensure all Python toolchain files are added to runfiles by @mattem in #20
  • fix: ensure VIRTUAL_ENV var is set correctly, unset PYTHONHOME if set by @mattem in #23
  • fix: check for setuptools before creating symlinks by @mattem in #24
  • feat: support interpreter_path from py3_toolchain by @mattem in #22
  • fix: remove check on missing interpreter or interpreter_path on the toolchain by @mattem in #27
  • feat: add autodetecting toolchain compatible with rules_py venvs by @mattem in #26
  • fix: don't treat all transitive py_library rules as external by @mattem in #29
  • chore: tidy and add django example by @mattem in #28
  • test: import from external non-wheel py_library by @mattem in #30
  • fix: typo autodecting -> autodetecting by @mattem in #34
  • fix: workspace import pathing on py_library by @mattem in #32
  • chore: bump bazel version to 5.1.1 by @mattem in #35
  • fix: don't add source files to requirements files from transitive native py_library rules by @mattem in #36
  • chore: rename BUILD to BUILD.bazel by @mattem in #38
  • chore: show errors by default for failed tests by @mattem in #41
  • chore: update rules_python to 0.8.1 by @mattem in #42
  • chore: simplify default import attrs on macros by @mattem in #40
  • fix: symlink to python3 instead of python_real by @mattem in #37
  • chore: update aspect_bazel_lib to 0.12.1 by @mattem in #44
  • fix: don't set sibling directory for venvs output directory by @mattem in #45
  • fix: add the runfiles root as a python package by @mattem in #39
  • feat: add support for variable and location expansion on env attr by @mattem in #47
  • chore: add configuration for the Aspect gcc toolchain by @mattem in #43
  • feat: return PyInfo provider from py_binary rules by @mattem in #48
  • chore: update aspect_bazel_lib to 1.0.0 by @mattem in #49
  • tests: adds first party dependencies to the container test, add note about usage by @mattem in #54
  • Configure Renovate by @renovate in #50
  • chore(deps): update actions/checkout action to v3 by @renovate in #59
  • chore(deps): update actions/cache action to v3 by @renovate in #58
  • chore(deps): update dependency asgiref to v3.5.2 by @renovate in #55
  • refactor: remove use of maybe() helper by @alexeagle in #60
  • chore: have less strict testing dependency constraints by @mattem in #61
  • chore(deps): update aspect_gcc_toolchain digest to 2feb7ad by @renovate in #64
  • chore(deps): update dependency io_bazel_rules_go to v0.33.0 by @renovate in #67
  • chore(deps): update dependency bazel_skylib to v1.2.1 by @renovate in #66
  • chore(deps): update build_bazel_integration_testing digest to 7d3e9ae by @renovate in #62
  • chore(deps): update aspect_gcc_toolchain digest to b15575d by @renovate in #68
  • chore(deps): update dependency colorama to v0.4.5 by @renovate in #69
  • chore(deps): update io_bazel_rules_docker digest to ed321b3 by @renovate in #71
  • chore(deps): update aspect_gcc_toolchain digest to efc23c5 by @renovate in #70
  • Remove duplicated comment line in venv.bzl by @dzbarsky in #73
  • chore(deps): update aspect_gcc_toolchain digest to 60ac9bb by @renovate in #74
  • chore(deps): update dependency bazel to v5.2.0 by @renovate in #72
  • chore(deps): update aspect_gcc_toolchain digest to 01f4347 by @renovate in #75
  • chore(deps): update dependency bazel_gazelle to v0.26.0 by @renovate in #65
  • chore(deps): update aspect_gcc_toolchain digest to 0e00070 by @renovate in #76
  • chore(deps): update dependency io_bazel_rules_go to v0.34.0 by @renovate in #79
  • chore(deps): update io_bazel_rules_docker digest to a8aff40 by @renovate in #78
  • chore(deps): update dependency io_bazel_stardoc to v0.5.2 by @renovate in #63
  • chore(deps): update dependency bazel to v5.3.0 by @renovate in #82
  • chore(deps): update dependency aspect_bazel_lib to v1.13.0 by @renovate in #89
  • chore(deps): update dependency bazel_skylib to v1.3.0 by @renovate in #92
  • fix: dependabot alerts by @f0rmiga in #98
  • feat: py_pytest_main by @f0rmiga in #96
  • chore(deps): update dependency bazel to v5.3.2 by @renovate in #86
  • chore(deps): update dependency io_bazel_rules_go to v0.35.0 by @renovate in #83
  • fix: skylib download warning by @f0rmiga in #101
  • chore(deps): update io_bazel_rules_docker digest to 88fb10b by @renovate in #81
  • chore(deps): update dependency bazel_gazelle to v0.28.0 by @renovate in #84
  • chore(deps): update dependency io_bazel_stardoc to v0.5.3 by @renovate in #91
  • chore(deps): update dependency aspect_bazel_lib to v1.16.1 by @renovate in #99
  • fix: generated docs by @f0rmiga in #102
  • chore(deps): update io_bazel_rules_docker digest to 6482756 by @renovate in #103
  • chore(deps): update dependency rules_python to v0.14.0 by @renovate in #90
  • build: set container related targets as manual by @mattem in #105

New Contributors

Full Changelog: https://github.com/aspect-build/rules_py/commits/v0.1.0