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

1992 commits

Author SHA1 Message Date
Donald Stufft
136b15f33e Merge pull request #3287 from sigmavirus24/bug/3282
Alias imports for vendored requests deps
2016-01-19 19:19:51 -05:00
Donald Stufft
8943ce44cb Merge pull request #3382 from dstufft/upgrade
Upgrade CacheControl to 0.11.6
2016-01-19 17:53:17 -05:00
Donald Stufft
0337e3399d Upgrade CacheControl to 0.11.6 2016-01-19 17:16:25 -05:00
Xavier Fernandez
18b5fc2c44 pip.wheel: change --wheel-dir default value
From <current working directory>/wheelhouse to <current working
directory> only to be consistent with pip download behavior.
2016-01-19 22:42:22 +01:00
Donald Stufft
1ae7707e96 Default to downloading to the current directory 2016-01-19 13:05:34 -05:00
Donald Stufft
3b3978b994 Merge pull request #3284 from ncoghlan/pep376-installer-file
Record pip in INSTALLER file
2016-01-19 10:41:08 -05:00
Donald Stufft
6f5e46fc54 Merge pull request #3376 from dstufft/more-policy
More bundling policy updates
2016-01-19 10:33:14 -05:00
Donald Stufft
54e2c81a7a Upgrade packaging to 16.0 2016-01-19 10:03:06 -05:00
Donald Stufft
0697d8bd3f Fix grammar 2016-01-19 08:52:29 -05:00
Donald Stufft
5e9617499d Clarify more in the policy 2016-01-19 08:52:21 -05:00
Donald Stufft
302875381a Update our policy on bundling 2016-01-19 07:32:10 -05:00
Donald Stufft
bcf61f4b40 Merge pull request #3374 from dstufft/close-file
Restore the close to this file object
2016-01-19 06:03:43 -05:00
Donald Stufft
60a728393c Merge pull request #3373 from dstufft/ssl-default
Use ssl.get_default_verify_paths() to get the system CABundle
2016-01-19 06:02:20 -05:00
Donald Stufft
2bde707063 Restore the close to this file object 2016-01-19 05:39:54 -05:00
Donald Stufft
d966eb9735 Use ssl.get_default_verify_paths() to get the system CABundle 2016-01-19 00:57:45 -05: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
a6e329fef4 Merge pull request #3371 from dstufft/upgrade
Upgrade colorama, ipaddress, lockfile, requests, and six
2016-01-18 23:51:12 -05:00
Donald Stufft
35feedebc1 Merge pull request #3324 from jsbarber/develop
Fix for issue #2834 with test
2016-01-18 23:21:09 -05:00
Donald Stufft
1a98cb8edf Upgrade html5lib to 1.0b8 2016-01-18 23:16:35 -05:00
Donald Stufft
38754585a1 Upgrade setuptools to 19.4 2016-01-18 23:16:35 -05:00
Donald Stufft
8ef42523cf Upgrade six to 1.10.0 2016-01-18 18:29:52 -05:00
Donald Stufft
c7214084a0 Upgrade requests to 2.9.1 2016-01-18 18:28:54 -05:00
Donald Stufft
857da63b7c Upgrade lockfile to 0.12.2 2016-01-18 18:26:22 -05:00
Donald Stufft
98b8106770 Upgrade ipaddress to 1.0.16 2016-01-18 18:24:50 -05:00
Donald Stufft
4f4d8a683b Upgrade colorama to 0.3.6 2016-01-18 18:23:50 -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
b47c14405b Provide an alternative to os.path.samefile
For windows under python2
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
fec74b29c0 Fix test_locations unit tests on windows 2016-01-17 22:40:46 +01:00
Xavier Fernandez
81ce0deca2 No need to sort the candidates, just find the best 2016-01-15 10:19:07 +01:00
Xavier Fernandez
e126033ad5 keep the compatible_versions list 2016-01-15 10:19:07 +01:00
Xavier Fernandez
d1136dda3e Add support for .xz files (with python >=3.3)
Closes #722
2016-01-14 22:39:45 +01:00
Donald Stufft
033fac5ee6 Allow all wheels from PyPI
It's unlikely that we're going to need any changes in pip itself
to support linux enabled wheels except for maybe a more specific
platform tag. If a more specific platform tag is needed then older
pip's won't install that anyways. This should allow experimentation
with some possible solutions to linux enabled wheels.
2016-01-14 13:54:31 -05: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
4b79192c4a remove unused code 2016-01-14 19:04:04 +01:00
Stéphane Bidoul
d362ada5a4 pep8 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
21fb8a28f0 Dont raise on #egg metadata mismatch, just warn
Since pip 7, via pip freeze, is producing such mismatching #egg
fragment, forbidding them in pip 8 would be too strongly
backward-incompatible.
It is a partial rollback of 1a012bb6.
2016-01-14 00:30:02 +01:00
Xavier Fernandez
99aa8f9b78 Merge pull request #3346 from dalito/fix_svn_issue_#1062
Fix for svn related bug #1062
2016-01-14 00:26:00 +01:00
David Linke
25a84f1a02 Avoid error with svn >= 1.7 which does no longer have an entries-file to read from (fixes #1062) 2016-01-07 23:22:10 +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
Jeff Barber
24a5cc6a42 Fix for issue #2834 with test 2016-01-03 17:38:36 -05:00
Xavier Fernandez
097e36ac27 simplify list --outdated command 2016-01-03 15:07:12 +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
Alex Gaynor
3ac8970199 conditional fix 2016-01-02 14:29:35 -05:00
Alex Gaynor
e9b8a4d83d by order of the high commisioner on software, Python 2.6 is extremely illegal 2016-01-02 14:11:20 -05:00
Alex Gaynor
e0961df48b Include the OpenSSL version in the user agent 2016-01-02 14:06:41 -05:00
Xavier Fernandez
85e143c23d content_type is not used 2016-01-02 18:59:31 +01:00
Xavier Fernandez
227572f757 Make sure to keep the timestamp when untaring
closes #3201
2016-01-02 17:08:24 +01:00
Xavier Fernandez
f1b1061fc3 Fix assert message
- use python 2.6 compatible syntax
- add missing {}
2016-01-02 17:06:55 +01:00
Alex Gaynor
e799283156 fixed a few flake8 errors 2016-01-01 15:47:31 -05:00
Alex Gaynor
37abf47dce move where the deprecation is so its in pretty colors 2016-01-01 14:33:36 -05:00
Alex Gaynor
38e2aa4dd2 Emit a warning when pip is used on Python 2.6
Python 2.6 is unmaintained by the Python core team, we should encourage users to upgrade.
2016-01-01 14:19:49 -05:00
Xavier Fernandez
034232f0e0 Merge pull request #3317 from scop/spelling
Spelling fixes
2015-12-29 23:19:56 +01:00
Ville Skyttä
0da18e93b3 Spelling fixes 2015-12-27 00:58:23 +02:00
Xavier Fernandez
48e89adba7 Ignore again distutils prefix when using --user
Was initially introduced in b227c45a7
But accidentaly removed in 7270d272f
2015-12-17 00:15:57 +01:00
Ian Cordasco
1b6ab07e3b Alias imports for vendored requests deps
Some distributions unvendor pip while leaving other packages vendored.
In the case of this bug, pip's dependencies were unvendored while
requests did not have its dependencies unvendored. This caused a
problem where urllib3 was receiving a
pip._vendor.requests.packages.urllib3.Retry instance but expecting a
requests.packages.urllib3.Retry instance. Since they aren't the same,
urllib3 assumed it was an integer and we received a TypeError as
described in the bug report.

Creating aliases for urllib3 and it's submodules should fix this
(similar to how we specify six, six.moves, six.moves.urllib, packaging,
packaging.version, and packaging.specifiers)

In the case of urllib3's contrib modules, we need to be careful to
import them to prevent against future headaches without causing
an ImportError for the cli if the optional dependencies are not
available.

Closes #3282
2015-12-04 13:25:21 -06:00
Stéphane Bidoul
98ee8761bc better parameter style for call_subprocess() 2015-12-04 18:36:33 +01:00
Stéphane Bidoul
a1622ad0a5 detect editable distribution by the presence of .egg-link 2015-12-04 14:40:24 +01:00
Stéphane Bidoul
c1176b01dc support &subdirectory option with freeze and git 2015-12-04 14:40:20 +01:00
Stéphane Bidoul
23d86c90b6 add git support for controls_location() 2015-12-04 14:40:00 +01:00
Nick Coghlan
a925c88ed6 Record pip in INSTALLER file 2015-12-04 19:22:19 +10:00
Stéphane Bidoul
7757a6ca1b refactor vcs backend detection mechanism
Give VCS implementations control over saying whether
a project is under their control
2015-12-03 21:16:48 +01:00
Xavier Fernandez
c20ed50a82 Merge pull request #3213 from xavfernandez/mix_list_options
Allow to mix list options --outdated/uptodate with --editable
2015-12-03 13:30:18 +01:00
Xavier Fernandez
9ed3c1463e prefer os.path.join to os.sep.join([]) 2015-11-30 23:44:31 +01:00
Xavier Fernandez
d48bc5ce2d Drop the level argument
it is useless since 52ca02608e
2015-11-30 22:11:02 +01:00
Xavier Fernandez
b018c9ab4d Fix exception catch order
SSLError inherits from ConnectionError
2015-11-30 22:03:16 +01:00
Xavier Fernandez
3f21828f75 Unify output of pip list & fix test 2015-11-29 17:37:45 +01:00
Xavier Fernandez
795798f3f0 Allow combination of pip list options
--editable with --outdated/--updtodate
closes #933
2015-11-29 17:37:45 +01:00
Xavier Fernandez
69d90440e7 Drop PasteScript specific hack
With or without, pip works the same with PasteScript latest version and
crashes the same with versions 0.3/0.3.1
It was added in c2000d7 (7 years from now)
2015-11-29 16:57:53 +01:00
Xavier Fernandez
30f4af0678 Move SETUPTOOLS_SHIM to its own file 2015-11-26 22:36:59 +01:00
Xavier Fernandez
3c00710438 Use a single setuptools shim
for all setup.py invocations
bdist_wheel will now use tokenize in Python 3 just like for install
fixes #2042
2015-11-26 22:36:59 +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
Domen Kožar
b4bb2eee14 Support also pip install -e --prefix 2015-11-24 10:01:46 +01:00
Domen Kožar
7270d272f4 Make sure --user and --prefix install flags conflict 2015-11-22 19:23:22 +01: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
Steve Kowalik
dc8e7f01dd Join constraints and requested extras
Compare extras when checking if a requirement has already been
specified, and take a union of the extras before installation.

Co-Authored-By: Sachi King <nakato@nakato.io>
Closes #3046, #3189
2015-11-20 18:05:17 +11: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
e8bbf800a6 Merge pull request #3232 from rmcgibbo/pep425tags
Fix OS X platform detection for pep425tags
2015-11-07 12:32:07 -05:00
Robert McGibbon
995deff939 Fix OS X platform detection for pep425tags
For the purpose of detecting the user's platform to determine which
wheels are compatible, this switches pep425tags.get_platform() to
avoid distutils.util.get_platform() on OS X, because that method
returns the release on which the current interpreter was built (often
10.5 or 10.6) as opposed to the platform on which the interpreter is
running.
2015-11-06 16:39:15 -08:00
Donald Stufft
f39bc756e5 Merge branch 'develop' into hashes2 2015-11-06 18:46:09 -05:00
Donald Stufft
4bdd58c29a Merge pull request #3224 from njsmith/install-spinner-PoC
Display spinner during long setup.py calls
2015-11-06 12:21:44 -05:00
Nathaniel J. Smith
5bb9899938 Display spinner during long setup.py calls
One of the downsides of pip's new hiding of build chatter is that for
packages that take a very long time to build (e.g. scipy) the user gets
no indication that anything is happening for a very long time (e.g. tens
of minutes), and is likely to get frustrated and hit Control-C. This can
also create issues for automated systems that kill jobs that don't
produce occasional output (e.g. Travis-CI).

This commit implements an idea discussed here:

  https://github.com/pypa/pip/issues/2732#issuecomment-153215371

where we put up a spinner that rotates whenever the underlying build
produces output. I tried it on scipy, and it the experience was quite
pleasant! It spun around, sometimes fast and sometimes slow, and then
there was one uncomfortable pause for ~1 minute while a very gnarly C++
file got compiled, but that's okay because it was actually providing
accurate feedback.

It looks like:
```
  Running setup.py install for scipy ... /
  Running setup.py install for scipy ... -
  Running setup.py install for scipy ... \
  Running setup.py install for scipy ... done
```
or if the command has non-zero return code, or an exception is raised,
you get:
```
  Running setup.py install for scipy ... /
  Running setup.py install for scipy ... -
  Running setup.py install for scipy ... \
  Running setup.py install for scipy ... error
```
2015-11-05 23:28:03 -08:00
Xavier Fernandez
4782ffeab8 use packaging.version.parse
not setuptools version
2015-11-04 22:52:44 +01:00
Xavier Fernandez
113631c0aa rename to candidates 2015-11-04 22:52:44 +01:00
Xavier Fernandez
f1bf7515c2 pip.index: remove INSTALLED_VERSION
closes #703
2015-11-04 22:52:44 +01:00
Donald Stufft
0e240d7dde Force the --python-tag when autobuilding wheels
A lot of existing tarballs will successfully build a wheel, but the
wheel will be implicitly broken because they will have dynamically
adjusted the install_requires inside of their setup.py. Typically
this is done for things like Python version, implementation, or what
OS this is being installed on. We don't consider cache directories
to be OS agnostic but we do consider them to be Python version and
implementation agnostic. To solve this, we'll force the cached
wheel to use a more specific Python tag that includes the major
version and the implementation.
2015-11-04 08:52:28 -05:00
Xavier Fernandez
0cc9d733bf Fix traceback.format_exc call
format_exc takes only one argument, limit which should be an integer.
python 2 seems more lenient than python 3 on that point.

mistake introduced in commit 3148b967a
2015-10-24 00:46:44 +02:00
Xavier Fernandez
f23cbb707f Merge pull request #3179 from cloudnull/fix/req_constraint
Resolves result obj in req_constraints
2015-10-23 18:04:54 +02:00
Kevin Carter
6c50ea5781
Fix to ensure "result" object is defined
The changes resolves a condition that can lead to a stacktrace due to the
use of constraint files. There are several conditions where the result
object may be left undefined which causes the problems.

``` traceback
  Exception:
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 211, in main
      status = self.run(options, args)
    File "/usr/local/lib/python2.7/dist-packages/pip/commands/wheel.py", line 180, in run
      wheel_cache
    File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 266, in populate_requirement_set
      requirement_set.add_requirement(req)
    File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 267, in add_requirement
      return result
  UnboundLocalError: local variable 'result' referenced before assignment
```

This change simply ensures that the 'result' object is a defined
when the method returns.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-10-23 10:20:06 -05:00
Xavier Fernandez
fa91e3dcf4 Use get_installed_version and traceback 2015-10-22 23:15:06 +02:00
Xavier Fernandez
89a27cd740 Special-case based on exception message 2015-10-22 23:15:02 +02: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
Erik Rose
3af5ffa5ce Improve flow of --require-hashes help message. 2015-10-19 23:40:01 -04:00
Erik Rose
622b430491 Typos and docstrings 2015-10-19 23:40:00 -04:00
Erik Rose
925e4b4466 Fix false hash mismatches when installing a package that has a cached wheel.
This would occur when, for example, installing from a requirements file that references a certain hashed sdist, a common situation.

As of pip 7, pip always tries to build a wheel for each requirement (if one wasn't provided directly) and installs from that. The way this was implemented, InstallRequirement.link pointed to the cached wheel, which obviously had a different hash than the index-sourced archive, so spurious mismatch errors would result.

Now we no longer read from the wheel cache in hash-checking mode.

Make populate_link(), rather than the `link` setter, responsible for mapping InstallRequirement.link to a cached wheel. populate_link() isn't called until until prepare_files(). At that point, when we've examined all InstallRequirements and their potential --hash options, we know whether we should be requiring hashes and thus whether to use the wheel cache at all.

The only place that sets InstallRequirement.link other than InstallRequirement itself is pip.wheel, which does so long after hashes have been checked, when it's unpacking the wheel it just built, so it won't cause spurious hash mismatches.
2015-10-19 23:40:00 -04:00
Xavier Fernandez
8cbb8af466 Report import setuptools error to the user
closes #2931
2015-10-19 16:43:01 +02: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
a55fa5a17e Setting the u ABI flag based on sys.maxunicode is incorrect on recent
Pythons with PEP 393 Flexible String Representation (so >= 3.3).
Granted, on these Pythons, the SOABI config var should always be set,
but the manual SOABI code path should still try to do the right thing.
2015-10-13 10:38:07 -04:00
Nate Coraor
62e265e8b4 Use the WITH_PYMALLOC and Py_DEBUG config vars for setting the m and d ABI
flags.
2015-10-13 10:38:07 -04:00
Nate Coraor
a70e1dd544 Fix unit tests I broke:
- Catch IOError wherever sysconfig is used (#1074)
- Reapply #2915

Also, be sure to normalize the SOABI
2015-10-13 10:38:07 -04:00
Nate Coraor
0b9afeaca4 SOABI support for Python 2.X and PyPy
Additionally, fix the version portion of the Python tag on wheels built
with PyPy that use the Python API. It will now be the Python major
version concatenated with the PyPy major and minor versions.

Fixes #2671, #2882.
2015-10-13 10:38:07 -04:00
Erik Rose
e23f59673e Consolidate hash constants in pip.utils.hashing. 2015-10-12 16:29:08 -04:00
Erik Rose
7c5e5039ad Remove unneeded triple quotes. 2015-10-12 16:15:31 -04:00
Erik Rose
dcf39bfdf0 Add imports to make the pep8 checker happy about the dead _copy_dist_from_dir(). 2015-10-12 14:49:11 -04:00
Erik Rose
4c405a0ad3 Restore deleted _copy_dist_from_dir().
This reverts commit 62ac258e1e.

https://github.com/pypa/pip/pull/3176 is about to add the missing piece that makes this code useful (and not dead), so let's not delete it.
2015-10-12 14:37:03 -04:00
Erik Rose
9e5e34e9f7 Add --algorithm flag to pip hash. 2015-10-12 14:05:10 -04:00
Erik Rose
be6dccb034 Factor up the idiom of reading chunks from a file until EOF. 2015-10-12 13:07:53 -04:00
Erik Rose
d541304354 Allow === as a pinning operator.
https://www.python.org/dev/peps/pep-0440/#arbitrary-equality
2015-10-11 10:14:30 -04:00
Erik Rose
05b7ef9467 Rename "goods" to "allowed" for clarity.
Renaming "gots" didn't go well. I think the current naming is the most concise way to put it. If we rename it to "got", then the loop iterator can't be called "got", and the simple relationship between the iterator and collection names is lost. "Actual" and "actuals" are the other names that occurred to me, but they look so much like "allowed" that the code becomes harder to read.
2015-10-11 09:17:27 -04:00
Erik Rose
304c90aa46 Break after initial """ in multi-paragraph docstrings in exceptions module. 2015-10-10 22:44:13 -04:00
Erik Rose
be4e315c59 Rewrap args of unpack_http_url() to match the style in send(), above. 2015-10-10 22:44:13 -04:00
Erik Rose
b95599a944 Change _good_hashes() to a whitelist.
This guards against the possibility of a weaker hash being added to hashlib in the future. Also give _good_hashes() a more descriptive name, and describe what we mean by "strong".

We can get away with returning a static list because those algorithms are guaranteed present in hashlib.
2015-10-10 22:44:12 -04:00
Erik Rose
52111c1397 Demote package-is-already-installed log message to debug-level.
An info-level message for each package might be too intense. And it might give a false sense of security as well: it doesn't confirm that the virtualenv is non-empty; it merely notices when a package we're installing is already there.
2015-10-10 22:44:12 -04:00
Erik Rose
6f828c351f Correct and clarify docs and comments. 2015-10-10 22:44:12 -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
09008bf190 Add pip hash command. 2015-10-08 00:36:03 -04:00
Erik Rose
c62cd71f0f Add --require-hashes option to pip download and pip wheel.
Those commands already checked hashes, since they use RequirementSet, where the hash-checking is done.

Reorder some options so pre, no-clean, and require-hashes are always in the same order.
2015-10-07 17:33:57 -04:00
Xavier Fernandez
6aab626e7d Merge pull request #3153 from xavfernandez/error_project_name_mismatch
Abort installation on metadata mismatch
2015-10-05 23:54:09 +02:00
Donald Stufft
9c543b21c6 Prefer a newer SDK over an older SDK 2015-10-05 14:53:14 -04:00
Donald Stufft
ea5459294d prefer fat64 wheels over fat32 wheels 2015-10-05 14:52:53 -04:00
Donald Stufft
005e4a4fa6 fat32 not fat3 2015-10-05 14:52:19 -04: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
5f3437bd0f normcase the path tail for uninstall items 2015-10-03 10:13:00 -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
Xavier Fernandez
1a012bb63b Abort installation on metadata mismatch
If setup.py egg_info produces metadata for a different project name than
self.req.project_name, abort the installation.
Fixes #3143
2015-10-01 23:40:27 +02:00
Donald Stufft
b11cb019a4 Drop support for Python 3.2 2015-10-01 09:36:16 -04:00
Matt Iversen
f66d95ea89 Merge pull request #3122 from Ivoz/distinfo-entrypoints
Show entry points for dist-info installed packages
2015-10-01 02:01:14 +10:00
Xavier Fernandez
fe28652e63 Merge pull request #3136 from rouge8/fix-py26-home-slash
Fix user directory expansion when HOME=/
2015-09-29 22:18:24 +02: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
fac2891abb Fix user directory expansion when HOME=/
On versions of CPython affected by <http://bugs.python.org/issue14768>
(Python 2.6, some versions of Python 2.7 and 3.3),
`os.path.expanduser('~/path')` returns `//path` rather than `/path` when
`HOME=/`. This affects pip when `os.path.expanduser('~/.cache/pip')` is
expanded to `/\\\\.cache/pip`. Although `HOME=/` is probably uncommon on
most Linux systems, it is extremely common in Docker images.

Fixes #2996.
2015-09-29 16:01:32 -04:00
Xavier Fernandez
070a7289a2 Fix split_leading_dir, no need to cast to str
closes #2729
2015-09-29 14:28:33 +02:00
Paul Moore
908d07734c Merge pull request #3047 from tgs/clean_wheel_build_dir
Clean build dir if bdist_wheel fails
2015-09-29 09:19:39 +01: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
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
Marcus Smith
c4487bc453 Merge pull request #3093 from rbtcollins/develop
Add apparently missing py file flavor.
2015-09-23 15:44:11 -07: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
Erik Rose
9211d6e313 Style tweaks 2015-09-23 17:39:32 -04:00
Erik Rose
62ac258e1e Delete dead _copy_dist_from_dir(). 2015-09-23 17:39:32 -04:00
Erik Rose
e058486c91 Fix some docstring typos. 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