diff --git a/packaging.html b/packaging.html index 6cf17d6..c309066 100644 --- a/packaging.html +++ b/packaging.html @@ -6,6 +6,7 @@ @@ -120,7 +121,7 @@ This version requires Python 3 or later; a Python 2 version is available separat
  • 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. -

    The chardet directory looks slightly different. Instead of a “read me” file, it has HTML-formatted documentation in a docs/ directory. 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. 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.

     chardet/
    @@ -129,13 +130,15 @@ chardet/
     |
     +--setup.py
     |
    ++--README.txt
    +|
     +--docs/
     |  |
     |  +--index.html
     |  |
     |  +--usage.html
     |  |
    -|  +--...
    +|  +--images/ ...
     |
     +--chardet/
        |
    @@ -170,7 +173,7 @@ chardet/
     
  • url, the home page of your project. This can be your PyPI package page if you don’t have a separate project website. -

    Although not required, I recommend that you also include +

    Although not required, I recommend that you also include the following in your setup script:

    • description, a one-line summary of the project. @@ -182,6 +185,20 @@ chardet/

      Setup script metadata is defined in PEP 314. +

      Now let’s look at the chardet setup script. It has all of these required and recommended parameters, plus one I haven’t mentioned yet: packages. + +

      from distutils.core import setup
      +setup(
      +    name = 'chardet',
      +    packages = ['chardet'],
      +    version = '1.0.2',
      +    description = 'Universal encoding detector',
      +    author='Mark Pilgrim',
      +    ...
      +)
      + +

      FIXME +

      Classifying Your Package

      @@ -251,14 +268,72 @@ Intended Audience :: Developers Topic :: Internet :: WWW/HTTP Topic :: Software Development :: Libraries :: Python Modules
  • -

    Checking Your Setup Script for Errors

    +

    Specifying Additional Files With A Manifest

    + +

    FIXME + +

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

    Checking Your Setup Script for Errors

    + +

    FIXME + +

    +c:\Users\pilgrim\chardet> c:\python31\python.exe setup.py check
    +running check
    +warning: check: missing required meta-data: version
    + +

    FIXME + +

    +c:\Users\pilgrim\chardet> c:\python31\python.exe setup.py check
    +running check

    Creating Source Distributions

    - + +
    +FIXME need to redo this now that we have a MANIFEST.in file
    +c:\Users\pilgrim\chardet> c:\python31\python.exe setup.py sdist
    +running sdist
    +running check
    +reading manifest file 'MANIFEST'
    +creating chardet-1.0.2
    +creating chardet-1.0.2\chardet
    +copying files to chardet-1.0.2...
    +copying setup.py -> chardet-1.0.2
    +copying chardet\__init__.py -> chardet-1.0.2\chardet
    +copying chardet\big5freq.py -> chardet-1.0.2\chardet
    +...
    +copying chardet\universaldetector.py -> chardet-1.0.2\chardet
    +copying chardet\utf8prober.py -> chardet-1.0.2\chardet
    +creating dist
    +creating 'dist\chardet-1.0.2.zip' and adding 'chardet-1.0.2' to it
    +adding 'chardet-1.0.2\PKG-INFO'
    +adding 'chardet-1.0.2\setup.py'
    +adding 'chardet-1.0.2\chardet\big5freq.py'
    +adding 'chardet-1.0.2\chardet\big5prober.py'
    +...
    +adding 'chardet-1.0.2\chardet\universaldetector.py'
    +adding 'chardet-1.0.2\chardet\utf8prober.py'
    +adding 'chardet-1.0.2\chardet\__init__.py'
    +removing 'chardet-1.0.2' (and everything under it)
    +
    +c:\Users\pilgrim\chardet> dir dist
    + Volume in drive C has no label.
    + Volume Serial Number is DED5-B4F8
    +
    + Directory of c:\Users\pilgrim\chardet\dist
    +
    +07/30/2009  04:47 AM    <DIR>          .
    +07/30/2009  04:47 AM    <DIR>          ..
    +07/30/2009  04:47 AM           175,367 chardet-1.0.2.zip
    +               1 File(s)        175,367 bytes
    +               2 Dir(s)  62,235,222,016 bytes free

    ⁂ @@ -266,9 +341,54 @@ Topic :: Software Development :: Libraries :: Python Modules + +

    Building A Windows Installer

    - +
    +FIXME probably need to redo this too
    +c:\Users\pilgrim\chardet> c:\python31\python.exe setup.py bdist_wininst
    +running bdist_wininst
    +running build
    +running build_py
    +installing to build\bdist.win32\wininst
    +running install_lib
    +creating build\bdist.win32\wininst
    +creating build\bdist.win32\wininst\PURELIB
    +creating build\bdist.win32\wininst\PURELIB\chardet
    +copying build\lib\chardet\big5freq.py -> build\bdist.win32\wininst\PURELIB\chardet
    +copying build\lib\chardet\big5prober.py -> build\bdist.win32\wininst\PURELIB\chardet
    +copying build\lib\chardet\chardistribution.py -> build\bdist.win32\wininst\PURELIB\chardet
    +...
    +copying build\lib\chardet\universaldetector.py -> build\bdist.win32\wininst\PURELIB\chardet
    +copying build\lib\chardet\utf8prober.py -> build\bdist.win32\wininst\PURELIB\chardet
    +copying build\lib\chardet\__init__.py -> build\bdist.win32\wininst\PURELIB\chardet
    +running install_egg_info
    +Writing build\bdist.win32\wininst\PURELIB\chardet-1.0.2-py3.1.egg-info
    +creating 'c:\users\pilgrim\appdata\local\temp\tmp58b9n5.zip' and adding '.' to it
    +adding 'PURELIB\chardet-1.0.2-py3.1.egg-info'
    +adding 'PURELIB\chardet\big5freq.py'
    +adding 'PURELIB\chardet\big5prober.py'
    +adding 'PURELIB\chardet\chardistribution.py'
    +...
    +adding 'PURELIB\chardet\universaldetector.py'
    +adding 'PURELIB\chardet\utf8prober.py'
    +adding 'PURELIB\chardet\__init__.py'
    +removing 'build\bdist.win32\wininst' (and everything under it)
    +
    +c:\Users\pilgrim\chardet> dir dist
    + Volume in drive C has no label.
    + Volume Serial Number is DED5-B4F8
    +
    + Directory of c:\Users\pilgrim\chardet\dist
    +
    +07/30/2009  03:52 AM    <DIR>          .
    +07/30/2009  03:52 AM    <DIR>          ..
    +07/30/2009  03:52 AM           371,236 chardet-1.0.2.win32.exe
    +               2 File(s)        546,603 bytes
    +               2 Dir(s)  62,235,119,616 bytes free
    + +

    Building a Linux RPM Package