Skip to content

Add Python license-header package#37

Merged
anuraaga merged 2 commits into
bufbuild:mainfrom
anuraaga:pypi-license-header
Jul 7, 2026
Merged

Add Python license-header package#37
anuraaga merged 2 commits into
bufbuild:mainfrom
anuraaga:pypi-license-header

Conversation

@anuraaga

@anuraaga anuraaga commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

For reuse in our Python projects. Originally written by @timostamm

It's kept to the bare minimum for being a simple tool, no tagged releases just pushing to pypi from main. Duplicate version numbers are automatically skipped by pypi. Will get the environment setup before merging.

anuraaga and others added 2 commits June 26, 2026 15:19
Co-authored-by: Timo Stamm <ts@timostamm.de>
@anuraaga anuraaga requested a review from ajeetdsouza June 26, 2026 06:22
if fnmatch.fnmatch(filepath, pattern):
return True
# Expand ** to match any number of path segments
if pattern.startswith("**/"):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be doing this manually - PurePath.full_match() handles everything we need and is part of the stdlib. We will have to upgrade our Python target to 3.13 though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is the code were already using, I'm ok with it for now. Things get awkward if we raise the Python target since downstream repos don't target such a recent Python, and if some dev tasks work on certain python but not others it can get confusing. An unnecessary concern since we have this working implementation

@anuraaga anuraaga merged commit cdfba48 into bufbuild:main Jul 7, 2026
24 checks 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.

2 participants