Stop splitting exclude and cleanup globs on commas; prepare 5.0.0 - #253
Merged
Merged
Conversation
--exclude, --cleanup-app-files and --cleanup-package-files used the
args package default splitCommas: true, so a path containing a comma
became several exclusions and brace globs like **/{tests,docs} were
split into broken halves. Disable comma splitting for the three
options, like --requirements, and pass each value as its own option.
This changes the package command's CLI contract (a comma-separated
value is now one path), so bump all packages to 5.0.0 and document
exclude/cleanup options in the README.
Refs flet-dev/flet#6839
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.
Needed for flet-dev/flet#6890 (flet-dev/flet#6839).
Problem
--exclude,--cleanup-app-filesand--cleanup-package-filesare declared with theargsdefaultsplitCommas: true, so every value is split on commas, even when the option is repeated:.a,main.pywould become the exclusions.aandmain.py, dropping the app's entry point.--cleanup-package-files '**/{tests,docs}'becomes the two broken globs**/{testsanddocs}.Change
splitCommas: falseonexclude,cleanup-app-filesandcleanup-package-files, matchingrequirements. Help texts now say each option can be used multiple times.archkeeps splitting: its values are fixed ABI names, and Flet passes them comma-joined.--excludeglobs", since excludes are exact paths.Why a major version
This changes the
packageCLI contract, and the breakage is silent:--exclude build,testsis now one path, so nothing is excluded and there's no error. The Dart API and runtime are unchanged.flet buildpins serious_python exactly (serious_python: 4.7.1in its template), so existing Flet releases are unaffected. Flet switches to repeated flags together with the 5.0.0 pin.Testing
dart analyze bin: no issues.package --helpshows the new help texts.package app -p Emscripten --exclude ".a,main.py" --exclude build --cleanup-app --cleanup-app-files '**/{tests,docs}'on a test app:app.zipcontains onlymain.pyandpkg/keep.txt. So.a,main.pyandbuild/were excluded,main.pywas kept, and bothtests/anddocs/were cleaned.