Skip to content

Pin ament-black to the released Python 3.14 / black>=26.3 fix (0.2.7, v0.0.12) - #2

Merged
doisyg merged 2 commits into
mainfrom
pin/ament-black-py314-fix
Jun 7, 2026
Merged

Pin ament-black to the released Python 3.14 / black>=26.3 fix (0.2.7, v0.0.12)#2
doisyg merged 2 commits into
mainfrom
pin/ament-black-py314-fix

Conversation

@doisyg

@doisyg doisyg commented May 31, 2026

Copy link
Copy Markdown
Contributor

Why

The ament_black hook is language: python, so pre-commit pip-installs ament-black into a venv built with the host Python. On Python 3.14 it fails: the dependency tracked the stale noble_fix branch of botsandus/ament_black, whose setup.py pins black==21.12b0 + uvloop==0.17.0 (no py3.14 wheels → install fails) and whose main.py still imports the removed black.concurrency.maybe_install_uvloop (black renamed it to maybe_use_uvloop in 26.3.0, psf/black#4996).

Change

botsandus/ament_black#18 is now merged and released as 0.2.7, which:

  • adds a maybe_install_uvloop / maybe_use_uvloop import fallback, and
  • unpins black/uvloop in setup.py (current black 26.x and uvloop 0.22.1 ship py3.14 wheels).

Pin the dependency to the released tag 0.2.7 (note: the tag has no v prefix) instead of the PR head commit.

Released as 0.0.12 — this is the first release of the fix (v0.0.12 was never tagged), so the repoint folds into that version rather than introducing a phantom 0.0.13.

Verified: an isolated venv install from the tag yields ament_black 0.2.7 and ament_black --reformat reformats correctly on Python 3.14 with black 26.5.1.

Note for consumers

Repos that pin this hook by rev: (e.g. auto-sandbox/.pre-commit-config.yaml) should bump to v0.0.12 once this is merged and tagged v0.0.12.

The dep tracked the stale noble_fix branch, whose ament_black pins
black==21.12b0 + uvloop==0.17.0 (no Python 3.14 wheels) and still imports
the removed black.concurrency.maybe_install_uvloop. Pin to the
botsandus/ament_black#18 head commit, which fixes the import and unpins
black/uvloop, so the ament_black (language: python) pre-commit hook
installs and runs on Python 3.14.

Repoint to @v0.2.7 (or @main) once #18 merges and 0.2.7 is released.
@doisyg doisyg changed the title Pin ament-black to the Python 3.14 / black>=26.3 fix (v0.0.12) Pin ament-black to the released Python 3.14 / black>=26.3 fix (0.2.7, v0.0.13) Jun 7, 2026
@doisyg
doisyg force-pushed the pin/ament-black-py314-fix branch from 0a58f92 to a81f717 Compare June 7, 2026 19:17
@doisyg doisyg changed the title Pin ament-black to the released Python 3.14 / black>=26.3 fix (0.2.7, v0.0.13) Pin ament-black to the released Python 3.14 / black>=26.3 fix (0.2.7, v0.0.12) Jun 7, 2026
@doisyg
doisyg force-pushed the pin/ament-black-py314-fix branch from a81f717 to a7fd314 Compare June 7, 2026 19:19
@doisyg
doisyg merged commit ac93cad into main Jun 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant