From 0a00cc5bac1bc790b7ce91856ba28900d41c5416 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Thu, 30 Jul 2009 11:54:02 -0400 Subject: [PATCH] finished #setuppy section --- packaging.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packaging.html b/packaging.html index 80dffca..e4e400d 100644 --- a/packaging.html +++ b/packaging.html @@ -118,15 +118,15 @@ This version requires Python 3 or later; a Python 2 version is available separat
  • Make a root directory to hold everything. Give it the same name as your Python module.
  • To accomodate Windows users, your “read me” file should include a .txt extension, and it should use Windows-style carriage returns. Just because you use a fancy text editor that runs from the command line and includes its own macro language, that doesn’t mean you need to make life difficult for your users. (Your users use Notepad. Sad but true.) Even if you’re on Linux or Mac OS X, your fancy text editor undoubtedly has an option to save files with Windows-style carriage returns.
  • Your Distutils setup script should be named setup.py unless you have a good reason not to. You do not have a good reason not to. -
  • If your Python software is a single .py file, you should put it in the root directory along with your “read me” file and your setup script. If it’s a multi-file module (i.e. a directory with a main __init__.py script), like httplib2, you should put the entire directory here. Yes, that means you’ll have an httplib2/ directory within an httplib2/ directory. Trust me, that’s not a problem. In fact, any other arrangement would be a problem. +
  • If your Python software is a single .py file, you should put it in the root directory along with your “read me” file and your setup script. But httplib2 is not a single .py file; it’s a multi-file module. But that’s OK! Just put the httplib2 directory in the root directory, so you have an __init__.py file within an httplib2/ directory within the httplib2/ root directory. That’s not a problem; in fact, it will simplify your packaging process. -

    The chardet directory looks slightly different. In addition to the README.txt file, it has HTML-formatted documentation in the docs/ directory. The docs/ directory contains several .html files and an images/ subdirectory, which contains several .png and .gif files. (This will be important later.) Also, in keeping with the convention for (L)GPL-licensed software, it has a separate file called COPYING which contains the complete text of the LGPL. +

    The chardet directory looks slightly different. Like httplib2, it’s a multi-file module, so there’s a chardet/ directory within the chardet/ root directory. In addition to the README.txt file, chardet has HTML-formatted documentation in the docs/ directory. The docs/ directory contains several .html files and an images/ subdirectory, which contains several .png and .gif files. (This will be important later.) Also, in keeping with the convention for (L)GPL-licensed software, it has a separate file called COPYING.txt which contains the complete text of the LGPL.

    
     chardet/
     |
    -+--COPYING
    ++--COPYING.txt
     |
     +--setup.py
     |
    @@ -197,7 +197,7 @@ setup(
         ...
     )
    -

    FIXME +

    The packages parameter highlights an unfortunate vocabulary overlap in the distribution process. We’ve been talking about the “package” as the thing you’re building (and potentially listing in The Python “Package” Index). But that’s not what this packages parameter refers to. It refers to the fact that the chardet module is a multi-file module, sometimes known as… a “package.” The packages parameter tells Distutils to include the chardet/ directory, its __init__.py file, and all the other .py files that constitute the chardet module. That’s kind of important; all this happy talk about documentation and metadata is irrelevant if you forget to include the actual code!

    ⁂ @@ -272,7 +272,7 @@ Topic :: Software Development :: Libraries :: Python Modules

    FIXME -

    include COPYING
    +
    include COPYING.txt
     recursive-include docs *.html *.png *.gif

    Checking Your Setup Script for Errors