[Distutils] suggestions for distutil

M.-A. Lemburg mal@lemburg.com
Wed Oct 9 04:26:21 2002


Philippe FREMY wrote:
> 	Hi,
> 
> I am using Python 2.2 from active state, windows 2k but this is a generic
> problem.
> 
> I like distutils, it is a very good tools but I have some suggestions:
> 
> - data_files are copied directly to the python lib directory while python
> modules are copied in site-packages.
> I would find more logical to copy data file also in site-packages, so that
> all your product data is available in one place in the python directory.

Funny, I have a subclass in mxSetup.py (see e.g. egenix-mx-base) which
does just that.

> I imagine it is not possible to break the existing behaviour. But it is
> probably possible to specify in the doc that is is best to copy to
> 'Lib/site-packages/...'

I found the data_files handling pretty useless, which is why I
wrote my own version. However, people are probably relying on the
existing behaviour, so the only way to change defaults is by
providing options which let you change them in e.g. setup.cfg.

> - the documentation says how to install data file but not how to use them
> from inside a python module. How do I fetch my data files ?

If you install them inside a Python package it's really easy
to get at them, because the path to the package's root dir
is listed in the module as attribute.

> - the syntax to use with scripts files is not given in the documentation. I
> am speaking about the chapter "3.4 Listing scripts"
> 
> - I would like my module to be compiled/installed with optimisation by
> default. Is it possible ?

The install command let's you pass in a parameter:

   --optimize (-O)     also compile with optimization: -O1 for "python -O", -O2
                       for "python -OO", and -O0 to disable [default: -O0]

> - python setup.py --help lists many options (--license, --long-description,
> ...) which are not described in the documentation. I suggest to add a list
> of all supported keywords arguments with their meaning.
> 
> - how do I uninstall ? 'python setup.py uninstall' does not work.

That's true. See mxSetup.py for a way to implement that command.

> - the user that just downloads a python program and want to install it will
> probably run 'python setup.py'. The help
> doesn't give any hint on how to install the stuff. The second command
> 'python setup.py --help' still doesn't give any hint about how to install.
> This is only after a third step that the help mention the work install for
> the first time. After a fourth command, the guy is able to install the
> packages. For such a common and easy thing as simply running the installer,
> it should be simpler than that. I suggest to add a "To install this package,
> type 'python setup.py install'" at the end of the standard help of 'python
> setup.py'. This would certainly help many users.

Good idea. Could you submit a patch to SF ?

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/