Skip to content

Normalize project name - #3012

Open
kaminimangal wants to merge 13 commits into
beeware:mainfrom
kaminimangal:normalize-project-name
Open

Normalize project name#3012
kaminimangal wants to merge 13 commits into
beeware:mainfrom
kaminimangal:normalize-project-name

Conversation

@kaminimangal

Copy link
Copy Markdown

Fixes #3011

This PR normalizes how project_name is handled in Briefcase, per the issue:

  1. In the new and convert wizards, the project name now defaults to
    the app name instead of the formal name, and is validated using the
    same rules as app name.

  2. If a project defines a PEP 621 name in [project], it's now used
    as the project_name (normalized), as part of the PEP 621 merge step.

  3. If a legacy project_name is set in [tool.briefcase] and it isn't
    PEP 621 compliant, Briefcase now warns instead of erroring, since this
    may become an error in a future version.

Tests were added/updated to cover all three changes.

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

Assisted-by: Claude

…t wizards

The project name should default to the app name (machine-readable),
not the formal name, matching PEP 621 conventions. Updates both the
'briefcase new' and 'briefcase convert' wizards, plus adds test
coverage for the convert command's default (previously untested).

Assisted-by: Claude
…ards

Per the issue, project_name in the interactive wizard should be
validated with the same PEP508 rules as app_name, not accepted as
arbitrary text. Updates existing tests to use valid app-name-style
values for project_name fixtures.

Assisted-by: Claude
Implements the remaining parts of the project_name normalization:
- merge_pep621_config now maps PEP621 'name' to Briefcase's
  project_name (canonicalized), when no legacy project_name is set.
- A legacy project_name in [tool.briefcase] still takes priority,
  but is checked for PEP621 compliance; a non-compliant value
  triggers a warning rather than an error, with a note that this
  may become an error in future.
- parse_config runs the merge step even when there's no [project]
  table, so the legacy-name warning still fires in that case.

Assisted-by: Claude
Assisted-by: Claude
Assisted-by: Claude
Assisted-by: Claude
Covers the case where neither a legacy project_name nor a PEP621
name is present, ensuring 100% branch coverage.

Assisted-by: Claude
Covers the case where a legacy project_name is present and valid,
so no warning is raised. Should resolve the remaining branch
coverage gap (1316->1325).

Assisted-by: Claude
Assisted-by: Claude
@freakboy3742

Copy link
Copy Markdown
Member

Thanks for the PR; just checking that you've noticed the CI failure.

Briefcase's contribution guide contains full details on how to set up a development environment and run the test suite so you can avoid CI surprises like the ones you've had in submitting this PR.

@freakboy3742

Copy link
Copy Markdown
Member

Are you planning to address these CI failures, or should we close this PR so someone else can pick up the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize usage of project_name

2 participants