-
-
Notifications
You must be signed in to change notification settings - Fork 474
Open
Labels
enhancementNew features, or improvements to existing features.New features, or improvements to existing features.
Description
What is the problem or limitation you are having?
After running pip install . in a briefcase project using toga, briefcase dev will crash with "Toga application must have a formal name". That's quite confusing and not helpful.
Why does this happen?
pyproject.tomlis present, sopiprecognizes the directory as a valid Python package.pyproject.tomldoes not contain PEP 621 project metadata (sectionproject), sopipuses default values:Version: 0.0.0,Name: <your-project-dirname>.pipdoes NOT pick up the briefcase project metadata from the sectiontool.briefcase.
pipcreatessrc/<your-package>.egg-info/containing this minimal set of project metadata.briefcase devcreatessrc/<your-package>.dist-info/with the correct metadatatoga.app.App.__init__()usesimportlib.metadata.metadata(sys.modules["__main__"].__package__).get("Formal-Name")to get theFormat-Namemetadata, which is not present in theegg-info, so it raises a RuntimeError.
Maybe the tutorial should be clearer about when to use pip vs when not to use pip.
Describe the solution you'd like
I don't know enough about Python packaging, metadata discovery, egg-info vs dist-info and probably other relevant topics. I hope that someone else can pick up from here to find a solution.
Describe alternatives you've considered
Potential approaches (some way be wrong/bad/impossible):
briefcase devaborts with a useful error message ifegg-infoexists.briefcase devignoresegg-info, sotogauses the correct metadata fromdist-info.pip install .fails instead of being "accidentally successful".pip install .finds the correct metadata.briefcase devcreates/overwritesegg-infoinstead ofdist-info.- Update the tutorial to provide better guidance on when to use and not to use
pipvsbriefcasevs modifyingpyproject.toml.
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew features, or improvements to existing features.New features, or improvements to existing features.