[Distutils] Dependency problems.
Maurits van Rees
m.van.rees at zestsoftware.nl
Fri Aug 19 16:11:29 CEST 2011
Hello Mac,
Op 19-08-11 15:43, Mac Ryan schreef:
> Hello,
>
> I just subscribed yesterday, having being redirected here from
> the python-tutor ML. I hope this is the right place to ask the question
> I am struggling with.
>
> I am trying to package a program I wrote for debian. It's my
> **very first time** with packaging at all, and also with distutils, so
> I followed online documentation to get something done. It work-ish'ed,
> but I am struggling with a problem on dependencies.
>
> To write my setup.py script I followed this:
> http://packages.python.org/distribute/setuptools.html#automatic-script-creation
>
> In the section on dependencies it says: "If your project
> depends on packages that aren’t registered in PyPI, you may
> still be able to depend on them, as long as they are available for
> download as an egg, in the standard distutils sdist format, or as a
> single .py file. You just need to add some URLs to the dependency_links
> argument to setup()."
>
> My question is: how do I list dpendencies that are not python
> code? For example: say my program needs to launch at some point another
> program like for example inkscape, is there a way to specify this in
> the setup.py file, or am I out of luck and my only chance is to list it
> in the debian directory half-way through the process of converting my
> code to a .deb package?
The text you find is still talking about python packages. It means:
when you depend on python packages that are not registered on PyPI, you
can use the dependency_links argument.
It will not work for inkscape.
As an example, when I need some ldap integration then in my setup.py I
can list python-ldap as a dependency. This python package will then be
installed. But that python-ldap package itself will fail to install
when you do not have the necessary ldap bindings installed on your OS
(it would fail in the compile step then, hopefully with a clear error
message). There is no way that I know for the python-ldap package to
declare such an OS-dependency.
> Also, another question out of scientific curiosity. On a
> debian-based distro, if a python module is installed via PyPI, will it
> be "seen" and handled by apt-get / synaptic as if it were installed
> from a .deb package? In other words: would a user be able to execute
> `apt-get remove xxxx` if xxxx has been installed with python
> easy_install xxxx`?
No, sorry, that won't work. The two are completely separate.
> Thank you in advance for your help!
> /mac
You're welcome.
Cheers,
--
Maurits van Rees
Web App Programmer at Zest Software: http://zestsoftware.nl
Personal website: http://maurits.vanrees.org/
More information about the Distutils-SIG
mailing list