Commit Graph

68 Commits

Author SHA1 Message Date
Filip Kokosiński 6ebec4a87e Added offending line from requirements file (#4227) (#4635) 2017-08-31 13:07:42 -04:00
Pradyun S. Gedam 9923c1ad7e Sort imports and minor Flake8 changes (#4520)
* Run isort on the codebase

Command: isort --recursive --skip __main__.py --skip _vendor -o pip._vendor -sd THIRDPARTY -m 5 -p pip -p tests ./pip ./tests

* 📰
2017-06-13 14:17:00 +02:00
Pradyun S. Gedam 1832569530 Sort all imports 2017-05-16 15:47:47 +05:30
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
Donald Stufft bb41490225 Removed the deprecated --allow-* commands from PEP 438 2017-03-19 20:51:54 -04:00
Jason R. Coombs dd3defe509 Import setuptools in a subprocess. (#4294) 2017-03-05 11:29:50 -05:00
Donald Stufft 8e236dd6a0 Update to use the Requirement class from packaging 2016-03-07 11:40:39 +11: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 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
Marcus Smith b58d2c9f34 process line continuations first (but with some special handling for comments) 2015-10-08 15:25:51 -07:00
Erik Rose 7a0a97c081 Merge 'develop' into 'hashing' to bring the latter up to date. 2015-10-08 13:37:19 -04:00
Marcus Smith 91e3c13926 migrate over some missing test cases from PR #3030 2015-10-03 21:08:35 -07: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
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 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 0f5d4286a5 Deprecate and Noop the PEP 438 functionality due to PEP 470 2015-09-02 23:47:05 -04: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 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 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
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
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
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