Skip to content

Provide an wizard for existing apps #1202

@freakboy3742

Description

@freakboy3742

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) your pyproject.toml config from scratch

Describe 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 a pyproject.toml - updating the existing pyproject.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:

  1. The specified path exists
  2. It contains a __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 of myapp). 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.

  1. Specifying --test-sources but not --sources should be an error;
  2. if --sources is specified, but --test-sources isn't, the template should be written as if there are no test sources;
  3. If --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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features, or improvements to existing features.good first issueIs this your first time contributing? This could be a good place to start!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions