Archive for October, 2009

legume 0.1 released: easy_install ‘legume’

It’s been a few months in the making, but now legume has gotten to a point that I thought it worthy of a 0.1 release. The basic feature-set is complete, so it’s in a usable state, that is if anybody can be be faced with using it yet, as at the moment there’s very little (read: nothing) in the way of documentation or user guides.

The release is available via pypi or google code, and I think that softpedia has already snapped it up.

As for the name: “It’s not a nut, it’s a legume! phew!” (Ricky Gervais, Animals).

Python distutils

A guide to creating a simplistic .exe python package installer:

  1. Create a setup.py file in the directory above your package directory:
    MyPythonPackage
    setup.py
    
  2. Copy the following in setup.py:
    from distutils.core import setup
    import setuptools
    import sys
    
    setup(name='MyAmazingLibrary',
        version='0.1',
        description='My Amazing Library',
        author='My Name',
        url='http://code.google.com/p/MyAmazingLibrary/',
        packages=setuptools.find_packages('.'),
        package_dir = {'':'.'},
    )
  3. Open a command prompt in the directory containing the setup.py and execute
    python setup.py bdist_wininst
    
  4. Observe how the installer appears in the newly created dist directory.

Additional Notes

  • To specify that the installer is only for a specific Python install use the –target-version option with setup.py, eg:
    python setup.py bdist_wininst --target-version=2.5
    
  • Swap bdist_wininst to bdist_msi to create a Windows Installer for your python package.
Return top