-
-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow creating projects with an app that starts with a number #2127
Comments
... huh. I'm more than a little surprised by this one, honestly. I didn't know that PEP 508 allowed specifying a module name that isn't valid Python module... I guess it makes sense, though, as there's no hard requirement that the module installed by a PyPI package matches the name of the PyPI package. |
Can I take up this issue? Will send out updates on progress and blockers if any! |
@manognya-b Absolutely! We don't formally assign bugs, so feel free to submit a fix (and an update for the existing test!) |
Hello again, I've disallowed app names that begin with numbers and it is working as expected and rejecting both single and multiple character strings that begin with numbers. However, I noticed a phenomenon where app names that contain a "." character are being parsed incorrectly during the
As seen above, the app name (Something interesting: the reference regex is allowing numbers to be used at the beginning of strings?) Would this be a separate issue as it could be related to how briefcase is parsing app names? Thanks! |
Nice catch! I can confirm that's the behaviour I'm seeing as well.
I think this is pointing at the root of the problem - PEP508 compliance is clearly the wrong rule to be applying here. There are plenty of names that are valid PyPI package names, but have no meaningful way to be used as module names. It looks like we actually need a strict subset of PEP 508 - identifiers that are valid PEP 508, but can also be converted into a valid identifier. Thankfully, the latter can be validated using (of course, we then also need to update all the places in the documentation and help strings where we say "PEP 508" is the rule for app names...) |
Describe the bug
It is possible to create projects with an app that starts with a number but this is not valid.
Steps to reproduce
Run
briefcase new -Q app_name=1hello --no-input && cd 1hello && briefcase dev
Expected behavior
App names that begin with a number should not be allowed.
Screenshots
No response
Environment
0.3.21.dev125+gdced62d4
Logs
briefcase.2025_01_21-00_06_20.dev.log
Additional context
No response
The text was updated successfully, but these errors were encountered: