You are here: Home Dive Into Python 3

Difficulty level: ♦♦♦♦♢

Packaging Python Libraries

FIXME
— FIXME

 

Diving In

FIXME

# setup.py
from distutils.core import setup
VERSION = '0.5.0'
setup(name='httplib2',
      version=VERSION, 
      author='Joe Gregorio',
      author_email='joe@example.com',
      url='http://code.google.com/p/httplib2/',
      download_url='http://httplib2.googlecode.com/files/httplib2-python3-{}.tar.gz'.format(VERSION),
      description='A comprehensive HTTP client library.',
      license='MIT',
      packages=['httplib2'],
      classifiers=[
          'Development Status :: 4 - Beta',
          'Environment :: Web Environment',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: MIT License',
          'Operating System :: OS Independent',
          'Programming Language :: Python',
          'Programming Language :: Python :: 3',
          'Topic :: Internet :: WWW/HTTP',
          'Topic :: Software Development :: Libraries',
      ],
)

Overview of the Packaging Process

Directory Structure

Writing Your Setup Script

Checking Your Setup Script for Errors

Writing Your Setup Configuration File

Creating Source Distributions

Creating Binary Distributions

Building A Windows Installer

Building a Linux RPM Package

The Python Package Index

Registering Yourself

Registering Your Python Library

Uploading New Versions

Further Reading

© 2001–9 Mark Pilgrim