[Distutils] setuptools 0.6b4 released

Phillip J. Eby pje at telecommunity.com
Fri Jul 21 22:33:17 CEST 2006


At 01:10 PM 7/21/2006 -0700, Andrew Straw wrote:
>1) download and expand matplotlib-0.87.4.tar.gz; cd into that directory.
>(This was built with plain old distutils sdist.)

Okay, that's where the problem lies, then.  If you use distutils sdist, you 
get what the distutils sdist does.  :)

If you build an sdist using setuptools (0.6c1), then that sdist will have 
the same version number as the original.

If you build an sdist using distutils OR a version of setuptools less than 
0.6c1, you will get...  something else.  :)


>Note that building the source distribution with python -c "import
>setuptools; execfile('setup.py')" sdist DOES result in the same version
>numbers. (The version number becomes "0.87.4.dev-r0" -- the source has a
>setup.cfg with "tag_build = .dev" and  "tag_svn_revision = 1"). I see
>now that this could be considered a matplotlib bug -- it has a setup.cfg
>with setuptools options but distributes packages not built with
>setuptools. Let me know if you think this is a matplotlib bug.

Sort of.  It's more a question of what behavior they want.  I think they 
are trying to walk a fine line of being able to use setuptools without 
requiring users to have it.


>OK, now after some more playing around, I can see that I can generate an
>sdist using the following (we don't want ".dev-r0" in release name,
>after all).
>
>python -c "import setuptools; execfile('setup.py')" egg_info
>--tag-build='' --no-svn-revision sdist
>
>So is this the recommended sdist-building procedure for packages that
>ship a setup.cfg with [egg_info] options set?

Not unless the package creator requests it.  Otherwise, you could be 
stripping version information that's *supposed* to be there.  This is why 
setuptools now ships an automatically modified setup.cfg when it builds an 
sdist, so that what you get by default is whatever the builder of the sdist 
wanted.

So, in the current situation with matplotlib, one of two things needs to 
happen:

* They need to build their sdist with setuptools, OR
* They need to strip the egg_info settings from setup.cfg before building 
an untagged release with the distutils

Either way should result in an sdist that works correctly for setuptools, 
but it may be that they have to take the latter option in order to avoid 
requiring setuptools.  (I'm not sure whether that's the case or not.)

In any case, until 0.6c1, the latter option was the only *possible* option, 
and it's discussed at some length in the setuptools manual, including 
alternative ways to manage the process with Subversion.



More information about the Distutils-SIG mailing list