beeware / briefcase

Tools to support converting a Python project into a standalone native application.
https://briefcase.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2.59k stars 365 forks source link

[pyproject.toml] Can't let tool.briefcase.version = "{project.version}" #1675

Closed Pairman closed 6 months ago

Pairman commented 6 months ago

Describe the bug

Hello. I'm making my project also a python module to let users use its core services in cli.

I added [project] and [tool.setuptools.packages.find] in pyproject.toml to achieve this, and made [tool.briefcase] and [tool.briefcase.app.xdcheckin] reference the corresponding terms under [project], to avoid multiple definitions.

This works great for installing my project as a module and importing its packages. However, it conflicts with briefcase:

$ briefcase package -v
Briefcase configuration error: Version number ({project.version}) is not valid.

Version numbers must be PEP440 compliant; see https://www.python.org/dev/peps/pep-0440/ for details.

This is my pyproject.toml. Is there any way to fix/bypass this? Or will briefcase support this feature? Thanks in advance.

Steps to reproduce

  1. In pyproject.toml, create [project] and define the version number here.
  2. Make tool.briefcase.version reference project.version via
    [tool.briefcase]
    version = "{project.version}"
  3. Run briefcase package and it will fail.

Expected behavior

Briefcase parses pyproject.toml and packages successfully.

Screenshots

No response

Environment

Logs

No response

Additional context

No response

rmartin16 commented 6 months ago

crosslinking:

freakboy3742 commented 6 months ago

I'm going to close this on the basis that there is no documentation or convention that I'm aware of that would suggest that "{project.version}" is valid syntax.

If the issue is that you want to use PEP621 syntax to define project metadata and not repeat those values in the tool.briefcase section, you can do so; the tool.briefcase block will inherit many PEP621 values that have an interpretation.

Pairman commented 6 months ago

I'm going to close this on the basis that there is no documentation or convention that I'm aware of that would suggest that "{project.version}" is valid syntax.

If the issue is that you want to use PEP621 syntax to define project metadata and not repeat those values in the tool.briefcase section, you can do so; the tool.briefcase block will inherit many PEP621 values that have an interpretation.

Thank you!