Skip to content

Support PEP 639 license metadata #2146

@dunossauro

Description

@dunossauro

What is the problem or limitation you are having?

When we already have a pyproject.toml file created, if it follows PEP 639, we encounter an issue when creating a package with briefcase.

Examples:

pyproject.toml file:

[project]
name = "Example"
version = "0.1.0"
description = ""
authors = [
    {name = "Your Name",email = "you@example.com"}
]
# license = {file = "LICENSE", text = 'BSD'} # PEP 621 format
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
    "httpx (>=0.28.1,<0.29.0)",
]
# PEP 639 format
license = 'BSD'
license-files = ["LICEN[CS]E*"]

# ...
[tool.briefcase]
project_name = "Example"
bundle = "com.example"
version = "0.1.0"

[tool.briefcase.app.example]
formal_name = "Example"
sources = ['example']

Briefcase create command:

briefcase create

*************************************************************************
** WARNING: License Definition for the Project is Deprecated           **
*************************************************************************

    Briefcase now uses PEP 621 format for license definitions.

    Previously, the name of the license was assigned to the 'license'
    field in pyproject.toml. For PEP 621, the name of the license is
    assigned to 'license.text' or the name of the file containing the
    license is assigned to 'license.file'.

    The current configuration for the Project has a 'license' field
    that is specified as a string:

        license = "BSD"

    To use the PEP 621 format (and to remove this warning), specify that
    the LICENSE file contains the license for the Project:

        license.file = "LICENSE"

*************************************************************************

Some links:
PEP 639: https://peps.python.org/pep-0639/
PyPA recommendations for defining the license field: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
pyproject specification by PyPA: https://packaging.python.org/en/latest/specifications/pyproject-toml/#license

Describe the solution you'd like

Support for both PEPs?

Describe alternatives you've considered

Currently, I am using fields defined from PEP 261

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features, or improvements to existing features.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions