Managing multiple packages

E

Evan Driscoll

I have perhaps a bit of a silly question, but I'm interested in what
people do for workflow when actively developing multiple Python modules
at once (for a single project).

Suppose I have packages A-C. In addition to being modules in the Python
sense, they are logically distinct, probably sit in different
repositories, etc., so there's a directory layout like

my_project/
+-- moduleA/
| +-- setup.py
| +-- src/
| | +-- A/
| | +-- __init__.py
| +-- doc/
| +-- how_to_be_awesome.md
+-- moduleB/
| +-- setup.py
| +-- src/
| +-- B/
| +-- __init__.py
+-- moduleC/
+-- setup.py
+-- src/
+-- C/
+-- __init__.py

Finally, suppose that you're changing between editing all three modules.


How do you deal with this? Do you set
PYTHONPATH=my_project/moduleA/src:my_project/moduleB/src:my_project/moduleC/src,
adding a new entry to PYTHONPATH for each module you need to use?
Install all of the modules to some central location (e.g.
my_project/install) and just point PYTHONPATH to there? Put symlinks in
some central location and point them at the module directories? Mess
with sys.path at the beginning of any scripts you want to run? Some
other trick I don't know of?

I've sort of tended to do the my_project/install thing, but it's pretty
easy to forget to re-install a module after changing something, and
possible to accidentally edit the copy of the file in the install
directory (which will just be overwritten).

Evan





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQq/UxAAoJEAOzoR8eZTzg5ScH/1wNhiICrDf1HGDANR+4pB11
/msmjpSwNmnkwi1GBjOg4E7ybltJwZZ5xlVCoMWcjjZTC7y9RJupMLvvF3cVn7YT
StRlSlzsNxnYpih8XiZ5mjQesea/pRr9jkJAwD4YA+HQa/krQpQRuRIYyNFD9uPT
ZHkSQ4Uq8HY0YGt55Y1QqHQpNTbXM2GrEBwk4++BFhmU6St+cHtwKF1NkCHwLwzl
GA9LQy0fhDi7SAQyGV0CTZl8pbb9FDoLC7PlA2rM8bQE2tcj6s5JlTUVjlmlJQ6a
zqexvDH5PDkumFJmzZQA9LlFWpkXGD3/lgTN5QlmXIzgjA1c4eTJ83WPv9+6uT8=
=ieve
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top