Provide an wizard for existing apps #1202
Labels
enhancement
New features, or improvements to existing features.
good first issue
Is this your first time contributing? This could be a good place to start!
What is the problem or limitation you are having?
briefcase new
works well for bootstrapping a new project from scratch. However, if you have an existing project, the wizard can't really be used - your only option is to write (or update) yourpyproject.toml
config from scratchDescribe the solution you'd like
Briefcase should have an option (
briefcase new --sources src/myapp
) that can be used to set up an existing project with Briefcase. This mode would ask the usual wizard questions, use the location specified by--sources
, and write a first draft of apyproject.toml
- updating the existingpyproject.toml
if it already exists.Describe alternatives you've considered
Treat this problem as a documentation issue.
Additional context
The easiest approach will likely be to use the cookiecutter new project template to generate a full dummy project config into a temporary directory, then merge the
pyproject.toml
in the dummy with the one that the project already has, and then clean up the temporary directory.When the user specifies a sources of
src/myapp
, there should be some error detection to ensure that:__main__.py
Once that has been verified, there's no need to ask the user for the appname - it should be the tail of the path given to
--sources
(i.e.,--sources src/myapp
would be an app name ofmyapp
). The user should still be asked for formal name, bundle etc.It may also be necessary to provide a
--test-sources
option so that the user can optionally specify the location of their test code.--test-sources
but not--sources
should be an error;--sources
is specified, but--test-sources
isn't, the template should be written as if there are no test sources;--sources
and--test-sources
is specified, the testing entry script generated by the dummy template should be copied into the test sources folder.When in
--sources
mode, the wizard should also audit the project to highlight any extra files that may be needed. For example, the default template generates a LICENSE and CHANGELOG file - if these aren't present in the existing project, the user should be warned that they should add them (or copy over the versions from the dummy project with a warning that dummy content has been added).The text was updated successfully, but these errors were encountered: