Skip to content

Use default license-files in flit init#734

Closed
AA-Turner wants to merge 1 commit intopypa:mainfrom
AA-Turner:init-license-files
Closed

Use default license-files in flit init#734
AA-Turner wants to merge 1 commit intopypa:mainfrom
AA-Turner:init-license-files

Conversation

@AA-Turner
Copy link
Contributor

The default license-files glob is ['COPYING*', 'LICEN[CS]E*'], which is broader than what's currently set in flit init, importantly permitting file extensions. I think it makes sense to use the default glob here?

A

@AA-Turner AA-Turner force-pushed the init-license-files branch from d8c1930 to c8372fc Compare March 3, 2025 00:27
f.write(tomli_w.dumps({'readme': readme}))
if license != 'skip':
f.write(tomli_w.dumps({'license': license_names_to_spdx[license]}))
f.write(f"license-files = {json.dumps(['LICENSE'])}\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a dedicated license-files = ['LICENSE'] line to pyproject.toml does have the benefit that it's directly visible to the user. No need to lookup what the exact key is.

I'd suggest to keep it as is.

Copy link
Contributor Author

@AA-Turner AA-Turner Mar 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, my main complaint was that this didn't allow for an extension, so perhaps?:

Suggested change
f.write(f"license-files = {json.dumps(['LICENSE'])}\n")
f.write(f"license-files = {json.dumps(['LICENSE*'])}\n")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, my main complaint was that this didn't allow for an extension

Does it need to though? I believe the value here is designed to match the initial config. If the license file name is changed, flit would also emit an error as the pattern didn't match any file, which would lead the user to update it.

@AA-Turner
Copy link
Contributor Author

Closing, this PR had marginal value, and justifiable concerns have been raised.

A

@AA-Turner AA-Turner closed this Mar 5, 2025
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.

2 participants