cookiecutter-django icon indicating copy to clipboard operation
cookiecutter-django copied to clipboard

Added all open source licenses (Fixes #2941)

Open Andrew-Chen-Wang opened this issue 4 years ago • 4 comments

Description

Use licenses that we see on GitHub when we create a new repo. Also included is automatic updating of the licenses from the aforementioned license repository created by GitHub. The cookiecutter.json file is also updated.

  • Uses open source licenses (including the Jekyll format) from https://github.com/github/choosealicense.com/tree/gh-pages/_licenses
  • Added license section in README.rst because some licenses want it to be explicit
  • cookiecutter.json shows all licenses (including "Not open source") in lexicographical order except for "Not open source"

Checklist:

  • [X] I've made sure that tests/test_cookiecutter_generation.py is updated accordingly (especially if adding or updating a template option)
  • [ ] I've updated the documentation or confirm that my change doesn't require any updates

Docs haven't been updated because honestly... I don't know if we want to show ALL of those licenses...

Rationale

Fixes #2941

Lots of open source licenses... too many to choose.

Makes it easier to maintain since we can just use GitHub actions to constantly update the files if necessary.

Andrew-Chen-Wang avatar Feb 27 '21 05:02 Andrew-Chen-Wang

Oooo that's an... interesting error to deal with...

Andrew-Chen-Wang avatar Feb 27 '21 05:02 Andrew-Chen-Wang

Something that can make sure commits decrease in the automatic workflow is to check if the license file already exists since licenses don't change due to their copyright reasons. That means we should only commit if there's a difference in cookiecutter.json (i.e. any new license).

Additionally, it might be better to also include the MIT license, Apache, etc. near the front like "Not open source" license is in cookiecutter.json.

Andrew-Chen-Wang avatar Feb 27 '21 06:02 Andrew-Chen-Wang

Just realized we should instead make a pull request instead of committing directly in case of a new file since there would be square brackets.

Andrew-Chen-Wang avatar Feb 27 '21 16:02 Andrew-Chen-Wang

@browniebroke I'll be creating a new PR at some point in the long distance future. Looks like I completely missed their (new?) API that includes the licenses: https://docs.github.com/en/rest/reference/licenses#get-a-license

Andrew-Chen-Wang avatar Jul 27 '21 09:07 Andrew-Chen-Wang

#3982 would resolve this

Andrew-Chen-Wang avatar Dec 12 '22 01:12 Andrew-Chen-Wang