-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: accept other filenames for LICENSE #327
Conversation
The added filenames are LICENCE and COPYING, both of which are commonly used. There might be others accepted by GitHub, but the list can easily be extended. This check could be a little slower due to having to do three times the number of string comparisons, but hoefully that is counteracted by the switch to using a generator, ensuring that an intermediate list doesn't have to be built, and that the check can terminate as soon as a file is found. Fixes #326
The full list from the draft PEP 639 and what I've used elsewhere is |
Co-authored-by: Henry Schreiner <[email protected]>
As It is also currently case sensitive, as that is the common convention. |
But "GPL-LICENSE.txt" would not be a valid license name according to PEP 639, it would need to be "LICENSE-GPL.txt". That auto-search is implemented in several places, like hatchling, scikit-build-core, setuptools, pdm. Also poetry and flit, though those are one LICENSE spelling only, does cover COPYING* too. All of these expect the name at the start of the file. |
Fair enough. I'll swap to checking it is at the start. |
Okay, sounds good, I'll trigger the CI once you are done. |
Actually, I think pre-commit did it for me. :) |
Should all be good now. |
Thanks! |
The added filenames are LICENCE and COPYING, both of which are commonly used. There might be others accepted by GitHub, but the list can easily be extended.
This check could be a little slower due to having to do three times the number of string comparisons, but hopefully that is counteracted by the switch to using a generator, ensuring that an intermediate list doesn't have to be built, and that the check can terminate as soon as a file is found.
Fixes #326