Based on http://www.jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/
Workflow
The first release(v0.1): see Publish and Install Applications via PyPI for how to commit to PyPI;
After uploading your first release to PyPI, the basic workflow is:
-
Do some work on your package (i.e. fix bugs, add features, etc);
-
Make sure the tests pass;
-
"Freeze" your code by creating a release branch in git-flow;
-
Update the version number in your package's init.py file;
-
Run "python setup.py sdist upload" to upload the new version of your package to PyPI;
For usage of git-flow, see note "git-flow Notes".
virtualenv and virtualenvwrapper
See Note about virturalenvwrapper.
Publish a Python Application
Add a "command_line.py" in
Necessary Files
setup.py
Some necessary parameters:
-
entry_points: for defind executables;
-
install_requires: for defining dependencies, get this from "pip freeze" command (exculde the application itself);
MANIFEST.in
Add "inculde README.md" (and other necessary files for installation) in this file, or README.md will note be packaged into installer, and in installation a "README.md not found" error raises because you read this file in setup.py. (see https://wiki.python.org/moin/Distutils/Tutorial for explanation)
All available classifiers
https://pypi.python.org/pypi?%3Aaction=list_classifiers
Create requirements automatically
$ pip freeze > requirements.txt