1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
Commit graph

583 commits

Author SHA1 Message Date
Donald Stufft 2f7007ca0a Merge pull request #4351 from dstufft/remove-10
Officially bump to 10.0 and remove deprecated items.
2017-03-20 14:45:02 -04:00
Alex Gaynor 3e527f2fbf Fixed some pytest warnings in the tests 2017-03-20 11:45:29 -04:00
Donald Stufft ffac1c2180 Removed the deprecated --default-vcs option 2017-03-20 10:49:57 -04:00
Donald Stufft 95b9541ed4 Remove the deprecated --(no-)use-wheel flags 2017-03-20 10:49:56 -04:00
Ville Skyttä cee7a53712 Python 3.6 invalid escape sequence deprecation fixes 2017-03-20 13:54:29 +01:00
Donald Stufft bb41490225 Removed the deprecated --allow-* commands from PEP 438 2017-03-19 20:51:54 -04:00
Donald Stufft bb48371714 Removed the deprecated `--egg` flag 2017-03-19 20:31:23 -04:00
Donald Stufft ceb7feed75 Update tests for the removal of Python 2.6 2017-03-18 14:52:14 -04:00
Jason R. Coombs dd3defe509 Import setuptools in a subprocess. (#4294) 2017-03-05 11:29:50 -05:00
Anish Tambe 85b5b16417 macOS use ~/.config/pip/pip.conf as well (#4100) 2017-03-02 14:14:13 +01:00
Anish Tambe f913942479 Improve message when installing requirements file (#4127) (#4211)
* improve message when installing requirements file (#4127)

* Refactor for issue (#4127)
2017-01-17 23:14:09 +01:00
Pradyun S. Gedam 406694e87d Reduce the API of Configuration class 2016-12-23 14:39:15 +05:30
Pradyun 666f6db069 Move out all the config code to a separate module (#4192)
This refactor is intended to make it easier to make configuration related improvements in the future, since all the code is in a separated unit.

The unit tests have been updated partially to merely update them. They now patch underscore names which means that they probably need updating.
2016-12-23 09:46:04 +01:00
Xavier Fernandez b867c78904 Refactor InstallRequirement instantiation 2016-12-11 19:53:25 +01:00
Xavier Fernandez b559221ee1 Move uninstall file selection logic to req_uninstall.py 2016-11-20 13:04:14 +01:00
Francesco Montesano d64b871d97 Allow pip install with entrypoint names with colons (#3901) 2016-11-19 00:27:16 +01:00
Lipis d86d171364 OS X -> macOS (#4074) 2016-11-06 12:24:43 -05:00
Xavier Fernandez 8f171cd212 Fix environment markers evaluation - issue #3829 (#4051) 2016-11-02 08:28:17 -04:00
Donald Stufft c8e8a99b7a Upgrade Dependencies (#4038)
* Upgrade distlib to 0.2.4

* Upgrade distro to 1.0.0

* Upgrade html5lib to 1.0b10

* Upgrade requests to 2.11.1

* Upgrade CacheControl to 0.11.7

* Upgrade ipaddress to 1.0.17

* Upgrade pyparsing to 2.1.10

* Upgrade packaging to 16.8

* Add webencodings 0.5

* Add ordereddict 1.1
2016-10-30 01:35:28 -04:00
Xavier Fernandez 11cc37932c Abort install if Requires-Python do not match the running version 2016-10-27 18:43:59 +02:00
Paul Moore e37a878312 PEP8 fix 2016-10-05 23:11:37 +01:00
Paul Moore d05e2a2b0f Test for issues #3970/#3463 2016-10-05 22:45:21 +01:00
Stéphane Bidoul 4c4df9712a use git fetch --tags
to fetch tags in addition to everything else that
is normally fetched; this is necessary in case a git requirement url
points to a tag or commit that is not on a branch
2016-10-03 18:42:10 +02:00
Paul Moore 1f2d639029 Skip a couple of tests that fail on Windows 2016-09-01 19:59:07 +01:00
Xavier Fernandez 5bd3367644 Merge pull request #3760 from patricklaw/pl.pip-install-additional-options
Pl.pip install additional options
2016-08-12 10:27:57 +02:00
Matthias Bussonnier bfd8794aad Set test docstring ad add to CHANGES.txt 2016-07-29 09:41:10 -07:00
Matthias Bussonnier d4e22ea097 Add tests 2016-07-28 15:18:44 -07:00
Mathew Jennings 9a4be9b281 Add --platform and --python-version to pip download.
With the --platform option, a user can download wheels with
a different platform than that of the local machine running the command.

With the --python-version option, a user can
download wheels that are explicitly compatible with a specific
Python interpreter version.

This functionality is meant for utilities that gather dependencies
and prepare distributions for other platforms.
2016-07-21 13:01:52 -05:00
Nathaniel J. Smith a942fb9331 Report correct glibc version in pip user-agent (#3836) 2016-07-09 23:17:04 -04:00
Jakub Wilk 6dc28c1b31 Fix typos 2016-06-10 21:29:43 +02:00
Jivan Amara 36de76f0a5 Strip authentication from SVN url prior to passing it into svn (#3697) 2016-05-26 06:43:26 -04:00
Stéphane Bidoul (ACSONE) 4d1b798465 Allow creating wheels for editable packages (#3695) 2016-05-26 06:41:01 -04:00
Zvezdan Petkovic 4e2c1fa77c Use a realpath for the temporary build directory. (#3701)
Some systems have /tmp symlinked which confuses custom builds, such as
numpy. This ensures that real path is passed and that such builds
resolve their paths correctly during build and install.

Added test for the change and also for the previous related fix: #707

---

*This was migrated from pypa/pip#3079 to reparent it to the ``master``
branch. Please see original pull request for any previous discussion.*
2016-05-19 21:02:26 -04:00
Ville Skyttä 46582e5ab6 Use logger.warning instead of deprecated logger.warn 2016-04-15 16:30:28 +03:00
Matt Iversen dfa5e615e9 Merge pull request #3590 from njsmith/robustify-have_compatible_glibc
Make have_compatible_glibc more robust against unusual version strings
2016-04-11 08:50:07 +10:00
burrows 3c11bb4de9 Give markers chance to remove incompat wheel links
`pip install -r reqs.txt` was failing when the requirements file includes
an unsupported wheel, regardless of whether it is conditionally removed
by a marker. This patch fixes that issue.

Additionally, this patch makes pip check local file wheels for
compatibility. Previously, a requirements file could include a path
to a valid wheel for any platform and pip would happily install it.
2016-04-07 13:00:03 -04:00
Nathaniel J. Smith 85df03455e Add a test for handling of totally malformed glibc version strings 2016-03-30 15:04:47 -07:00
Nathaniel J. Smith e01425d6e9 Make have_compatible_glibc more robust against unusual version strings
Downstream forks/redistributors of glibc apparently sometimes add junk
onto the end of the version number -- e.g. Linaro glibc might have a
version number like "2.20-2014.11". This makes the glibc version number
parsing code ignore the rest of the string after the minor version
number, to be robust against Linaro's current usage, as well as whatever
exciting new weirdnesses that other redistributors might come up with
in the future.

Fixes: gh-3588
2016-03-24 18:49:36 -07:00
Donald Stufft 240385a35f Merge pull request #3307 from s-t-e-v-e-n-k/packaging-requirements
Packaging requirements
2016-03-22 08:19:12 -04:00
Xavier Fernandez 50ed3d49e9 Check for PEP263 headers in req files 2016-03-07 11:08:59 +01:00
Donald Stufft 8e236dd6a0 Update to use the Requirement class from packaging 2016-03-07 11:40:39 +11:00
Donald Stufft b13a2c691e Merge pull request #3496 from edmorley/use-url-in-suggested-hashes
Correct package hash line suggestions for URL requirements
2016-03-05 11:15:43 -05:00
Donald Stufft 05baa9fcb1 Merge pull request #3497 from ogrisel/pr-3446-followup
Add PEP 513 support (manylinux1 platform tag)
2016-03-04 07:02:54 -05:00
Ed Morley 4bc0395a53 Correct the suggested package hash lines for URL requirements
When require hashes mode is enabled, if any packages defined in the
requirements file are missing a hash, installation fails with a message
suggesting the appropriate lines that should be copied into the
requirements file.

This worked fine for requirement specifiers such as `requests==2.9.1`,
however for packages specified by URL, the resultant output did not
match that originally in the requirements file.

For example a requirements file containing:
```
--require-hashes
https://github.com/benoitc/gunicorn/archive/19.4.5.zip
https://github.com/kennethreitz/requests/archive/v2.9.1.zip#egg=requests==2.9.1
```

Would result in:
```
Hashes are required in ...
    unknown package --hash=sha256:399347c0a7272fb70b45d5840027c372f...
    requests==2.9.1 --hash=sha256:89839b1698243e232780d1fc808ae8730...
```

Now the original URL line is correctly shown:
```
Hashes are required in ...
    https://github.com/benoitc/gunicorn/archive/19.4.5.zip --hash=...
    https://github.com/kennethreitz/requests/archive/v2.9.1.zip#egg=requests==2.9.1 --hash=...
```

Fixes #3362.
2016-03-04 10:46:40 +00:00
Xavier Fernandez b2ee4f8255 Simplify test
locale.getpreferredencoding(False) is not always utf8
2016-03-04 10:50:29 +01:00
Xavier Fernandez e2889268bd utils: decode requirement files according to their BOM if present 2016-03-04 10:50:29 +01:00
Robert T. McGibbon b0351b3285 Implement PEP 513: manylinux1 platform tags 2016-03-04 09:55:33 +01:00
Donald Stufft a1e308d847 Merge pull request #3458 from xavfernandez/freeze_all
Add --all option to pip freeze
2016-03-03 07:23:32 -05:00
Donald Stufft 37da4b21fa Merge pull request #3435 from fungi/develop
Case-insensitive match secure origin names
2016-03-03 07:21:40 -05:00
Olivier Grisel 09b99e8ece Move pep425tags tests to their own file 2016-02-23 09:36:24 +01:00
Xavier Fernandez 2956a3ef41 Add --all option to pip freeze
In order to include pip/setuptools/wheel in the freeze output
Closes #1610
2016-02-17 13:29:32 +01:00
Stéphane Bidoul 5e2a59cd2a add test for link fragments 2016-02-09 15:53:42 +01:00
Stéphane Bidoul f3ca1b973f remove editable_options which is now obsolete code 2016-02-09 11:08:16 +01:00
Jeremy Stanley 9597acdbba Case-insensitive match secure origin names
DNS is non-case-sensitive, so case mismatches between origin names
and any declared trusted hosts are also irrelevant.
2016-02-03 20:08:12 +00:00
Donald Stufft d8d6fd0850 Merge pull request #3326 from xavfernandez/untar_timestamp
Make sure to keep the timestamp when untaring
2016-01-19 00:49:23 -05:00
Donald Stufft 3ae13b2e35 Merge pull request #3312 from sbidoul/no-branch-in-egg-name-sbi
stop the addition of the branch name in the #egg=... fragment
2016-01-18 18:04:03 -05:00
Xavier Fernandez b998ab6807 Skip SafeFileCache no_perms tests on windows
Since Windows is lacking geteuid, it is useless.
2016-01-17 22:40:46 +01:00
Xavier Fernandez 57ea6dd8b1 Fix TestUninstallPathSet.test_add 2016-01-17 22:40:46 +01:00
Xavier Fernandez 9162869adc Fix test_relative_local_find_links 2016-01-17 22:40:46 +01:00
Xavier Fernandez c9b48feea6 Fix test_relative_local_nested_req_files 2016-01-17 22:40:46 +01:00
Xavier Fernandez e1e93520e5 Fix test_install_prefix on Windows 2016-01-17 22:40:46 +01:00
Xavier Fernandez 08932c4a4e Fix test_reqs unit tests on windows 2016-01-17 22:40:46 +01:00
Xavier Fernandez fec74b29c0 Fix test_locations unit tests on windows 2016-01-17 22:40:46 +01:00
Xavier Fernandez 02b8c98970 Fix test_compact_shorter_path 2016-01-17 22:40:46 +01:00
Xavier Fernandez 2bc3e3b069 Drop useless test
find_all_candidates can not return an unsupported wheel:
it would have been skipped in _link_package_versions
2016-01-15 10:19:07 +01:00
Xavier Fernandez 81ce0deca2 No need to sort the candidates, just find the best 2016-01-15 10:19:07 +01:00
Stéphane Bidoul b5db433163 remove unused arguments find_tags in vcs.get_src_requirement 2016-01-14 19:04:04 +01:00
Stéphane Bidoul 6f790d1d80 stop the addition of the branch name in the #egg=... fragment 2016-01-14 19:04:02 +01:00
Xavier Fernandez ac0bb3f444 Ignores invalid urls with warning
for non-existing paths or url without scheme

closes #2968
2016-01-07 23:08:37 +01:00
Xavier Fernandez e0904eb5d2 Rename _find_all_versions to find_all_candidates 2016-01-03 15:07:12 +01:00
Ville Skyttä 8e436d994d Let logging format messages on demand 2016-01-03 00:21:59 +02:00
Xavier Fernandez 227572f757 Make sure to keep the timestamp when untaring
closes #3201
2016-01-02 17:08:24 +01:00
Xavier Fernandez 12cc427865 Fix test_sort_locations_file_not_find_link test
_sort_locations expects a list
2015-12-04 22:36:52 +01:00
Xavier Fernandez d459969b03 fix test_unexisting_path on windows 2015-12-01 13:07:19 +01:00
Xavier Fernandez b939c3d6d2 fix test_unsupported_hashes for windows 2015-12-01 12:57:46 +01:00
Xavier Fernandez 9cf0342de3 set os.pathsep 2015-12-01 00:01:49 +01:00
Xavier Fernandez 57c6d55a47 Monkeypatch os.path 2015-11-30 23:30:39 +01:00
Xavier Fernandez 2184d03604 test_appdirs: fix tests on windows 2015-11-30 22:51:41 +01:00
Marcus Smith ca47dc9949 Merge pull request #3252 from domenkozar/install/prefix
Support pip install --prefix
2015-11-26 09:30:20 -08:00
Sachi King f9c40564c4 monkeypatch os.path.exists over less code
PipSession attempts to create a user_agent which results in calls to
platform.linux_distribution being called, there is a chance this hits
platform._dist_try_harder, which calls os.path.exists("/a/bad/path")
then attempts to open and read from said path resulting in brekage.

This creates PipSession before mock patches os.path.exists then only
patches the call that requires os.path.exists to be patched.
2015-11-25 16:08:58 +11:00
Domen Kožar e14a66f1b9 Support --prefix argument to install command.
There was no way to override prefix for an installation for wheels
previously. The default it whatever sys.prefix points to.
2015-11-22 19:13:51 +01:00
Xavier Fernandez e42e822f2c Provide more helpful message on invalid requirement
closes #540, #1000, #1426
2015-11-13 11:05:02 +01:00
Donald Stufft f39bc756e5 Merge branch 'develop' into hashes2 2015-11-06 18:46:09 -05:00
Xavier Fernandez f1bf7515c2 pip.index: remove INSTALLED_VERSION
closes #703
2015-11-04 22:52:44 +01:00
Erik Rose f38fc903f2 Obey --require-hashes option in requirements files.
Removed the mention of "package index options" in the docs, because they don't all fit that category anymore. Not even --no-binary and --only-binary do; they're "install options".
2015-10-21 16:02:47 -04:00
Nate Coraor 63d239ffac 1. Provide a fallback mechanism for determining ABI flags if config vars
are unavailable, but issue a warning if this is used.
2. Explicitly handle the case where the unicode detection finds wide
   unicode but this is a 3.3+ build (necessary due to #1)
3. Fix tests broken due to #2.
2015-10-13 15:58:03 -04:00
Nate Coraor 1b5b4ac9f7 Add unit tests for manual SOABI detection 2015-10-13 10:38:07 -04:00
Erik Rose 0e6058bc63 Change head() method to an attr in hashing exceptions. Tweak English.
Standardize on present tense, improve flow, and clarify.
2015-10-10 22:44:12 -04:00
Marcus Smith 13d43e3af8 Merge pull request #3170 from qwcode/req_line_numbers2
update for processing continuations/comments for req files
2015-10-09 07:48:28 -07:00
Marcus Smith b58d2c9f34 process line continuations first (but with some special handling for comments) 2015-10-08 15:25:51 -07:00
Donald Stufft 9b29884fe9 Merge pull request #3066 from mattrobenolt/update-2
Only update VCS when things have actually changed
2015-10-08 16:26:18 -04:00
Erik Rose 7a0a97c081 Merge 'develop' into 'hashing' to bring the latter up to date. 2015-10-08 13:37:19 -04:00
Erik Rose bf0ff80d73 pep8 fixes 2015-10-07 17:31:40 -04:00
Marcus Smith 91e3c13926 migrate over some missing test cases from PR #3030 2015-10-03 21:08:35 -07:00
Marcus Smith 03de1c0072 Merge remote-tracking branch 'pypa/develop' into req_line_numbers 2015-10-03 20:44:21 -07:00
Marcus Smith 615adf9468 Merge remote-tracking branch 'pypa/develop' into issue_3011
Conflicts:
	CHANGES.txt
2015-10-03 10:21:15 -07:00
Marcus Smith 0d8933ced6 normalize the head to resolve parent directory symlinks, but not the tail 2015-10-03 09:17:26 -07:00
Andy Freeland 73a439ea66 Add pip.compat.expanduser to workaround http://bugs.python.org/issue14768 2015-09-29 16:01:32 -04:00
Andy Freeland 6be4627f89 Failing test case for #2996 2015-09-29 16:01:31 -04:00
Erik Rose 910b82c59d --require-hashes no longer implies --no-deps.
For dependencies that are properly pinned and hashed (not really dependencies at all, if you like, since they're explicit, root-level requirements), we install them as normal. For ones that are not pinned and hashes, we raise the errors typical of any unhashed requirement in --require-hashes mode.

Since the stanza under "if not ignore_dependencies" doesn't actually add anything if it's already in the RequirementSet, not much has to be done in the way of code: the unhashed deps don't have any hashes, so we complain about them as per usual.

Also...
* Revise wording of HashUnpinned errors. They can be raised even if no hash is specified, so the previous wording was misleading.
* Make wording of HashMissing less awkward.
2015-09-25 19:07:20 -04:00
Erik Rose f3f73f1c07 Remove the -H spelling for --hashes.
dstufft is nervous about blowing a single-char option on something that will usually be copied and pasted anyway. We can always put it back later if it proves to be a pain.
2015-09-25 15:32:33 -04:00
Erik Rose b0ef6ab5b4 Fix unicode errors in unit tests of Hashes under Python 3. 2015-09-25 12:24:32 -04:00
Erik Rose 0c17248998 Pass PEP 8 checks. 2015-09-24 22:16:00 -04:00
Erik Rose 11dbb92440 Switch from --sha256 etc. to a single option: --hash.
Everybody seems to favor this. Spelled -H, it's still pretty short. And it is less unusual programmatically.
2015-09-24 22:16:00 -04:00
Erik Rose 1e41f01823 Add checks against requirements-file-dwelling hashes for most kinds of packages. Close #1175.
* Add --require-hashes option. This is handy in deployment scripts to force application authors to hash their requirements. It is also a convenient way to get pip to show computed hashes for a virgin, unhashed requirements file. Eventually, additions to `pip freeze` should fill a superset of this use case.
  * In --require-hashes mode, at least one hash is required to match for each requirement.
  * Option-based requirements (--sha256=...) turn on --require-hashes mode implicitly.
  * Internet-derived URL-based hashes are "necessary but not sufficient": they do not satisfy --require-hashes mode when they match, but they are still used to guard against transmission errors.
  * Other URL-based requirements (#md5=...) are treated just like flag-based ones, except they don't turn on --require-hashes.
* Complain informatively, with the most devastating errors first so you don't chase your tail all day only to run up against a brick wall at the end. This also means we don't complain that a hash is missing, only for the user to find, after fixing it, that we have no idea how to even compute a hash for that type of requirement.
  * Complain about unpinned requirements when hash-checking mode is on, lest they cause the user surprise later.
  * Complain about missing hashes.
  * Complain about requirement types we don't know how to hash (like VCS ones and local dirs).
* Have InstallRequirement keep its original Link around (original_link) so we can differentiate between URL hashes from requirements files and ones downloaded from the (untrustworthy) internet.
* Remove test_download_hashes, which is obsolete. Similar coverage is provided in test_utils.TestHashes and the various hash cases in test_req.py.
2015-09-24 22:16:00 -04:00
Erik Rose 3303be0c4e Teach requirements parser how to parser hash options, like --sha256.
We purposely keep it off the CLI for now. optparse isn't really geared to expose interspersed args and options, so a more heavy-handed approach will be necessary to support things like `pip install SomePackage --sha256=abcdef... OtherPackage --sha256=012345...`.
2015-09-23 17:39:32 -04:00
Marcus Smith 2b0a722191 - add a preprocess function so that interactions between filtering and
joining can easily be tested
- add some test cases mentioned by @pgervais
- deal with case of last line ending with \
2015-09-22 16:53:26 -07:00
Marcus Smith 6fe27deb36 pep8 fixes 2015-09-21 14:22:45 -07:00
Marcus Smith 67b0050ac4 correct use of enumerate in skip_regex tests 2015-09-21 14:21:05 -07:00
Marcus Smith ecdb8584f8 refactor to preserve reporting of original line numbers in requirement files 2015-09-21 14:10:31 -07:00
Xavier Fernandez 7b44092f06 Remove unused user_log_dir 2015-09-11 17:44:30 +02:00
Roy Wellington Ⅳ 455f3b4e74 SSH is a secure protocol, and allow repository links ("git+") to validate. 2015-09-09 18:59:03 -07:00
Xavier Fernandez b290e13cfa Allow --pre option in requirement files
closes #1273
2015-09-05 23:13:03 +02:00
Xavier Fernandez a9325b0727 Allow --process-dependency-links in req files
closes #1274
2015-09-05 20:19:30 +02:00
Xavier Fernandez e168b845a4 Allow --trusted-host option in requirement files
closes #2822
2015-09-03 22:33:31 +02:00
Donald Stufft 6afc718307 Remove items slated for removal in pip 8.0 2015-09-03 10:55:11 -04:00
Donald Stufft 0f5d4286a5 Deprecate and Noop the PEP 438 functionality due to PEP 470 2015-09-02 23:47:05 -04:00
Matt Robenolt 4c3ab41e90 Only update VCS when things have actually changed
This saves a network hop when using git and passing an explicit sha
as a ref by comparing the version that's already checked out.

Yields a ~4x speedup on my local machine

Before:
```
$ /usr/local/bin/pip --version
pip 7.1.0 from /usr/local/lib/python2.7/site-packages (python 2.7)
$ time /usr/local/bin/pip install --disable-pip-version-check -e git+https://github.com/getsentry/raven-python.git@56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e#egg=raven_dev
Obtaining raven-dev from git+https://github.com/getsentry/raven-python.git@56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e#egg=raven_dev
  Updating ./src/raven-dev clone (to 56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e)
  Could not find a tag or branch '56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e', assuming commit.
Installing collected packages: raven-dev
  Running setup.py develop for raven-dev
Successfully installed raven-dev
/usr/local/bin/pip install --disable-pip-version-check -e   0.84s user 0.48s system 39% cpu 3.300 total
```

After:
```
$ /Users/matt/.virtualenvs/pip/bin/pip --version
pip 7.2.0.dev0 from /Users/matt/code/pip (python 2.7)
$ time /Users/matt/.virtualenvs/pip/bin/pip install --disable-pip-version-check -e git+https://github.com/getsentry/raven-python.git@56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e#egg=raven_dev
Obtaining raven-dev from git+https://github.com/getsentry/raven-python.git@56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e#egg=raven_dev
checking version
  Skipping because already up-to-date.
Installing collected packages: raven-dev
  Running setup.py develop for raven-dev
Successfully installed raven-dev
/Users/matt/.virtualenvs/pip/bin/pip install --disable-pip-version-check -e   0.59s user 0.22s system 98% cpu 0.824 total
```
2015-09-01 13:23:18 -07:00
Donald Stufft cc7f416378 Merge pull request #3037 from ianw/no-reset-platlib
Don't reset purelib/platlib when install-dir not set
2015-08-19 17:27:21 -04:00
Ian Wienand d871bcd1bb Don't reset purelib/platlib when install-dir not set
Change 3affcaa2b8 attempts to reset
purelib & platlib to any "install-dir" specified by the user in
setup.cfg.  This code is used when we are installing wheels.

The problem with this is that distutils is *always* setting
"i.install_lib" -- even when the user specifies nothing.  This has the
result of unconditionally setting purelib == platlib.

On some systems this results in .so's from the wheel getting installed
into /usr/lib/python2.7 (purelib) rather than /usr/lib64/python
(platlib).  Because distribution-packaged libraries have installed
their .so into platlib, we can now have a situation where the new
pip-installed library is picking up an old .so from the distro package
... with predictably bad results.

This takes the approach of checking the configuration to see if the
user has overridden install-dir and only resetting the paths if they
have.  The override case is covered by existing test-cases.

Closes #2940
2015-08-19 14:56:53 +10:00
Xavier Fernandez 0e8d5801b0 Compute pip version from its metadata
Move InstallRequirement.installed_version to a get_installed_version helper
Adapt test
2015-07-06 10:28:18 +02:00
Min RK 659d81d880 verify that hyphens are never allowed in tags 2015-06-18 14:49:56 -07:00
Robert Collins bb0b429a49 Issue #2731: Constraints files.
This adds constraints files. Like requirements files constraints files
control what version of a package is installed, but unlike
requirements files this doesn't itself choose to install the package.
This allows things that aren't explicitly desired to be constrained if
and only if they are installed.
2015-06-03 06:38:33 +12:00
Donald Stufft 9089430ab7 Support a falsey cache-dir 2015-06-01 20:52:02 -04:00
Donald Stufft f25aef0720 Remove a screwy merge 2015-06-01 20:32:29 -04:00
Donald Stufft 165cf7a228 Merge branch 'master' into develop 2015-06-01 19:57:26 -04:00
Donald Stufft d57d19c468 Merge pull request #2853 from dstufft/expand-path
Expand ~ in the wheel cache directory
(cherry picked from commit d97ff459ee)
2015-06-01 18:31:02 -04:00
Donald Stufft 224c625646 Merge pull request #2841 from rbtcollins/stable
Issue #2839: Avoid dequoting markers in req files.
(cherry picked from commit 70c200be7e)
2015-06-01 18:16:44 -04:00
Donald Stufft 0ebc37d17a Expand ~ in the wheel cache directory 2015-06-01 17:24:11 -04:00
Marcus Smith c16747bfd0 - we won't be shlex parsing the args later,
so the split here should just be simple string split on ' '
- token parsing logic fixes
- text fixes (tuples, not lists)
2015-06-02 06:50:16 +12:00
Marcus Smith f4b2ee1a9e Break up the line into an args and options string.
We only want to shlex (and then optparse) the options, not the args.
args can contain markers which are corrupted by shlex
2015-06-02 06:50:05 +12:00
Marcus Smith d85ceb06fe Merge pull request #2846 from mrtrumbe/dev/issue1236_movetests
Moved tests for InstallRequirement extras handling from test_req_file to test_req.
2015-06-01 07:30:21 -07:00
matthew 111dbc95dc Moved tests for InstallRequirement extras handling from test_req_file to test_req. 2015-05-31 13:43:39 -05:00
Donald Stufft 3a7adebe79 Merge pull request #2810 from dstufft/allow-all-external-req-file
Allow --allow-all-external inside of a requirements.txt
(cherry picked from commit b6b77e7957)
2015-05-22 19:29:21 -04:00
Donald Stufft 09542477a9 Allow --allow-all-external inside of a requirements.txt 2015-05-22 17:51:35 -04:00
Donald Stufft 56d5076ee2 Hide setup.py output unless using -v 2015-05-20 21:27:12 -04:00
Matthew Trumbell 714a727571 Added tests for extras specifications as part of requirement parsing. Breaking tests are in preparation of a fix for #1236. 2015-05-14 11:21:51 -05:00
Donald Stufft 08160408fb Only warn on final releases with different base versions
We only want to prompt people to upgrade their pip version if the
newer version is not a post release of the version they have and
it's not a pre-release version.
2015-05-09 13:37:12 -04:00
Marcus Smith 744b3bde3a doc strings for nested requirement file tests 2015-05-01 16:30:14 -07:00
Marcus Smith 5b6ba9cbcd pep8 fix 2015-05-01 16:15:52 -07:00
Marcus Smith 924215fab9 tests for nested requirements files 2015-05-01 16:04:20 -07:00
Marcus Smith 769782c477 pep8 fix 2015-04-24 22:37:29 -07:00
Marcus Smith 7c83f8d3cd 1) parse with defaults set as they are naturally (vs forcing to None)
and adjust the logic to match; the result is simpler.
2) Due to #1, we can remove some hairy "format_control" hacks
3) Due to #1, we have to relax the parsing and allow:
   - multiple options per line
   - any supported option on a line with a requirement (not just
     --install-option/--global-option, although they are the only
     options that are passed into a requirement)
2015-04-24 22:32:26 -07:00
Robert Collins 582af6e684 Issue #2677: Disable wheels for setup.py options.
Using --install-options, --build-options, --global-options changes
the way that setup.py behaves, and isn't honoured by the wheel code.
The new wheel autobuilding code made this very obvious - disable
the use of wheels when these options are supplied.
2015-04-24 16:14:48 +12:00
Robert Collins 6aec23cafe Issue #2675: Granular control over wheels/sdists
With wheel autobuilding in place a release blocker is some granular
way to opt-out of wheels for known-bad packages. This patch introduces
two new options: --no-binary and --only-binary to control what
archives we are willing to use on both a global and per-package basis.

This also closes #2084
2015-04-24 08:52:48 +12:00
Marcus Smith b911339625 Merge remote-tracking branch 'pypa/develop' into refactor_req_file
Conflicts:
	pip/req/req_file.py
2015-04-23 02:21:01 -07:00
Marcus Smith 55e7bd3daa handle requirement specifiers with spaces, e.g. "pkg >= 1" 2015-04-23 01:31:48 -07:00
Donald Stufft 33764609eb Merge pull request #2715 from citruspi/Error-Log-Level-Flag
Differentiate Between Quiet Flag Counts
2015-04-22 20:46:55 -04:00
Mihir Singh 3a340bc2ed Added a unit test for three quiet flags 2015-04-22 18:40:41 -05:00
Mihir Singh 4d042621e8 Added a unit test for two --quiet flags 2015-04-22 18:21:20 -05:00
Robert Collins ec46a3bac4 Replace wheel cache cache_dir with an object.
Wheel cache lookups become more complex when we wish to allow binary
blacklisting. Rather than passing more parameters around, replace
cache_root with wheel_cache, and create a wheel cache in all the
relevant command entry points.
2015-04-23 10:03:50 +12:00
Robert Collins 62041d3ca8 Cleanup now use_wheel is the default.
There were a bunch of tests passing use_wheel unnecessarily, this
makes the change to remove use_wheel larger than it needs to be.
2015-04-20 20:12:03 +12:00
Marcus Smith 5c4632f8b0 pep8 fixes 2015-04-18 13:24:44 -07:00
Marcus Smith b590ab436b tests for: joining lines, skipping regex, and appending options 2015-04-18 12:32:30 -07:00
Marcus Smith 9c66633c29 - fixes to TestOptionVarants
- consistent use of the finder fixture
2015-04-18 11:59:17 -07:00
Marcus Smith bed77a971a remove duplicate test 2015-04-18 11:56:17 -07:00
Marcus Smith 49e9ac1a86 tests for option variants 2015-04-18 11:53:14 -07:00
Marcus Smith 437871878b process_line tests for setting attributes on the finder, and the fixes for problems that were found 2015-04-18 11:42:06 -07:00
Marcus Smith 764e468f42 refactor the requirements file parsing
two major changes:

1) re-use the optparse options in pip.cmdoptions instead of maintaining
   a custom parser

2) as a result of #1, simplify the call stack
    from:  parse_requirements -> parse_content -> parse_line
      to:  parse_requirements -> process_line

beyond #1/#2, minor cosmetics and adjusting the tests to match
2015-04-16 22:10:46 -07:00
Robert Collins 4926409340 Issue #2563: Read cached wheels from ~/.cache/pip
This won't put wheels into that directory, but will read them if they
are there. --no-cache-dir will disable reading such wheels.
2015-04-13 18:33:07 +12:00
Marcus Smith 331524259b fix join_lines test 2015-04-13 00:07:15 +02:00
Marcus Smith fc5c6e5026 tests for: isolated mode, default vcs, ignoring comments, setting the finder, joining lines, 2015-04-13 00:07:15 +02:00
Marcus Smith 480a6f4245 add tests for raising RequirementsFileParseError 2015-04-13 00:07:15 +02:00
Marcus Smith 81a41e49d8 pep8 fixes 2015-04-13 00:07:15 +02:00
Marcus Smith 9159a1db2a assert the order of the install/global options in the install call 2015-04-13 00:07:15 +02:00
Marcus Smith 1294c0d9a7 replace use of obscure '--one-two-3' option in test 2015-04-13 00:07:15 +02:00
Marcus Smith 90f17915be consolidate tests from test_req to test_req_file 2015-04-13 00:07:15 +02:00
Marcus Smith 6c747be598 move some tests from test_req to test_req_file 2015-04-13 00:07:15 +02:00
Marcus Smith e26d67c4cf tests for pip.req.req_file 2015-04-13 00:07:15 +02:00
Marcus Smith d051669149 create new test module for req_file.py and stub out the classes 2015-04-13 00:07:15 +02:00
Georgi Valkov 0da51b14d7 Remove misleading test cases and improve docs 2015-04-12 23:52:49 +02:00
Georgi Valkov 29f0c75c63 Do not shlex.split() and flatten value of global|install_options 2015-04-12 23:52:49 +02:00
Georgi Valkov 5a57325761 Fix pep8 compatibility 2015-04-12 23:52:49 +02:00
Georgi Valkov 832c050ca4 Fix pep8 compatibility 2015-04-12 23:52:49 +02:00
Georgi Valkov 0ab7a7bbb5 Use optparse and pip.cmdoptions for parsing requirement-line options 2015-04-12 23:52:49 +02:00
Georgi Valkov 4a70730617 Replace all occurrences of install|global-options with install|global-option 2015-04-12 23:52:49 +02:00
Georgi Valkov b014668b30 Add --install-options and --global-options to the requirements file parser
This allows lines such as the following to exist in requirements files:

  INITools==0.2 --install-options="--prefix=/opt"
  virtualenv>=1 --global-options="--no-user-cfg"

In addition, the requirements file parser was overhauled with simplicity
and clarity in mind.
2015-04-12 23:52:49 +02:00
Donald Stufft 92ea0851ec Merge pull request #2659 from xavfernandez/check_markers
Always check environment markers
2015-04-09 18:40:09 -04:00
Robert Collins fd33cd3ddf Rationalise wheel_dir usage.
We we normalising it right before making it, after passing it
RequirementSet, which means RequirementSet also had to normalise it.

And then we passed it to WheelBuilder which as a result had to
normalise it too.

Instead, pass it as-is to RequirementSet, have that normalise it, and
then pull it back out in WheelBuilder.
2015-04-08 09:40:05 +12:00
Xavier Fernandez a947c29903 Always check environment markers
Fixes #2658
2015-04-07 22:42:17 +02:00
Marc Abramowitz 0684a9f478 Move InstallationCandidate to pip.index
Move InstallationCandidate from `pip.req.req_requirement` to
`pip.index`, the one place where it's used.
2015-04-07 11:56:57 -07:00
Donald Stufft 7113e434a6 Merge pull request #2629 from xavfernandez/index_cleanup
Index cleanup
2015-04-07 06:10:40 -04:00
Xavier Fernandez a1451b192d add expand_dir arg to _sort_locations 2015-04-07 10:59:14 +02:00
Xavier Fernandez d8609a5890 Log all skipped link the same way 2015-04-07 10:41:03 +02:00
Donald Stufft 7288475118 We no longer need to handle a static build directory 2015-04-07 04:20:51 -04:00
Donald Stufft b7309c6bcc Remove the items deprecated for removal in 7.0 2015-04-07 04:20:51 -04:00
Donald Stufft a510b2229e Reverts #2493 - Upgrades will again contact the index 2015-04-04 14:21:40 -04:00
Xavier Fernandez 1683f2caf6 PackageFinder._find_all_versions only needs the project_name 2015-03-27 17:38:50 +01:00
Xavier Fernandez 8bff8b5411 PackageFinder._get_index_urls_locations only needs req_name
and InstallRequirement does not need its url_name property anymore
2015-03-27 17:31:05 +01:00
Marcus Smith 39ae3c3459 Merge pull request #2552 from takluyver/uninstall-symlinks
Don't follow symlinks when uninstalling files
2015-03-22 08:36:10 -07:00
Thomas Kluyver b5d84a0dba Fix monkeypatching of is_local() 2015-03-20 16:18:43 -07:00
Thomas Kluyver 94c63a78c1 Fix pep8 in tests again 2015-03-20 16:18:33 -07:00
Thomas Kluyver 068dfd7bd9 Simplify tests using pytest fixtures 2015-03-20 16:09:34 -07:00
Marc Abramowitz d02cb6de43 Speed up _filter_install function
This speeds up the _filter_install function that is used to filter the
output of `python setup.py install` when installing packages. It does
this by using a single regex which is pre-compiled and thus avoiding a
`for` loop over 15 different regexes.

Before:

    $ python
    Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import timeit
    >>> timeit.timeit("""_filter_install("if we've already set distribute as a conflict to setuptools blah blah blah blah")""", setup='from pip.req.req_install import InstallRequirement; ir = InstallRequirement("foo", None, None); _filter_install = ir._filter_install')
    21.220640897750854

After:

    $ python
    Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import timeit
    >>> timeit.timeit("""_filter_install("if we've already set distribute as a conflict to setuptools blah blah blah blah")""", setup='from pip.req.req_install import InstallRequirement; ir = InstallRequirement("foo", None, None); _filter_install = ir._filter_install')
    0.9454500675201416
2015-03-19 19:27:19 -07:00
Thomas Kluyver 7034545111 Make pep8 linter happy 2015-03-19 09:35:53 -07:00
Thomas Kluyver 7982ecc1e8 Make pep8 a bit happier
Still not very happy
2015-03-18 17:45:53 -07:00
Thomas Kluyver 9f66f31d42 Add tests for UninstallPathSet 2015-03-18 17:37:24 -07:00
Thomas Kluyver e1989f0d1a Add test for normalize_path()
And call abspath() when not following symlinks
2015-03-18 16:02:30 -07:00
Donald Stufft 34073df838 Merge pull request #2493 from msabramo/issue-770-redux
Fix for #770: pip install -U shouldn't look at pypi if not needed
2015-03-17 07:26:34 -04:00
Marc Abramowitz 94fcd18ed4 Fix for #770: pip install -U shouldn't look at pypi if not needed
If an exact version is specified for install, and that version is
already installed, then there is no point going to pypi as no install
is needed.

Adds a test called
`test_upgrade_no_look_at_pypi_if_exact_version_installed`.

This is a rework of PR #771, because that PR is old and has merge
conflicts that were easier to fix by applying the changes manually.
2015-03-16 22:30:13 -07:00