From e3d6d7242516d35ac113e3afc7f3d6f836c064c6 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Sat, 6 Oct 2018 22:00:08 +0200 Subject: [PATCH] Add the MIT license by default. --- README.md | 16 ++++++++++++++-- {{cookiecutter.package_name}}/LICENSE.rst | 21 +++++++++++++++++++++ {{cookiecutter.package_name}}/setup.py | 2 ++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 {{cookiecutter.package_name}}/LICENSE.rst diff --git a/README.md b/README.md index 8023356..868d750 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Usage git clone https://github.com/kragniz/cookiecutter-pypackage-minimal.git cookiecutter cookiecutter-pypackage-minimal/ -You should then change the classifiers in `{{ package_name }}/setup.py` - it is assumed that the project will run on the latest versions of Python 2 and 3, so you should remove any classifiers that do not apply. The full list of PyPI classifiers can be found [here](https://pypi.python.org/pypi?:action=list_classifiers). +You should then change the classifiers in `{{ package_name }}/setup.py` - it is assumed that the project will run on the latest versions of Python 2 and 3, so you should remove any classifiers that do not apply. The full list of PyPI classifiers can be found [here](https://pypi.org/classifiers/). -Fill out the README, and - if necessary - add a license to the project. +Fill out the README, and - if necessary - [choose a license](https://choosealicense.com/) for the project. Explanation ----------- @@ -26,6 +26,18 @@ The decisions `cookiecutter-pypackage-minimal` makes should all be explained her * **As few README files as possible** Additional README files (AUTHORS, CHANGELOG, etc) should be left to the user to create when necessary. +### LICENSE + +* **LICENSE can use reStructuredText format** + The provided license file use reStructuredText format. Of course you can decide to use a text format or even [Markdown](https://en.wikipedia.org/wiki/Markdown). It's up to you to choose the format which best satisfies your needs. +* **MIT license by default** + This template provides you the classic [MIT](https://choosealicense.com/licenses/mit/) licence: it lets people do almost anything they want with your project, including to make and distribute closed source versions. + If you [choose another license](https://choosealicense.com/), you also need to update the `{{ package_name }}/setup.py` file: + adjust the `classifiers` and `license` fields accordingly. +* **A license is a requirement** + Nowadays, people who want to use your library/application want to make sure they can do it legally. + If your library is a private library, you can use a private license. In the `{{ package_name }}/setup.py` file, set `license="Proprietary"`, and choose `'License :: Other/Proprietary License'` in the trove classifiers. + ### `setup.py` * **Use setuptools** diff --git a/{{cookiecutter.package_name}}/LICENSE.rst b/{{cookiecutter.package_name}}/LICENSE.rst new file mode 100644 index 0000000..4d90eae --- /dev/null +++ b/{{cookiecutter.package_name}}/LICENSE.rst @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) {% now 'local', '%Y' %} {{ cookiecutter.author_name }} + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/{{cookiecutter.package_name}}/setup.py b/{{cookiecutter.package_name}}/setup.py index 99b3a27..1457c6f 100644 --- a/{{cookiecutter.package_name}}/setup.py +++ b/{{cookiecutter.package_name}}/setup.py @@ -17,6 +17,7 @@ setup( name="{{ cookiecutter.package_name }}", version="{{ cookiecutter.package_version }}", url="{{ cookiecutter.package_url }}", + license='MIT', author="{{ cookiecutter.author_name }}", author_email="{{ cookiecutter.author_email }}", @@ -30,6 +31,7 @@ setup( classifiers=[ 'Development Status :: 2 - Pre-Alpha', + 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7',