Skip to content

build: add pypackaging.bzl 0.4.0 as a dependency - #4559

Merged
rickeylev merged 3 commits into
mainfrom
refactor.aignas.pypackaging-03-dep
Nov 24, 2026
Merged

rickeylev merged 3 commits into
mainfrom
refactor.aignas.pypackaging-03-dep

Conversation

@aignas

@aignas aignas commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

We have been maintaining our own Starlark implementations of PEP 440
versions and PEP 508 requirements and environment markers.
pypackaging.bzl is a Starlark port of packaging that is tested
against the upstream test-suite, so add it as a dependency in order to
start using it instead.

WORKSPACE users get the new dependency from py_repositories. Our
own WORKSPACE file now calls it before the internal setup, which
loads the repository rules that are going to use the new dependency.

@aignas

aignas commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

This PR was prepared by an AI agent (Claude Code) on behalf of @aignas. The agent replies to the review comments and pushes the fixes, @aignas supervises it and reviews the changes.

This is an agent-generated comment unreviewed by the user.

@aignas aignas changed the title build: add pypackaging.bzl 0.3.0 as a dependency build: add pypackaging.bzl 0.4.0 as a dependency Nov 22, 2026
@aignas
aignas added this pull request to stack #4570 November 22, 2026 04:18
@aignas
aignas marked this pull request as ready for review November 22, 2026 08:41
@aignas aignas added the gazelle Gazelle plugin related issues label Nov 22, 2026
Base automatically changed from refactor.aignas.pypackaging-02-coverage-deps to main November 23, 2026 04:47
We have been maintaining our own Starlark implementations of PEP 440
versions and PEP 508 requirements and environment markers.
`pypackaging.bzl` is a Starlark port of `packaging` that is tested
against the upstream test-suite, so add it as a dependency in order to
start using it instead.

`WORKSPACE` users get the new dependency from `py_repositories`. Our
own `WORKSPACE` file now calls it before the internal setup, which
loads the repository rules that are going to use the new dependency.
It is aligned with packaging 26.3, is faster and officially supports
WORKSPACE with Bazel 7 and 8.
@rickeylev
rickeylev force-pushed the refactor.aignas.pypackaging-03-dep branch from 1ccf5c6 to 910bc28 Compare November 23, 2026 04:47
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: pypackaging.bzl Bazel setup

Layer / File(s) Summary
Declare and wire pypackaging.bzl
MODULE.bazel, python/private/py_repositories.bzl, downloader_config.cfg, gazelle/downloader_config.cfg, sphinxdocs/downloader_config.cfg, WORKSPACE, BUILD.bazel
The module and repository setup declare pypackaging.bzl version 0.4.0. Downloader configurations add GitHub and mirror rewrites. WORKSPACE runs py_repositories() before internal setup. Gazelle maps the .bzl target to the pypackaging target.

Possibly related PRs

Suggested reviewers: rickeylev, dougthor42

Change: Other

Merge Risk: Minimal · up to 910bc

This change adds the pypackaging.bzl 0.4.0 dependency and the related download and Gazelle configuration. It also moves Python repository initialization earlier in WORKSPACE. No concrete merge-blocking risk was identified.

Architecture risk: Low · up to 910bc

The change affects 7 systems.

Changed systems: python, BUILD.bazel, downloader_config.cfg, gazelle, MODULE.bazel, sphinxdocs, WORKSPACE

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — python (service) was modified; 1 changed file maps to changed impact.
  • observed — BUILD.bazel (service) was modified; 1 changed file maps to changed impact.
  • observed — downloader_config.cfg (service) was modified; 1 changed file maps to changed impact.
  • observed — gazelle (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in BUILD.bazel: Replaces the comment about Gazelle stripping .bzl from the toml.bzl repository name with a comment about pypackaging.bzl, and adds a Gazelle resolution mapping from @pypackaging.bzl//:pypackaging.bzl to @pypackaging.bzl//:pypackaging.
  • observed — Modified behavior in MODULE.bazel: Adds pypackaging.bzl as a Bazel module dependency at version 0.4.0.
  • observed — Modified behavior in WORKSPACE: The Python repository load and py_repositories() call move before internal setup; previously they followed it. The comments state this ordering is needed because the loaded repository rules use dependencies defined by py_repositories().
  • observed — Modified behavior in downloader_config.cfg: Adds a primary GitHub rewrite for jvolkman/pypackaging.bzl, preserving the matched suffix.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a964c015-105a-41f5-8889-5da0bf5943bf
Commits

Reviewing files that changed from the base of the PR and between 6bf1b5c and 910bc28.

Files ignored due to path filters: 1

  • tests/integration/bzlmod_lockfile/MODULE.bazel.lock is excluded by !**/*.lock
Files selected for processing: 7

  • BUILD.bazel
  • MODULE.bazel
  • WORKSPACE
  • downloader_config.cfg
  • gazelle/downloader_config.cfg
  • python/private/py_repositories.bzl
  • sphinxdocs/downloader_config.cfg

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@github-actions github-actions Bot added the sphinxdocs Issues relating to the sphinxdocs code label Nov 23, 2026
@rickeylev
rickeylev added this pull request to the merge queue Nov 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 24, 2026
@rickeylev
rickeylev added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit c559bcf Nov 24, 2026
27 checks passed
@rickeylev
rickeylev deleted the refactor.aignas.pypackaging-03-dep branch November 24, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gazelle Gazelle plugin related issues sphinxdocs Issues relating to the sphinxdocs code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants