extension to pep 376: "develop" installation
I propose an extension to PEP 376 to support the development of projects such that: - Installation tools should expect to need to cope with files present in purelib named "foo.dist-link". Each of these files will be of the form "/path/containing/foo.dist-info\nreldir" For example, the contents of such a file might be: /home/chrism/projects/zope.interface src Presence of such files would indicate a link to a directory which contains a .dist-info directory for the project as well as the subdirectory in the project which actually contains packages and modules. - Installation tools should need to cope with a "develop.pth" file in purelib. Its presence will indicate that there are projects in development mode in this environment. Its absence indicates that there are no projects in development mode in this environment. - Installer tools should place dist-link files into purelib as the result of a notional "develop" command e.g. pysetup develop . If "pysetup develop ." were run in zope.interface, zope.interface.dist-link would be installed into purelib - Installer tools should mutate "develop.pth" as the result of "develop", e.g. "pysetup develop ." would create this file if it didn't already exist. After a "pysetup develop" of zope.interface it might look like: import pkgutil.develop; pkgutil.develop.save_path_order() /home/chrism/projects/zope.interface/src import pkgutil.develop; pkgutil.develop.reorder_sys_path() The "import" lines would ensure that the paths mentioned in the .pth file would precede stdlib sys.paths but would come after paths mentioned on PYTHONPATH envvar. Some sort of hack like this anyway; maybe Python could offer better support for this without hackiness of relying on executing code via a .pth file at startup time. - "pysetup undevelop ." of zope.interface would undo the changes made via "pysetup develop"; it would also remove develop.pth if no other developed projects existed anymore after zope.interface was undeveloped. - It will be permissible to have both the "develop" version and the "install" version of a library installed in the same purelib. Installer tools should be able to cope with this and display both versions when they are asked to list installed distributions. That's the basics.
On 9/13/12 9:26 AM, Chris McDonough wrote:
I propose an extension to PEP 376 to support the development of projects such that: Since PEP 376 is accepted, we'll need a new PEP for this kind of addition.
- Installation tools should expect to need to cope with files present in purelib named "foo.dist-link". Each of these files will be of the form "/path/containing/foo.dist-info\nreldir" For example, the contents of such a file might be:
/home/chrism/projects/zope.interface src
why do we need to place this file in purelib ? In my understanding, if we add a file in the root of the developed project, that lists all directories that should be included in the python path, we'd only need to scan that file and add its content in develop.pth IOW - the only impact in the purelib directory could be a single develop.pth file. Now what if I am not sudoer ? how can I have the develop feature without being able to write develop.pth in purelib ? Could we find a way to have a per-user *and/or* per local project directory, that get scan by Python at startup ? Cheers Tarek
On 9/13/12 10:55 AM, Tarek Ziadé wrote: ...
Now what if I am not sudoer ? how can I have the develop feature without being able to write develop.pth in purelib ?
Could we find a way to have a per-user *and/or* per local project directory, that get scan by Python at startup ?
On a second thought, I guess virtualenv fixes this issue..
participants (2)
-
Chris McDonough
-
Tarek Ziadé