0

I've inherited a python project, consisting of exactly 1 python file, that is designed to install and run on Linux. I don't know a ton about python and I know far less about Linux.

There are currently separate build processes for Ubuntu, Fedora, and Arch, which produce a DEB file, an RPM file, and a PKG.TAR.XZ file, respectively. Users then need to go through a different install process depending on their system.

One of my first tasks is to consolidate and simplify this process for our users. After investigation, it appears the Snap Store could be a good solution. The Snap Store appears to require setuptools.

Each of my build types, though, depends on different requirements. For example, DEB and RPM require python3-suds, but ARCH needs python-suds. ARCH and RPM want libappindicator-gtk3, but DEB wants gir1.2-appindicator3-0.1 and gir1.2-gtk-3.0 instead.

I can't find an obvious way to include these conditional requirements in my setup.py install_requires property. How would you go about accomplishing this? Or, am I completely on the wrong track?

As you answer, please keep in mind that I'm a novice! Thanks!

Aaron D. Marasco
  • 6,506
  • 3
  • 26
  • 39
gcdev
  • 1,406
  • 3
  • 17
  • 30
  • From the looks of it, this doesn't have much to do with Python nor _setuptools_. The dependencies you name are not Python dependencies, in the sense that listing them in _setuptools_ `install_requires` would not get you anywhere, they do not refer to Python projects that are installable from [PyPI](https://pypi.org). But they seem to be dependencies that should be installed from the operating system's (Linux distribution) own package manager (`apt`, `pacman`, etc.). Does that sound correct? – sinoroc Jan 25 '20 at 15:48
  • sinoroc, yes, that sounds correct if I understand what you're saying. So how would you recommend I handle this? – gcdev Jan 25 '20 at 17:33
  • not sure. There seems to be a [_suds_ Python project](https://pypi.org/search/?q=suds+jurko), so probably this one dependency could be added to _setuptools_ `install_requires`. The other ones I believe are outside of the Python ecosystem, so I don't know how to declare them. But I changed the tags to hopefully attract users with that kind of knowledge. – sinoroc Jan 25 '20 at 18:28

2 Answers2

0

First, you may check https://www.flatpak.org/ It is similar to Snap. Just IMO slightly better.

When using Snap or Flatpak you do not care whether you need python-suds or python3-suds. The result is basically a container. You just choose a runtime you build on top of it and solve the deps there. Then the container (be it Snap of Flatpak) is run on every OS - be it Ubuntu, Fedora or Arch. It does not have anything to do with its package management tooling. It is isolated.

msuchy
  • 5,162
  • 1
  • 14
  • 26
  • Flatpak limits access to other processes. My app needs that access. Beyond that, I didn't understand what you were recommending I do exactly with respect to the conditional dependencies that I have to deal with...? – gcdev Jan 27 '20 at 13:53
0

After lots of research, I discovered that since snap apps are all built on an Ubuntu VM, all that is necessary is to include all the Ubuntu dependencies, and the snap process will bundle those dependencies within the app. The app will then work on any Linux flavor. So there was no need for me to try to write conditional dependencies in install_requires. All I needed to do was to include the Ubuntu dependencies.

I finally arrived at this conclusion via this very helpful walk-through, and my own testing has confirmed it: https://medium.com/@abulka/getting-python-and-wxpython-apps-into-the-ubuntu-app-store-ccca7ae537a3

I hope this helps someone else.

gcdev
  • 1,406
  • 3
  • 17
  • 30