Merge lp:~barry/pkgme/envar into lp:pkgme
Proposed by
Barry Warsaw
Status: | Merged |
---|---|
Merged at revision: | 44 |
Proposed branch: | lp:~barry/pkgme/envar |
Merge into: | lp:pkgme |
Diff against target: |
74 lines (+28/-7) 3 files modified
README.txt (+8/-0) pkgme/__init__.py (+7/-5) pkgme/backend.py (+13/-2) |
To merge this branch: | bzr merge lp:~barry/pkgme/envar |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Westby | Approve | ||
Review via email: mp+43952@code.launchpad.net |
Description of the change
Several changes to make running pkgme from the virtualenv easier.
* Move package imports into the function so that the side effect of
'import pkgme' to get the distutils extension command doesn't try to import
a lot of unrelated, unnecessary, and potentially unavailable stuff.
* Add support for $PKGME_
primarily useful so that pkgme can find its built-in backends when run from
a virtualenv (since the landmark search will fail).
* Add a bit of documentation to the README.
To post a comment you must log in.
8 +To run pkgme out of your virtualenv, set the ``$PKGME_ EXTERNAL_ BACKEND_ PATHS``
9 +environment variable to the directory inside the pkgme source tree named
10 +``backends/``. For example::
Is this needed as it currently doesn't install the backends?
62 +if PKGME_EXTERNAL_ BACKEND_ PATHS is None: BACKEND_ PATHS = ["/usr/ share/pkgme/ backends/ "] BACKEND_ PATHS = PKGME_EXTERNAL_ BACKEND_ PATHS.split( os.pathsep) dirname( os.path. abspath( __file_ _)), os.pardir) exists( os.path. join(root_ dir, "setup.py")): BACKEND_ PATHS.insert( 0, os.path. join(root_ dir, "pkgme", "backends")) BACKEND_ PATHS.insert( join(root_ dir, "pkgme", "backends"))
63 + EXTERNAL_
64 +else:
65 + EXTERNAL_
66 root_dir = os.path.join(
67 os.path.
68 if os.path.
69 - EXTERNAL_
70 + EXTERNAL_
71 + 0, os.path.
If PKGME_EXTERNAL_ BACKEND_ PATHS overrides /usr/share/ pkgme/backends/ should
it also override the ones in the source tree? Is that what "EXTERNAL" is there
for? I'm not sure why you would want to override, but not completely override.
Given that most backends are likely to be in your source tree, the env variable
won't have a lot of effect if you are running from source.
I have no problem adding an env var for this, but I think we should make it
so that it isn't needed when doing development.
Thanks,
James