Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple distributions from one source tree

I have a source tree that looks about like this:

/app/backend/module.py
/app/cli/module.py
/app/common/module.py

Now I want to build three packages, app-backend, app-cli and app-common out of this which should be distributable and be usable separately. I’d like to keep the code in one repository because I’d like to keep things together and it’s not so much code yet anyway.

What is the most standard and future-proof way to do this with setuptools (or is there a better fit)? I am not building for Python 2.7 or such, I would be fine if it will only work with the most current tools.

like image 808
fqxp Avatar asked Nov 18 '22 19:11

fqxp


1 Answers

I didn’t know that you could use multiple setup(…) calls in one setup.py

You cannot, this is invalid. Please see documentation at the following location: https://python-packaging.readthedocs.io/en/latest/minimal.html

"The main setup config file, setup.py, should contain a single call to setuptools.setup()"

While setuptools does not initially complain, problems start occurring when you try to upload or install the package; with one packages metadata leaking into the later.

like image 73
Caleb Marchent Avatar answered Dec 26 '22 18:12

Caleb Marchent