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

4248 commits

Author SHA1 Message Date
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
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
76983f363a Restore documentation about alternate hash algorithms in URLs. 2015-10-12 12:09:49 -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
f35ce75025 Make "installation bundles" less of an official term. 2015-10-11 09:17:40 -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
3824d735a0 Revise what hashes protect you against.
We don't need to talk about the network, since HTTPS should ensure transmission integrity. We do need to watch out for the CA chain. Stop mentioning the CDN because it's a deep hole: we might as well mention Rackspace and Amazon and who knows who else.
2015-10-10 22:44:12 -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
Erik Rose
7a0a97c081 Merge 'develop' into 'hashing' to bring the latter up to date. 2015-10-08 13:37:19 -04:00
Erik Rose
d477ae6c5c Add warning about python setup.py install. 2015-10-08 00:36:14 -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
Erik Rose
bf0ff80d73 pep8 fixes 2015-10-07 17:31:40 -04:00
Erik Rose
14506f8261 Document hash-checking mode. 2015-10-07 16:35:27 -04:00
Erik Rose
4f6737407b Correct the level of the Wheel Cache heading.
Previously, Hash Verification, Editable Installs, Controlling setup_requires, and Build System Interface were all getting placed under it.
2015-10-07 16:31:41 -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
db2b2d30eb Merge pull request #3163 from dstufft/invert-osx-priority
Invert osx priority
2015-10-05 15:22:54 -04: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
0e870a7b6a Merge pull request #3125 from qwcode/req_line_numbers
refactor to preserve reporting of original line numbers in requirements files
2015-10-04 21:26:51 -07:00
Marcus Smith
4929078946 update changelog 2015-10-04 21:25:53 -07:00
Marcus Smith
b9095440c9 add comment about the order of requirements file preprocessing 2015-10-03 21:30:26 -07: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
55a3ea8276 Merge pull request #3154 from qwcode/issue_3011
when uninstalling, look for the case of paths containing symlinked directories
2015-10-03 10:32:28 -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
5dc95b392e update changelog 2015-10-03 10:16:54 -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
Matt Iversen
0044f41781 Merge pull request #3158 from graingert/patch-2
Use the new wheel config section
2015-10-02 10:54:49 +10:00
Thomas Grainger
a4d63a60d4 Use the new wheel config section 2015-10-02 01:26:59 +01:00
Xavier Fernandez
7e02e5c4f8 Update changelog for backward incompatibility 2015-10-01 23:41:40 +02: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
5a15cbb0d8 Merge pull request #3156 from dstufft/drop-32
Drop support for Python 3.2
2015-10-01 14:43:40 -04:00
Donald Stufft
b11cb019a4 Drop support for Python 3.2 2015-10-01 09:36:16 -04:00
Marcus Smith
a4f7bc62c2 Merge pull request #3152 from James-Firth/patch-1
Fixed broken link to article comparing setup.py to requirements.txt (remade)
2015-09-30 12:11:10 -07:00
James Firth
fa4be0f53d Fixed broken link to article comparing setup.py to requirements.txt 2015-09-30 11:32:24 -05: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
Matt Iversen
2b703d68e8 Merge pull request #3145 from pypa/check-long_description
Check long_description is valid
2015-10-01 02:00:01 +10:00