PDA Knowledge Collection

24 Feb 2014

Listed below are some documentation and references I collected over the course of developing tool pda:

Python packing tools differences:

Uninstall a python package you installed with python setup.py install? See this stackoverflow thread

Python static code analyzing tool:

Python Standard Coding Style:

Updating your distribution

Down the road, after you’ve made updates to your distribution and wish to make a new release:

http://guide.python-distribute.org/creation.html#arranging-your-file-and-directory-structure

distributing a command line python application example:

http://gehrcke.de/2014/02/distributing-a-python-command-line-application/?utm_source=Python+Weekly+Newsletter&utm_campaign=8d9f1256ee-Python_Weekly_Issue_131_March_20_2014&utm_medium=email&utm_term=0_9e26887fc5-8d9f1256ee-312661513

twine error:

(py27_venv)> twine upload ../dist/*
KeyError: Missing 'None' section from the configuration file

https://github.com/dstufft/twine/issues/33

how to make gnu make ignore/continue after errors? http://stackoverflow.com/questions/2188376/how-to-have-gnu-make-continue-after-error

To leave a python virtualenv:

http://stackoverflow.com/questions/990754/how-to-leave-a-python-virtualenv

The long_description field can be attached to a text file located in the package:

from distutils.core import setup

with open('README.txt') as file:
    long_description = file.read()

    setup(name='Distutils',
          long_description=long_description)

In that case, README.txt is a regular reStructuredText text file located in the root of the package besides setup.py.

Please install pip install docutils to have a front-end tool rst2html.py tool installed before using it.

To prevent registering broken reStructuredText content, you can use the rst2html program that is provided by the docutils package and check the long_description from the command line:

$ python setup.py --long-description | rst2html.py > output.html

docutils will display a warning if there’s something wrong with your syntax. Because PyPI applies additional checks (e.g. by passing –no-raw to rst2html.py in the command above), being able to run the command above without warnings does not guarantee that PyPI will convert the content successfully.

Sphinx reST syntax for various code blocks: http://sphinx-doc.org/markup/code.html

Further about generate documentation with Sphinx and reST:

(Even Varnish project uses it!) https://www.varnish-cache.org/docs/trunk/phk/sphinx.html

python 3 resourcewarning problem python 2 to 3 porting cheatsheet