[Distutils] [Python-Dev] How we can get rid of eggs for 2.6 and beyond

"Martin v. Löwis" martin at v.loewis.de
Sat Mar 22 16:42:36 CET 2008


> I speak for Debian, so for Debian: yes.  The setup.py would have to be
> pretty bad for a packager to not use it.  There is no reason to
> re-write upstream's installation procedure as you would have to figure
> out which files need to be installed where and this would create many
> bugs.
> 
> The canonical way is something like this:
> 
>   $ pythonX.Y setup.py --root=$(pwd)/debian/tmp
>   $ # Fixup anything done wrong/badly (for debian) by setup.py
>   $ # Make a tarball of $(pwd)/debian/tmp
> 
> In reality it's slightly more complicated of course.

More than slightly so, with pycentral, pysupport, and all that.

I still doubt that the database would show up in a directory on
sys.path. IIUC, things get install into
/usr/share/pycentral/package, and then get symlinked into
/usr/lib/pythonX.Y/site-packages at installation time. It's
not all that clear to me how that deals with "non-regular"
files.

> At [1] there are
> many packages, paste and parallelpython are good examples if you're
> interested (look in the debian/rules file).

I started with nevow. It uses cdbs, so its debian/rules is nearly
empty, and does not include a call to setup.py at all.

Instead, the distutils support is in

/usr/share/cdbs/1/class/python-distutils.mk

where setup.py is invoked as

ifeq (,$(DEB_PYTHON_REAL_LIB_PACKAGES))
common-install-arch common-install-indep:: common-install-impl
common-install-impl::
         cd $(DEB_SRCDIR) && python$(DEB_PYTHON_COMPILE_VERSION) 
$(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) 
$(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))
else
$(patsubst %,install/%,$(DEB_PYTHON_REAL_LIB_PACKAGES)) :: install/% :
         cd $(DEB_SRCDIR) && python$(cdbs_python_ver) 
$(DEB_PYTHON_SETUP_CMD) install --root=$(CURDIR)/debian/$(cdbs_curpkg) 
$(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))
endif

$(patsubst %,install/%,$(DEB_PYTHON_SIMPLE_PACKAGES)) :: install/% :
         cd $(DEB_SRCDIR) && python $(DEB_PYTHON_SETUP_CMD) install 
--root=$(CURDIR)/debian/$(cdbs_curpkg) $(DEB_PYTHON_INSTALL_ARGS_ALL) 
$(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))

I cannot infer from that whether supplying a package database
snippet in setup.py would actually work.

Regards,
Martin



More information about the Distutils-SIG mailing list