pypa / hatch

Modern, extensible Python project management
https://hatch.pypa.io/latest/
MIT License
6.11k stars 309 forks source link

[Issue] Wrong license format generated with `hatch new` #1591

Closed Diogo-Rossi closed 5 months ago

Diogo-Rossi commented 5 months ago

The format of the license key should be a table, according to the specification.

Example:

license = {file = "LICENSE.txt"}

But hatch new writes it as a simple string:

license = "MIT"

I tried to build a package after editing some sections of the file pyproject.toml.

I changed the build system to setuptools, because I need to share this project. I also removed all the sections specific to hatch.

When I tried to build the package, setuptools complained about the license key under the [project] section, which seems to be a correct behaviour.

ofek commented 5 months ago

Hey, thanks for reporting even though you no longer use Hatch! This is correct behavior because we support the new format that was always planned: https://peps.python.org/pep-0639/

Out of curiosity, can you please explain why you had to switch the build system? There might be something I can help you with instead.

Diogo-Rossi commented 5 months ago

Thanks for the reply.

Sorry, I wasn't aware of that PEP. Only now I searched the format from the guide.

I will keep using hatch for my own projects. Only for this project I needed to change the build to setuptools because of the requirements of the team.

So... am I right to say that setuptools is not yet adapted to the new standard, right?

ofek commented 5 months ago

Yes, that is correct!

Diogo-Rossi commented 5 months ago

Thanks!