Repository navigation
fix(setup): normalize short name boundaries for package validity - #292
Merged
c-vigo merged 3 commits intoMar 13, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a release-blocking bug where sanitized project names could end with _, producing invalid Python package names in pyproject.toml. Adds boundary normalization to both install paths and a regression test.
Changes:
- Harden
sanitize_name()ininstall.shand mirrored logic ininit-workspace.shto collapse duplicate underscores, strip non-alphanumeric boundaries, and fallback to"project" - Add regression test verifying trailing-separator trimming
- Record the fix in
CHANGELOG.md
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| install.sh | Enhanced sanitize_name() with boundary normalization and empty fallback |
| assets/init-workspace.sh | Mirrored the same normalization inline |
| tests/test_install_script.py | Added regression test for trailing-separator trimming |
| CHANGELOG.md | Added Fixed entry for #291 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Fixes a release-blocking edge case where sanitized project names could end with
_, producing an invalidpyproject.tomlpackage name during install/integration flows. Adds a regression test, applies boundary-safe normalization in both install paths, and records the fix in the changelog.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
tests/test_install_script.pytest_dry_run_name_sanitization_trims_trailing_separator.--name "Install-Test-Project-"becomesinstall_test_project(no trailing underscore).install.shsanitize_name()to collapse duplicate underscores, trim non-alphanumeric boundaries, and fallback toprojectwhen empty.assets/init-workspace.shCHANGELOG.md### Fixedentry for issue#291under the active0.3.0section.Changelog Entry
Fixed
install.shnow normalizes sanitized project names to ensure they start/end with alphanumeric characters before passingSHORT_NAMEinit-workspace.shmirrors the same normalization so generatedpyproject.tomlnames cannot end with separators like_Testing
just test)Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
release/0.3.0Refs: #291