I have a Python Package that requires another package to be installed. That package can be downloaded from someone else's github page. I need to turn my package into a .deb file. I am currently doing this using stdeb. Is it possible to make it so when my deb file is installing, it will also download the files from the git and do a "pip install ." on their setup.py?
-
1The question may seem offtopic. (administration and so installing packages is topic of a sister site). But I assume you are asking from a programmer side (e.g. to create or deploy stuffs). In this case I think you are doing things wrongly, but we need some more details. Why do you want to build a .deb file for such cases? Is it enough to just install files (and possibly only on local user)? – Giacomo Catenazzi Sep 16 '20 at 12:29
-
I created a program which is just a python script which can be used as both a library, as well as a shell. I created a python package for it. Now I need to turn the python package into a debian package which I also did, but after installing and running the program from the terminal or by importing it in another script, I get the error that another python package is not installed. This python package can be found on github and while it can be installed manually, I need it to be installed along with my debian package. This package can only be found on git in python package form (setup.py) – Alexgaby Sep 16 '20 at 14:52
-
In Debian, when we need to pack a packages, we must pack also all dependencies. but in general: why? You could just use local version (on a specific user and virtual environment). It is much better this method, then to install packages (with many problem related, e.g. impossibility of upgrade system python in some cases). – Giacomo Catenazzi Sep 16 '20 at 15:04
1 Answers
Debian packages are supposed to be self contained. You don't know that when the package is installed that the remote Git server will exist and that it will contain the contents that you want (e.g., they could have been deleted or replaced with malicious contents). You don't even necessarily know that you'll have a network connection at that time.
Even if, in your environment, you do know that, Debian packages don't expect that, so the files you download via Git and generate by using pip
won't be removed by your package, leaving cruft on the user's system. That means that future package installs might break due to this leftover cruft, leading to hard-to-debug errors.
It is possible to do by using a postinst
script, but definitely not a good idea. You'll want to package your dependency in another Debian package or use the existing package from the developer's page instead.

- 64,793
- 6
- 84
- 100