rye icon indicating copy to clipboard operation
rye copied to clipboard

Generate LICENSE file(s) for rye's init command

Open patrickarmengol opened this issue 2 years ago • 7 comments

rye's init command already references an MIT license in the default generated README.md and pyproject.toml. Should it also generate the relevant LICENSE file?

Perhaps rye could also add a cli option for init that lets the user specify which license(s) they would like to use, specified by SPDX identifiers.

rye init --license "Apache-2.0"

patrickarmengol avatar May 03 '23 18:05 patrickarmengol

hatch generates an empty license file during initialization, and it is up to the user to add the details.

And https://peps.python.org/pep-0639/

ischaojie avatar May 04 '23 03:05 ischaojie

the optional args license should check.

CharlesChen0823 avatar May 04 '23 05:05 CharlesChen0823

Also, I think all these custom fields should be filled in interactively by the user, for example rye init --interactive will go to interactive mode, where the user can specify name, description, etc.

ischaojie avatar May 04 '23 07:05 ischaojie

Also, I think all these custom fields should be filled in interactively by the user, for example rye init --interactive will go to interactive mode, where the user can specify name, description, etc.

Is this preference or is there something missing by not having a more interactive experience? I'd prefer rye doesn't do this, but maybe I'm missing something.

cnpryer avatar May 04 '23 12:05 cnpryer

hatch generates an empty license file during initialization, and it is up to the user to add the details.

I'm not sure why you end up with empty files, but hatch generated license files are filled for me. It even fills in my author name where possible. Perhaps you are giving it an invalid SPDX identifier.

Looks like it reaches out to download license files from the SPDX license-list-data repo.

And https://peps.python.org/pep-0639/

hatch / hatchling supports this PEP, and uses it in generated pyproject.toml, but the PEP is still a draft, so maybe we can hold off until it's accepted?

patrickarmengol avatar May 04 '23 13:05 patrickarmengol

Is this preference or is there something missing by not having a more interactive experience? I'd prefer rye doesn't do this, but maybe I'm missing something.

The interactive approach makes it easier to guide the user in creating the project, but of course it would be better to provide options command as well~

ischaojie avatar May 04 '23 15:05 ischaojie

I'm not sure why you end up with empty files

Sorry for misleading.

ischaojie avatar May 04 '23 15:05 ischaojie

This is implemented now.

mitsuhiko avatar May 07 '23 22:05 mitsuhiko