views:

78

answers:

3

hi, i wrote a little module and i would like to know what are the basic steps to package it in order to send it to pipy:

  • what is the file hierarchy?
  • how should i name files?
  • should i use distutils to create PKG-INFO?
  • where should i include my documentation (made with sphinx)?
+3  A: 

Maybe this is of help for you

Submitting Packages to the Package Index

If you have some free software or open source modules that you've polished up and would like to contribute, we'd love to have them included in the PyPI! First, if you haven't done so, you will want to get your project organized. You might follow the guidelines at ProjectFileAndDirectoryLayout. After that, you'll want to read the Python documentation regarding creating distributions: http://docs.python.org/distutils/index.html./docs.python.org/distutils/index.html.

You can also check this one from Tarek's book "Expert Python Programming" where questions about development and distribution are addressed in great detail

joaquin
A: 

an example is always the best way to see how to do:

http://packages.python.org/an_example_pypi_project/

Mermoz
in fact it is not good as it looks because it seems depracated
Mermoz
+1  A: 

I recommend reading The Hitchhiker's Guide to Packaging. Specifically, you should look at the Quick Start section, which describes how to:

  1. Lay out your project
  2. Describe your project
  3. Create your first release
  4. Register your package with the Python Package Index (PyPI)
  5. Upload your release, then grab your towel and save the Universe!

You should also look at the Current State of Packaging in the Introduction to Packaging section, as this helps untangle some of the confusion surrounding setuptools, distutils, distutils2, and distribute.

Update Re: How to Name Files

The excerpt below is from PEP8, which answers your question about how to name files:

Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.

Since module names are mapped to file names, and some file systems are case insensitive and truncate long names, it is important that module names be chosen to be fairly short -- this won't be a problem on Unix, but it may be a problem when the code is transported to older Mac or Windows versions, or DOS.

Matthew Rankin