Repository navigation
Typing and release supply chain sec, - #20
Merged
Merged
Conversation
Turn the module into a package so it can ship py.typed (PEP 561), annotate the public API, and run mypy in strict mode. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The traceback lexers no longer read a `python3` option and always use IPython3Lexer, so drop the references to Python 2.x/3.x selection. Also: - describe in1_regex/in2_regex/out_regex as strings (they are rstrip'd and compiled, so compiled patterns or None never worked) - say what IPythonTracebackLexer actually delegates to - reword the IPyLexer summary, which is not registered with Pygments - fix typos (IPythonCOnsoleLexer, "or and") Docstrings and comments only; no behaviour change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Declare the license as the SPDX expression BSD-3-Clause with license-files, which needs flit_core >= 3.12. Drop the License :: trove classifier, which PEP 639 deprecates alongside a license expression. The built metadata now has License-Expression: BSD-3-Clause. Also fix the module header, which pointed to a nonexistent COPYING.txt, to match LICENSE (BSD 3-Clause, 2012-Present). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The dependency had no lower bound, although the module does not even import on old Pygments (Python2Lexer is missing in 2.4). Require 2.14 (January 2023), the first version that emits Token.Text.Whitespace where the tests expect it, and drop the pre-2.14 shim in the tests. Add a CI job that runs the tests on Python 3.11 with pygments==2.14.0 so the floor stays accurate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Only version-like tags (e.g. 1.2.0, 1.2.0rc1) trigger the workflow on tag push, so a stray tag no longer publishes to PyPI. - New build job: fails on a tag that does not match __version__, builds the sdist and wheel, runs the test suite against the installed wheel (not the source tree), and uploads dist/ as an artifact. It runs on every push and PR, so packaging breakage shows up before a release. - The publish job now only downloads the artifact and uploads it, so the build no longer runs with id-token: write. - Publish runs in a "pypi" GitHub environment, so it can be gated by required reviewers or tag rules. PyPI's trusted publisher for this project has no environment configured, so it accepts this as is. The workflow file name (test.yml) is unchanged on purpose: the trusted publisher is bound to it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PyPI trusted publishing trusts a workflow by file name. test.yml also runs on pull requests, branch pushes and manual dispatch, and is the file contributors and Dependabot edit most, so publishing now lives in publish.yml, which only runs for version tags. publish.yml calls test.yml as a reusable workflow (lint, tests, the tag/__version__ check, building and testing the wheel), then uploads that same build from its own top-level job in the "pypi" environment. The upload has to stay in the top-level workflow: PyPI does not accept trusted-publishing uploads from inside a called workflow. test.yml gains a workflow_call trigger and loses its tag trigger and publish job. PyPI action needed after merge: add a GitHub trusted publisher with workflow publish.yml and environment pypi, then remove the old test.yml publisher. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Helped by claude.
I will likely make a minor relase soon.