Managing multiple packages

Discussion in 'Python' started by Evan Driscoll, Nov 20, 2012.

  1. 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-----
    Evan Driscoll, Nov 20, 2012
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul  Smith
    Replies:
    0
    Views:
    718
    Paul Smith
    Nov 18, 2003
  2. David Lyon
    Replies:
    19
    Views:
    556
    David Lyon
    Apr 24, 2009
  3. Thomas Bach

    Re: Managing multiple packages

    Thomas Bach, Nov 23, 2012, in forum: Python
    Replies:
    0
    Views:
    145
    Thomas Bach
    Nov 23, 2012
  4. Evan Driscoll

    Re: Re: Managing multiple packages

    Evan Driscoll, Nov 27, 2012, in forum: Python
    Replies:
    0
    Views:
    180
    Evan Driscoll
    Nov 27, 2012
  5. Thomas Bach

    Re: Re: Managing multiple packages

    Thomas Bach, Nov 27, 2012, in forum: Python
    Replies:
    0
    Views:
    173
    Thomas Bach
    Nov 27, 2012
Loading...

Share This Page