Useful reference
- Python Packaging User Guide
- Sharing Your Labor of Love: PyPI Quick and Dirty
- Cookiecutter: Project Templates Made Easy
- Open Sourcing a Python Project the Right Way
Use test PyPI server
1.First, you need register you account on https://testpypi.python.org/pypi.
Because it has a different user database with the main PyPI server. It also
gets cleaned out on a semi-regular basis.
2.Edit your ~/.pypirc file:
[distutils] index-servers= pypi testpypi [testpypi] repository = https://testpypi.python.org/pypi username = <your username> password = <your password goes here> [pypi] repository = http://pypi.python.org/pypi username = <your username> password = <your password goes here>
3.register:
$ python setup.py register -r "https://testpypi.python.org/pypi" or $ python setup.py register -r testpypi
4.upload:
$ python setup.py upload -r https://testpypi.python.org/pypi or $ python setup.py sdist upload -r testpypi
5.install:
$ pip install -i https://testpypi.python.org/pypi <package name>
Reference:
Use one readme(mardown format) in package
Update on 20160313: I'll switch to use reStructText from now on.
You need make pandoc installed and then install pypandoc. And I suggest
learning restructuredtext, that's the final solution. What's more, we usually
use rst to write docs for our projects because we host docs on readthedocs.org
try: import pypandoc long_description = pypandoc.convert('README.md','rst') except (IOError, ImportError): with open('README.md') as f: long_description = f.read() ... long_description=long_description ...
Reference:
Blabla
inlcude file manually
Create MANIFEST.in to include files manually:
include <glob> # from the project root recursive-include <dirname> <glob> # from sub-directories
in your setup.py, set include_package_data=True
(manually use package_data may fail in including the readme file)
development mode
when in development, try this one:
cd myproject python setup.py develop # the setuptools way pip install -e . # the pip way (which just calls "setup.py develop")
get all the packages published by someone
replace
https://pypi.python.org/pypi?%3Aaction=search&term=<USERNAME>&submit=search