chore: fill in the PyPI project metadata and fix the sdist - #7
Merged
Merged
Conversation
PyPI's project page for armasec-lite showed an empty Meta section and only a GitHub link, because the distribution carried the bare minimum of metadata. - `project.urls` gains Documentation, Issues and Changelog, and Homepage now points at the docs site rather than duplicating Repository. PyPI recognises these five names specifically and gives each its own icon. - `license` moves to the PEP 639 SPDX expression with `license-files`. Metadata 2.4 forbids carrying both a License-Expression and a `License ::` classifier, so the MIT classifier is removed with it; keeping both makes PyPI reject the upload. - Classifiers gain OS Independent, Python 3 Only, Framework :: Pytest (the package ships a `pytest11` entry point), two Topic entries and Typing :: Typed. - Keywords gain the provider names people actually search for. - `maintainers` added. `armasec_lite/py.typed` is new, which is what earns the Typing :: Typed classifier. Every signature is annotated and mypy runs in strict mode, but without the PEP 561 marker a consumer's type checker skips the installed package silently and treats everything it exports as `Any`. The sdist was also a release blocker. Hatchling's default is to ship everything the ROOT .gitignore does not exclude, and it does not read nested ignore files, so `docusaurus/node_modules` (ignored by docusaurus/.gitignore) went into the tarball: 574MB of input, a 115.7MB artifact, over PyPI's 100MB per-file limit. A tagged release would have failed at upload. The sdist target now names its contents. `include` alone was not enough: hatchling matches README* and LICEN[CS]E* recursively, which still pulled 1888 of them out of node_modules, so `exclude` names the two directories outright. Verified: `uv build` produces a 105KB sdist of 49 members rooted at armasec_lite, tests and examples only, and `twine check` PASSES on both the wheel and the sdist. The wheel contains py.typed and the LICENSE. Metadata renders as version 2.5 with License-Expression: MIT and no License :: classifier. Full suite 371 passed; ruff and mypy --strict clean. Three new tests in tests/unit/test_packaging.py cover the project-page fields, the py.typed marker and the sdist allow-list. All three were confirmed failing against the old configuration first. Co-Authored-By: Claude Opus 5 (1M context) <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.
What
PyPI's project page renders its sidebar from the metadata inside the uploaded
distribution, not from the repository. armasec-lite shipped the bare minimum, so the
page had an empty Meta section and a single GitHub link. This fills in the fields PyPI
actually renders, and fixes a source distribution that would have failed at upload.
Metadata
project.urlsgainsDocumentation,IssuesandChangelog;Homepagenow pointsat the docs site instead of duplicating
Repository. PyPI recognises these five namesspecifically and gives each its own icon, so a sixth under some other label would
render as a plain bullet.
licensemoves to the PEP 639 SPDX expression pluslicense-files. Metadata 2.4forbids a distribution carrying both a
License-Expressionand aLicense ::classifier, so the MIT classifier is removed as part of this change. Keeping both
makes PyPI reject the upload.
Operating System :: OS Independent,Programming Language :: Python :: 3 :: Only,Framework :: Pytest(the package ships apytest11entry point),Topic :: Software Development :: Libraries :: Python Modules,Topic :: System :: Systems Administration :: Authentication/DirectoryandTyping :: Typed.keycloak,auth0,openid-connect,jwks,authentication,authorization).maintainersadded.armasec_lite/py.typedNew, and it is what earns the
Typing :: Typedclassifier. Every signature in thepackage is annotated and mypy runs in strict mode here, but without the PEP 561 marker
mypy and pyright both skip an installed package silently and treat every symbol it
exports as
Any. Downstream projects were getting no types from a fully typed library.The sdist was a release blocker
Hatchling's default sdist is "everything the root
.gitignoredoes not exclude", andit does not read nested ignore files.
docusaurus/node_modulesis ignored bydocusaurus/.gitignore, so it went into the tarball: 574MB of input, a 115.7MBartifact, over PyPI's 100MB per-file limit.
release.ymlpublishes on a tag via trustedpublishing, so this would have failed at the upload step, after the tag was pushed.
[tool.hatch.build.targets.sdist]now names its contents.includealone was notsufficient: hatchling matches
README*andLICEN[CS]E*recursively, which still pulled1888 of them out of
node_moduleseven with only the two root files named.excludenames
docusaurusandlegacy_comparison_composeoutright.Verification
Tests
Three added to
tests/unit/test_packaging.py: the project-page metadata fields, thepy.typedmarker, and the sdist allow-list. Each was confirmed failing against the oldconfiguration before the fix, per the project's TDD rule.
The sdist test checks the declaration rather than building a tarball, so it stays a
millisecond-scale unit test. It cannot prove the output is small; it catches the
regression that would make it large again. The size claims above come from an actual
build.
Not changed
Development Status :: 3 - Alphaand thedescriptionare left as they are. Say theword if the next release should advertise Beta.
🤖 Generated with Claude Code