Skip to content

Look far and wide (or "here") for config files, and do substitution#491

Closed
ianb wants to merge 7 commits intopypa:developfrom
ianb:master
Closed

Look far and wide (or "here") for config files, and do substitution#491
ianb wants to merge 7 commits intopypa:developfrom
ianb:master

Conversation

@ianb
Copy link
Contributor

@ianb ianb commented Mar 23, 2012

This pull request makes pip look in the current and parent directories for pip.conf and loads it. Also %(here)s gets substituted in config values.

Perhaps because I had an old checkout I got a few extra commits in this pull request, not sure what those are about; maybe there's a way to get rid of them.

The motivation here is to make directory-local vendor libraries easier, with a config file like:

[install]
install_option = --install-purelib=%(here)s/vendor
    --install-platlib=%(here)s/vendor-binary
    --install-scripts=%(here)s/vendor/bin

Or something like that... the idea isn't complete. Feedback appreciated.

ptone and others added 7 commits April 3, 2011 06:45
the tar libraries choke when checking valid
filenames because they don't resolve symlinks
resolve symlinks in local files
…ackages that aren't in the venv

Add a [global] sys.path option that adds to sys.path, updates pkg_resources, and makes the paths be considered 'local' for the purposes of uninstallation
@ianb
Copy link
Contributor Author

ianb commented Mar 23, 2012

Maybe I have to fix my repo.

But anyway, I added another commit that allows you to add paths as part of your pip.conf file, which makes managing vendor libraries easier, like:

[global]
sys.path = %(here)s/vendor./

Then you can uninstall libraries from vendor/ and see those libraries when updating etc.

@ianb
Copy link
Contributor Author

ianb commented Mar 23, 2012

This doesn't handle scripts well, though (what virtualenv still does better). I'm not sure how to handle that; scripts need to be rewritten and futzed with quite a bit to make them work. Where to put that futzing, and how to encode that futzing, I'm not sure. Maybe a post-script-creation hook of some sort, and then let people write their own futzers?

The kind of futzing would be:

#!/usr/bin/env python
import site, os
site.addsitedir(os.path.join(os.path.dirname(__file__), 'vendor')

and stuff like that, all before running the actual script. It works okay, but requires knowledge of layout that the existing config options don't allow for.

@ianb
Copy link
Contributor Author

ianb commented Apr 26, 2012

Refreshed here: #519

@ianb ianb closed this Apr 26, 2012
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

auto-locked Outdated issues that have been locked by automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants