473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

distutils alternatives?

I'm in a situation where I need to distribute several interdependent
Python packages. There are good reasons not to combine them all into
one package. Distutils doesn't seem to be able to bundle a
heterogeneous mix of multiple packages and modules, and so I've
currently got people launching three installers in the proper sequence
in order to get software installed, which seems needlessly complicated
and confusing. There must be a better way. What I really want is a
way for the installer to automatically download and install
dependencies...

First, does anyone know of an alternative to distutils that does this?

Second, this is exactly what Gentoo's Portage software does, except
for Gentoo ebuilds instead of Python packages. It also happens to be
written in Python. Can anyone more familiar with Portage's internals
comment on the feasibility of harnessing emerge to work as a Python
package installer/distributer for systems which aren't running Gentoo?
It is also foreseeable that something like this could be linked to
PyPI, etc.
Jul 18 '05 #1
5 1854
Lonnie Princehouse wrote:
I'm in a situation where I need to distribute several interdependent
Python packages. There are good reasons not to combine them all into
one package. Distutils doesn't seem to be able to bundle a
heterogeneous mix of multiple packages and modules, and so I've
currently got people launching three installers in the proper sequence
in order to get software installed, which seems needlessly complicated
and confusing. There must be a better way. What I really want is a
way for the installer to automatically download and install
dependencies...


The SciPy project has similar needs and extended distutils to do just
that. Check out SciPy CVS at http://www.scipy.org/cvs/ .

The package you're looking for is scipy_core/scipy_distutils . It's a
bit arcane, but it does what you describe and uses distutils as the
base, so you get all the compiler and platform support already there,
and the modifications to existing setup.py scripts should be managable.
I don't think there's much documentation, if any, for using it outside
of SciPy, but it's certainly general.

A few steps to get you started: do a CVS checkout of the scipy_core
directory. Move the scipy_distutils subdirectory out and blast away
scipy_core (which should now only contain stuff you don't need). You can
then distribute scipy_distutils with your packages (as another toplevel
package just under the directory with your uber setup.py that takes care
of all of the packages).

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Jul 18 '05 #2
Lonnie Princehouse wrote:
I'm in a situation where I need to distribute several interdependent
Python packages. There are good reasons not to combine them all into
one package. Distutils doesn't seem to be able to bundle a
heterogeneous mix of multiple packages and modules, and so I've
currently got people launching three installers in the proper sequence
in order to get software installed, which seems needlessly complicated
and confusing.


What do you mean by "launch installers"? Invoking "python setup.py
install" does not "launch" anything in the traditional sense.

However, if this is really what you talk about, I suggest a shell script:

#!/bin/sh
(cd dir1;python setup.py install)
(cd dir2;python setup.py install)
(cd dir3;python setup.py install)

Then create a tarball containing all packages in separate
subdirectories, and add a toplevel install script.

Regards,
Martin
Jul 18 '05 #3
Lonnie Princehouse wrote:
I'm in a situation where I need to distribute several interdependent
Python packages. There are good reasons not to combine them all into
one package. Distutils doesn't seem to be able to bundle a
heterogeneous mix of multiple packages and modules, and so I've
currently got people launching three installers in the proper sequence
in order to get software installed, which seems needlessly complicated
and confusing. There must be a better way. What I really want is a
way for the installer to automatically download and install
dependencies...
What we tend to do is alter the setup script of the packages that we
want to include in our package, so that it can be imported into our
package and run from there. distutils is unfortunately tricky sometimes,
but with most packages this has been possible.
- define variables in the packagesetup script for all the bits that need
to be included
- in the packagesetup script, do if __name__ == '__main__': setup(...)
- in the main setup script, import the other package setup scripts you need
- include the neccesary bits into the right place.
It would be really nice if distutils were built to do this kind of thing
out of the box ...
First, does anyone know of an alternative to distutils that does this?

Second, this is exactly what Gentoo's Portage software does, except
for Gentoo ebuilds instead of Python packages. It also happens to be
written in Python. Can anyone more familiar with Portage's internals
comment on the feasibility of harnessing emerge to work as a Python
package installer/distributer for systems which aren't running Gentoo?
It is also foreseeable that something like this could be linked to
PyPI, etc.


This would be fantastic.
An important issue to resolve would be to link into the native package
management system on each platform (Windows - MSI, various for other
platforms). You want to be able to have a single installer that installs
multiple native packages, and an uninstaller that can intelligently
determine dependencies and uninstall them.

David
Jul 18 '05 #4
I believe that there was some thought at one time
to doing something like this. It eventually evolved
into PyPI as a first step. I haven't heard of anyone
working on the next step, though.

Distutils does what it does (and I won't say
adequately - I had to write a program to create
the distutils setup.py for PyFIT). I'd think that
putting a separate layer on top to handle multiple
downloads and installs would be a better approach
than attempting to integrate it all into distutils.

John Roth

"Lonnie Princehouse" <fi**************@gmail.com> wrote in message
news:4b**************************@posting.google.c om...
I'm in a situation where I need to distribute several interdependent
Python packages. There are good reasons not to combine them all into
one package. Distutils doesn't seem to be able to bundle a
heterogeneous mix of multiple packages and modules, and so I've
currently got people launching three installers in the proper sequence
in order to get software installed, which seems needlessly complicated
and confusing. There must be a better way. What I really want is a
way for the installer to automatically download and install
dependencies...

First, does anyone know of an alternative to distutils that does this?

Second, this is exactly what Gentoo's Portage software does, except
for Gentoo ebuilds instead of Python packages. It also happens to be
written in Python. Can anyone more familiar with Portage's internals
comment on the feasibility of harnessing emerge to work as a Python
package installer/distributer for systems which aren't running Gentoo?
It is also foreseeable that something like this could be linked to
PyPI, etc.

Jul 18 '05 #5
> What do you mean by "launch installers"? Invoking "python setup.py
install" does not "launch" anything in the traditional sense.


The installers I refer to are the graphical Windows installers created
by bdist_wininst. Can't really chain them together in a script
easily, since they're interactive. I already have a nice install
script for *nix, but it requires a little more expertise on the user's
part (i.e. how to competently use a command line)

The packages aren't distributed as source on Windows, partially for
intellectual property reasons, but mostly because there are C
extensions and we can't assume Windows users have a compiler. Before
I start writing my own installer gadget, I thought I should go fishing
on c.l.py to see if such a thing already existed =)
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Isaac Jones | last post by:
Hello Python Community. I bring greetings from the Haskell community (http://www.haskell.org) ;) There has been a lot of discussion of late about creating a grand-unified build & distribution...
1
by: Mathieu Malaterre | last post by:
Hello, I thought this would be easy but I guess I didn't get the distutil feeling. I am trying to write a setup for install my package but I don't understand how to do that. organisation: ...
15
by: Colin J. Williams | last post by:
The distutils download page has: -------------------------------------------------------- Current stable release The current stable release is Distutils 1.0.2; you can download it as: *...
1
by: Terry Hancock | last post by:
Some time ago, I got the idea that I wanted to build image resources from vector graphic originals, instead of marshalling hundreds of tiny little icon images by hand. I wrote "BuildImage" to do...
7
by: Frans Englich | last post by:
This is silly. How do I access data files I've installed with distutils? In a portable, generic way, I want to find out what is the following path on most systems: ...
0
by: Maarten Sneep | last post by:
I'm trying to build PyBison on Mac OS X, and I'm running into some problems with the distutils. Just for starters: PyBison requires Pyrex. This is not a problem, and Pyrex seems to work without...
6
by: ajikoe | last post by:
Hello I tried to combine c++ and python together. So I follow from this website: http://kortis.to/radix/python_ext/ I have this code: # prmodule.c static PyObject *pr_isprime(PyObject *self,...
7
by: vedrandekovic | last post by:
Hello again, Is there any patch for python "distutils", for this ImportError: cannot import name log Regards, Vedran
0
by: newbie73 | last post by:
OS: Vista Python 2.5.2.2 (ActiveState Software Installation) Running latest Cygwin release The error generated is pasted below - please help. - Luis ***************************************
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.