package with executable

A. Cavallo a.cavallo at cavallinux.eu
Wed May 20 02:01:39 EDT 2009


Hi,

> Matplotlib and Numpy, and a command line program. My goal is to create a
> distributable package, that should ideally contain both the "gnucal"
> package and the command line program.
>       * where should the executable module be wrt setup.py and/or the
>         package directory in the source tree
>       * how should I format the console_scripts entry in setup() to make
>         the executable module available to the system PATH after
>         installing

With the standard distutils (no need for setuptools) the config.py file might 
look like:


===== setup.py =====
from distutils.core import setup

version = '0.1'


setup(name='gnucal',
      version=version,
      description="GNUCal is a radiocarbon (14C) calibration program",
      long_description="""\
""",
      author='Stefano Costa',
      author_email='steko at iosa.it',
      url='http://gnucal.iosa.it/',
      license='GNU GPLv3',
      packages=['gnucal',],
      scripts=['gnucal.py',]
      )

>       * how should I call the "gnucal" package from inside the
>         executable script (currently I'm using "from gnucal import core"
>         but it doesn't seem to work)

import gnucal must work. If you're developing from the sources (eg. without 
having the package installed) you need to be in the same dir where the 
gnucal.py is or you need to set PYTHONPATH in order to find the directory 
gnucal (the one containing __init__.py).


> I'm using virtualenv to create testing environments for the install
> process, and my Python is 2.5.4 on Debian Sid.
>
> Any suggestion is appreciated, particularly if there are some real
> examples to draw from.

At line 101 the statement sys.exit("Please.. should be parser.error("Please..

Regards,
Antonio



More information about the Python-list mailing list