#15 closed enhancement (duplicate)

consider using setuptools for tahoe

Reported by: zooko Owned by: zooko
Priority: minor Milestone: 0.6.0
Component: packaging Version:
Keywords: Cc:
Launchpad Bug:

Description

It might be nice to make "./setup.py" instead of "make" be the user-facing front end for building, installing, testing, and distributing. It might also be nice to take advantage of distutils/setuptools's many features such as automatically building tarballs and uploading them to the Cheeseshop (PyPI).

On the other hand, the GNUmakefile already works fine and it would seem like a lot of work to rewrite it entirely in terms of distutils/setuptools.

Maybe we can have both -- keep GNUmakefile for the build rules, but use setup.py for the user interface and distutils/setuptools for the distribution.

Change History (10)

comment:1 Changed at 2007-04-28T19:16:08Z by warner

  • Component changed from component1 to packaging

comment:2 Changed at 2007-04-30T05:43:43Z by zooko

  • Owner changed from somebody to zooko
  • Priority changed from major to minor
  • Status changed from new to assigned

comment:3 Changed at 2007-05-03T17:42:06Z by warner

Just some random thoughts:

I tend to throw in Makefiles in my python projects to remind me of what the other incantations are. The GNUMakefile in tahoe has grown much larger than any of those.

Part of the issue is that it does a number of things that are outside the scope of distutils/setuptools. figleaf conversion, building multiple independent sub-projects, creating/running nodes, pyflakes/development-utilities, and debian packaging are all things that setup.py does not traditionally know much about. Hence I'm not sure whether these things are best put into the rather non-pythonic Makefile or the not-quite-prepared-for-the-task setup.py .

I'm uncertain about setuptools in general: most of the other projects I've seen it in have been a hassle to deal with. Now that I know about --single-version-externally-managed that might be less of an issue than it was before. I'm still inclined to want a list of beneficial features before submitting our uses to the same sort of hassle that I remember dealing with.

comment:4 Changed at 2007-05-22T15:57:58Z by zooko

I took a stab at setuptoolifying our setup.py, the results of which are in this branch. I haven't gotten "./setup.py test" to work, and I haven't yet moved functionality out of make and into python, so the benefits of this stab at it are only:

  • integration with cheeseshop metadata
  • easy/happy installation for people who like setuptools

However, this stab at it has at least this major drawback:

  • unhappiness for people who don't like setuptools (e.g. GNU stow users)

And therefore, it would be a big lose to switch to it at this time.

For the record, if I could somehow get past that fatal flaw -- possibly by offering two installation interfaces (make install and ./setup.py install), or by prominently documenting the --single-version-externally-managed switch -- and if I did the necessary work to get the other features working, then this would offer:

  • ./setup.py test, which will hopefully in the future be the standard way to run tests. In the meantime we currently have the old standard way to run tests: make test
  • reduce the number of build/install mechanisms from two (makefile and setup.py) to one
  • automated production of tarballs and automated upload of same to cheeseshop
  • dependency management for people who don't have apt (ideally also producing debian packages with some tool like easy-deb)
  • more features of setuptools that I'm currently not thinking of
  • more features of setuptools that will be invented by the setuptools-loving community in the future

Having thought this through and talked about it quite a bit with Brian, I've realized that my over-riding motivation for being interested in setuptools is:

  • easy/happy installation for people who like setuptools

And an even bigger over-riding consideration is:

  • unhappiness for people who don't like setuptools (e.g. GNU stow users)

The latter category of people will never go away, and I will probably never become willing to do something that discourages that category in order to encourage the former category, so at this point I predict that tahoe will never use setuptools until someone figures out a way to make it more palatable to users of traditional unix-like package management tools.

comment:5 Changed at 2007-06-04T18:16:38Z by zooko

http://blog.ianbicking.org/pythons-makefile.html

Re: the setup.py vs. makefile discussion

comment:6 Changed at 2007-07-10T18:47:18Z by zooko

So now we want to use another 3rd party package -- Bob Ippolito's json parser -- and here are our desiderata for using a package:

  1. We can produce a Tahoe binary package for a given deployment target, ship that package to a user using that platform, they can install that package, and it will work. That is: user doesn't have to manually satisfy any dependencies.
  1. Use the source code as it is written by upstream. That is: no patching required.
  1. Use it as it is packaged by upstream. That is: we prefer to get a copy of the source code of the package as upstream prefers to distribute such source code, rather than by pulling from their revision control tool or so on.
  1. Don't have name conflicts with existing packages on deployment target (either use extant one if any or else use our bundled one). That is: the user doesn't have to manually resolve any conflicts.
  1. Make it convenient for someone to use other versions of the packages that we use e.g. system-wide packages or newer or alternate versions, etc.

comment:7 Changed at 2007-07-10T23:23:57Z by zooko

Things I Need To Do To Make Usage of setuptools Okay:

  • Bundle setuptools so that ez_setup.py never connects to the network.
  • Bundle dependent libs (in src tarball form) so that setup.py never connects to the network.
  • Hack ez_setup.py so that it accepts a "minimum version" of setuptools (RobK did this: 03e9b0d4d77ee0ae).

comment:8 Changed at 2007-07-11T21:36:16Z by zooko

I'm creating a wiki page to make it so that we can maintain these notes as they evolve...

Packaging

comment:9 Changed at 2007-08-20T17:52:22Z by zooko

  • Milestone set to 0.6.0

comment:10 Changed at 2007-08-20T18:09:43Z by zooko

  • Resolution set to duplicate
  • Status changed from assigned to closed

This ticket is superceded by #82.

Note: See TracTickets for help on using tickets.