Managing multiple packages

Evan Driscoll edriscoll at wisc.edu
Tue Nov 20 22:24:59 CET 2012


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




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20121120/afa11bd8/attachment.pgp>


More information about the Python-list mailing list