ProjectTemplates

Last modified 4 years ago Last modified on 03/19/2014 02:12:26 PM

This Python package provides project templates for use with PasteScript. Currently there is one template for a basic Python package project. A project created from this template will be ready to be distributed via distutils and setuptools to the Python Package Index (PyPI).

git clone https://chrisarndt.de/git/project-templates.git

Installation

$ git clone https://chrisarndt.de/git/project-templates.git
$ cd project-templates
$ [sudo] python setup.py install

Note: Unfortunately, PasteScript still only works with Python 2, so you'll need Python 2 installed to install & run it. The projects created with the template provided here, however, will be Python 3 compatible (unless your own code introduces incompatibilities).

How to use

$ paster create -t chrisarndt MyNewProject

This will prompt for some basic info about the project (version number, keywords, author, email and license) and then will create a directory with the given project name in the current directory, which contains all the files for a setuptools-ready Python project. The package name will be derived from the project name by lowercasing it and replacing dashes with underscores.

You can customize the distribution meta-data for your new project further by editing the file release.py in the package directory. The module docstring of this file will be the project description visible on its PyPI page after registering it. When you're ready to release the first version of your distribution, just run the following command within your project directory::

$ python setup.py release_upload

(you'll need an account on PyPI for registering and uploading your package)

which will create source distribution packages of your project, register the release on PyPI and upload the source packages to it. The release_upload command is an alias defined in the setup.cfg file of your project. There is also an alias release, which will just create the source packages without registering the release, so you can test them locally first.