1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
pip/tests/unit
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
..
__init__.py break up tests dir into data, unit tests, and functional tests 2013-05-29 13:41:12 -07:00
test_appdirs.py Remove unused user_log_dir 2015-09-11 17:44:30 +02:00
test_basecommand.py Fix for Python 3.x, Refactor, and small changes 2014-09-18 07:44:02 -04:00
test_cmdoptions.py Issue #2675: Granular control over wheels/sdists 2015-04-24 08:52:48 +12:00
test_compat.py Adds test for native_str() 2014-09-01 21:47:04 -04:00
test_download.py Add checks against requirements-file-dwelling hashes for most kinds of packages. Close #1175. 2015-09-24 22:16:00 -04:00
test_finder.py Deprecate and Noop the PEP 438 functionality due to PEP 470 2015-09-02 23:47:05 -04:00
test_index.py SSH is a secure protocol, and allow repository links ("git+") to validate. 2015-09-09 18:59:03 -07:00
test_locations.py Merge pull request #3037 from ianw/no-reset-platlib 2015-08-19 17:27:21 -04:00
test_options.py Remove items slated for removal in pip 8.0 2015-09-03 10:55:11 -04:00
test_proxy.py Use requests instead of urllib2 2013-09-24 23:32:03 -04:00
test_req.py Add checks against requirements-file-dwelling hashes for most kinds of packages. Close #1175. 2015-09-24 22:16:00 -04:00
test_req_file.py Add checks against requirements-file-dwelling hashes for most kinds of packages. Close #1175. 2015-09-24 22:16:00 -04:00
test_req_uninstall.py Fix monkeypatching of is_local() 2015-03-20 16:18:43 -07:00
test_unit_outdated.py Compute pip version from its metadata 2015-07-06 10:28:18 +02:00
test_utils.py Add checks against requirements-file-dwelling hashes for most kinds of packages. Close #1175. 2015-09-24 22:16:00 -04:00
test_vcs.py Revert "#2414: parse SSH repositories url with a commit hash" 2015-03-16 13:57:41 -04:00
test_wheel.py verify that hyphens are never allowed in tags 2015-06-18 14:49:56 -07:00