-
Notifications
You must be signed in to change notification settings - Fork 30
README
| Info: | This is the README file for the Python Project Template. |
|---|---|
| Author: | Chris Warrick <chris@chriswarrick.com> |
| Copyright: | © 2013-2015, Chris Warrick. |
| License: | BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.) |
| Date: | 2015-07-03 |
| Version: | 1.3.0 |
-
zshinstalled (required by/releaseand/.pypt/localegenscripts) - Python with
requests(required by/.pypt/{commitlog,ghrel}) andtwine(required by/release) installed -
git-flow extensions by nvie (alternatively yo can manually alter the
/releasescript, and that is much harder than installing the extensions) - A git repository. The PyPT is ready to go if you use GitHub. If you do not
want GitHub, edit the
/PKGBUILD{,-2}{,-git}files and any other places where GitHub is mentioned, including this document which you should edit mentally.
- Travis CI account (if you do not want Travis CI, remove
/.travis.yml)
The template contains the following files to get you started:
- pre-configured Sphinx with:
-
CONTRIBUTING.rstguide (used by GitHub when sending a pull request or an issue) LICENSE.rst- an empty
CHANGELOG.rst - this (worthless for most people)
README.rstand a bare-bonesindex.rstpage
-
- The exact same files in
/, which are fragile and MAY NOT be modified as they are replaced with copies in/docsby thereleasescript -
__init__.pyandtemplate.pyfiles in the Python package directory - A good-enough
setup.pyfile -
tests/containing some Is My Python Sane?-style tests (usingpy.test) - An automated global update script (
.pypt/PYPT-UPDATE) - Entry points configuration ready to be uncommented
- Addons for Qt users
- PKGBUILDs for the Arch Linux User Repository (AUR)
- A state-of-the-art
releasescript, the operations of which are:- querying the current branch for version number
- updating
/docs/CHANGELOG.rst - bumping the version number in all the files, changing dates where necessary
- copying over
/docs/README.rst,/docs/CHANGELOG.rstand/docs/CONTRIBUTING.rstto/ - locale generation (via the
.pypt/localegenscript) - running
import $projectand the testsuite - committing into git, finishing the
git flowrelease - creating a GitHub Releases entry
-
Create the repository for the project on GitHub and enable it on Travis CI.
-
Manually change
Kwpolskato your GitHub name in the following files:-
/docs/README.rst, line 10 -
/docs/CHANGELOG.rst, line 10 -
/setup.py, line 14 -
/PKGBUILD{,-2}{,-git}, inurlandsource(git only)
-
-
Manually change the
Maintainerline in/PKGBUILD{,-2}{,-git}. -
Replace the following patterns (eg. with sed), in all files, excluding dotfiles:
-
TEMPLATEwith the full name of the project -
tEmplatewith a “light” name of the project [a-z0-9_\-], which will be used in the PyPI, AUR, and a few other places. You can use capital letters if you feel like it, but it is discouraged and was not tested. -
python-project-templatewith the GitHub repo name -
INSERT TAGLINE HERE.with a tagline of your choice -
chris@chriswarrick.comwith your e-mail address -
Kwpolskaand/orChris Warrickwith your name (affects mostly copyright notices)
WARNING: some files are in the copyright of Chris Warrick and must stay this way! They are listed in the license, please keep my name there, otherwise you risk breaking the law.
-
-
Rename
/tEmplateto the name used in 4.2. -
Modify
/docs/README.rstto reflect your project and not the Template (and make a copy if you are reading it locally from those files) -
Copy: (when using the included
releasescript, it happens automatically)-
/docs/README.rstto/README.rstand/README -
/docs/CHANGELOG.rstto/CHANGELOG.rst
-
-
Modify
/.pypt/config. -
Generate a GitHub Personal Access Token and write it to a
/.pypt/gh-tokenfile. -
Customize
/setup.pyto your liking. You should pay attention to the classifiers and the commented parts. -
Customize
requirements.txt. -
If you are using PyQt4 or PySide, make sure to put your UI code in a
uisubmodule. Copy over the/QT-ADDONS/resources.pyfile to that submodule, even if you are not using resources now. -
Remove the
/QT-ADDONS/directory. -
If you are using Qt, make sure to create a
.profile with your sources and locales. -
Read the COPYRIGHT section below (or
LICENSE.PyPT) and remove/LICENSE.PyPTand/README.PyPT. If you believe the BSD license presented by the/LICENSEfile is not the license you want, here is a list of files you should modify:/tests.py- Everything in the Python package directory (twice in many cases)
- Everything in
/docs -
/LICENSE, which is not equivalent to/docs/LICENSE.rst
PS. GNU GPL is not a good idea. You can use it, but the world would be much happier if you did not.
-
If you have a
PYPT-UPDATEscript, add your new project to the list there. If not, you may want to copy it from.pyptand set it up. -
Run the following commands:
rm -rf .git .pypt/PYPT-UPDATE source .pypt/config git init git remote add origin git@github.com:$GITUSER/$GITREPO git flow init #(change version tag prefix to `v`) git add * git checkout develop git commit -sm 'initial commit via @Kwpolska’s Python Project Template' git checkout master git merge --ff-only develop git push -u origin master develop
Python Project Template is licensed under a BSD-like license. You are free to relicense your code to another open source license. If you want to apply a commercial (a.k.a. proprietary) license, you must contact me first.
However, the following files must remain under the BSD license:
- /.pypt/commitlog
- /.pypt/ghrel
- /.pypt/localegen
- /.pypt/PYPT-UPDATE
- /.pypt/README.rst
- /.pypt/LICENSE.PyPT
- /docs/CONTRIBUTING.rst
- /CONTRIBUTING.rst
- /release
This README file MAY NOT be relicensed.
Copyright © 2013-2015, Chris Warrick. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the author of this software nor the names of contributors to this software may be used to endorse or promote products derived from this software without specific prior written consent.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.