chore: pin black/isort/flake8 to modern versions - #833
Merged
Merged
Conversation
black==20.8b1 depended on typed_ast, which fails to build on Python >=3.10, so nobody on a current Python could install the version CI enforced (make lint) -- local devs ended up linting with whatever newer black they had, which silently disagrees with CI on formatting edge cases. isort==5.6.4 had the same staleness problem. Bump to black==25.11.0, isort==6.1.0, flake8==7.3.0 (all verified to install cleanly on Python 3.9, matching the lint CI job), add a pyproject.toml pinning black's line-length/target-version so the config itself doesn't drift, and drop the click<8.1.0 workaround that was only needed for the old black pin. Reformat the repo once with the new pinned toolchain (mechanical only: docstring rewrapping, black's newer paren-splitting style -- no logic changes). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
textattack/=22.3.0 was accidental debris: an unquoted `pip install black>=22.3.0` got parsed by the shell as a redirect into a file literally named =22.3.0, and the resulting stray file was gitignored instead of deleted. The file itself is long gone; drop the leftover ignore rule. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
black==25.11.0, isort==6.1.0, and flake8==7.3.0 (pinned in this PR) all require Python>=3.9, so pip install -e .[dev] was silently unresolvable on Python 3.8 despite setup.py still advertising 3.8 support. Also drop py38 from black's target-version in pyproject.toml to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks
qiyanjun
added a commit
that referenced
this pull request
Aug 14, 2026
ReadTheDocs builds have been failing near-instantly (~2s, a config-level failure, not a real Sphinx error) since setup.py's python_requires was bumped to >=3.9 (PR #833). Two problems: - build.os was pinned to ubuntu-20.04, which ReadTheDocs has since deprecated. - build.tools.python was pinned to "3.8", which no longer satisfies textattack's own python_requires >=3.9 when the docs build installs the package itself (python.install's `path: .` entry). Bumped to ubuntu-24.04 / Python 3.11, matching what .github/workflows/make-docs.yml already uses successfully in CI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
black==20.8b1(pinned since 2020) depends ontyped_ast, which fails to build on Python >=3.10 — nobody on a current Python can install the versionmake lint/CI enforces, so local devs lint with whatever newer black they have, which silently disagrees with CI on formatting edge cases (see Fix six more issues from the unresolved-bugs backlog #831's CI failure ontextattack/shared/validators.py).blackto25.11.0,isortto6.1.0,flake8to7.3.0— all verified to install cleanly on Python 3.9 (matching theFormatting with black & isortCI job).pyproject.tomlwith[tool.black]line-length/target-version so the config itself is locked, not just the version.click<8.1.0workaround incheck-formatting.yml, which was only needed for the old black pin.Test plan
make format+make lintrun clean against a fresh Python 3.9 env with the exact pinned versionsparticle_swarm_optimization.py) to confirm changes are purely cosmeticast.parsesanity check on every changed.pyfile🤖 Generated with Claude Code