Repository navigation
Release 2.1.0: bug fixes, CLI, and Trusted Publishing with provenance - #3
Merged
Merged
Conversation
Fixes: - resolve exclusions against the site root so a site below a folder that matches an exclusion (e.g. 'media') is no longer wiped out - percent-encode URLs (spaces, '#', '&', non-ASCII) so sitemaps are valid - match extensions case-insensitively and never treat 'x.html.bak' as HTML - honour documented priority keys such as 'blog/' and '.PHP' - validate root_path/base_url/max_urls, clamp priorities to 0.00-1.00 - sort and de-duplicate entries for reproducible output - drop stale split parts and write output atomically - replace the minidom round-trip with a fast streaming XML writer New: - localsitemap CLI (also 'python -m localsitemap') - glob exclusions, exclude_hidden, include_homepage, sort_entries options - generate_sitemap() now returns the list of written files Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Metadata now lives in pyproject.toml (PEP 621 + PEP 639 license expression) and the version is read from localsitemap/_version.py, so the release workflow no longer has to sed setup.py. setup.py is kept as a compatibility shim. Python 3.9+ is required to build; 3.6-3.8 remain served by 2.0.0. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
- build job: run the tests, derive the version from the tag, build and twine-check the distributions, then upload them as artifacts - publish job: no API token and no 'environment:' key, only 'id-token: write', using pypa/gh-action-pypi-publish with attestations - new verify-provenance job queries the PyPI Integrity API and fails the release if any published file lacks provenance - add a tests workflow (lint, 3.9-3.14 matrix on Linux plus Windows, and a build/install smoke test) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Manual 'Run workflow' executions now only build and validate the distributions, so the pipeline can be exercised safely before the PyPI trusted publisher is configured. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.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.
LocalSiteMap 2.1.0
Prepares the next release: a round of bug fixes, a new CLI, modern packaging, and a
Trusted Publishing release pipeline with verified provenance.
Bug fixes
media) had every URL excluded, because matching ran against the absolute path#,&,?or non-ASCII produced invalid, uncrawlable<loc>valuesmy page.html→my%20page.html)PAGE.HTMLwas silently skipped,allowed_extensions=["txt"]etc. handled inconsistently"blog/"never matched, and".PHP"didn't apply to.phproot_path,base_url="example.com"andmax_urls=0wrote broken/empty sitemapsNotADirectoryError/ValueError;max_urlsabove 50 000 is clamped; priorities clamped to0.00–1.00<loc>possiblesitemap_N.xmlparts; truncated files on interruptionminidomround-trip rewrote the whole document in memory and emitted blank linesNew
localsitemapCLI /python -m localsitemap(exclusions, extensions, priorities, JSON priority map).draft-*,*.bak), plusexclude_hidden,include_homepage,sort_entries.generate_sitemap()returns the files it wrote.Packaging & release pipeline
pyproject.toml(PEP 621, PEP 639 license expression); version read fromlocalsitemap/_version.py;setup.pykept as a shim.setuptools>=77, needed for the non-deprecated license metadata) requires it.2.0.0still serves 3.6–3.8 automatically via pip.build_and_publish.ymlnow publishes with PyPI Trusted Publishing (id-token: write, no password/token, noenvironment:key — the PyPI publisher is configured with a blank environment) and signs every file with PEP 740 attestations (attestations: true).verify-provenancejob queries the PyPI Integrity API after upload and fails the release if any published file has no provenance, so the PyPI provenance indicator (and the new README badge) is always accurate.tests.ymlworkflow: ruff lint, Python 3.9–3.14 on Linux + Windows, and a build/install smoke test.build_and_publish.yml) so existing tag pushes keep working.Release checklist for the maintainer
localsitemap: repositoryInfinitode/LocalSiteMap, workflowbuild_and_publish.yml, environment left blank.git tag 2.1.0 && git push origin 2.1.0— the workflow builds, tests, publishes and verifies provenance.