Generally speaking, it’s a bad idea to issue a command to install python packages using pip from within the directory of a python project that has a setup.cfg. The reason is that the local setup.cfg will be applied to whatever you’re trying to install, which can easily case an error.
This is a problem for snapcraft because when a python project has multiple python packages as dependencies, at the install stage the project’s setup.cfg is wrongly being applied to all the python packages.
I’m running into this problem with my project’s build. When running snapcraft, it attempts to install all the dependencies and the main program itself at the same time (my project is in bold):
Installing collected packages: pyzmq, pymediainfo, rawkit, rapid-photo-downloader, PyQt5, PyPrind, psutil, six, colorlog, pyxdg, gphoto2, arrow, python-dateutil, sortedcontainers, easygui, sip, colour
Resulting in this exception:
distutils.errors.DistutilsOptionError: error in setup.cfg: command 'build' has no such option 'i18n'
The problem here is that my project setup.py does things like build translations, icons etc., which are specified in the setup.cfg. These specifications should not be applied to the program’s python dependencies too. It seems to me that this is a bug in snapcraft.