Commit Graph

67 Commits

Author SHA1 Message Date
Pradyun Gedam 58c594c06b
Prepare isort for black 2020-09-23 21:47:47 +05:30
Pradyun Gedam 25ab172b55
Update linter: isort 2020-09-23 19:52:28 +05:30
Tzu-ping Chung 87d129a801 Replace custom URL parsing with url_to_path() 2020-09-01 15:43:58 +08:00
Noah Gorny aae63795b2 reqfile: Update extra-index-url/index-url in session from requirements file
Also update the relevant tests
2020-08-06 19:25:31 +03:00
Stéphane Bidoul 38fe3c2f14
Percolate --use-feature from req file upwards
We explicitly propagate --use-feature options from req files upwards.
This is not strictly necessary for the option to be enabled, because
of the default value is a global list, but that implicit behaviour is
certainly accidental, so we make it explicit, with a test.
2020-07-25 11:14:04 +02:00
Andy Freeland 3eef588a03 Support '--use-feature' in requirements files
This patch adds support for `--use-feature` in requirements files
so that a project that wants all contributors using the same pip
features can specify it in the requirements file. For example, to ensure
a requirements file uses the new resolver:

```
--use-feature=2020-resolver
boto3
boto3==1.13.13
```

This is a new version of #8293.
2020-07-18 16:08:47 -07:00
gutsytechster 8c267e6e39
feat(pip/_internal/*): Use custom raise_for_status method 2020-07-08 18:08:55 +05:30
Stéphane Bidoul df79ae4233
Enable strict typing in req_file.py 2020-07-05 19:11:41 +02:00
Stéphane Bidoul caad983734
Fix docstring typo 2020-07-05 19:11:41 +02:00
Devesh Kumar Singh 3e0b8f18cc Remove --always-unzip option from command-line 2020-06-25 16:52:15 +05:30
Devesh Kumar Singh 0d48186d1b Allow --prefer-binary option in requirements file 2020-05-21 19:37:45 +05:30
Pradyun Gedam b5e2cc6264
Remove unused imports 2020-04-20 22:45:09 +05:30
Pradyun Gedam 7e61569b1a
Drop --skip-requirements-regex 2020-04-20 22:37:25 +05:30
Albert Tugushev 63d93b4c7e Fix the docstring of preprocess() function 2020-03-02 22:48:46 +07:00
Christopher Hunt 2b6fb95ba4
Reorder imports 2020-02-23 23:44:13 +08:00
Paul Moore aac5d821f9 Move make_requirement to pip._internal.req.constructors (and rename it) 2020-02-14 12:22:50 +00:00
Paul Moore 90e4eb3eed Make parse_requirements return a ParsedRequirement 2020-02-14 11:52:53 +00:00
Paul Moore e2a57fd1e6 Refactor to reduce coupling.
* Make ParsedLine record the type of line
* Split handle_line to allow passing arguments only where needed
* Remove unneeded attributes from ParsedRequirement
2020-02-14 09:56:42 +00:00
Paul Moore f2e49b3946 Use a new ParsedRequirement class to communicate between handle_line and parse_requirements 2020-02-13 10:39:17 +00:00
Deepak Sharma d31cf696e8 string_formatting 2020-01-30 20:33:00 +05:30
Keith Maxwell b7a4b022d6 Better document the requirements file format (#7386)
Change the documentation for the requirements file format so that it
matches the implementation [0]. Also change the order of the options in
the implementation so that the documentation reads better.

Before this change the documentation included an incomplete list of
supported options.

This change adds the missing options and changes the order to match, so
that the two locations are easier to keep in sync. After this change the
list in the documentation matches SUPPORTED_OPTIONS in
src/pip/_internal/req/req_file.py

[0]: https://github.com/pypa/pip/blob/master/src/pip/_internal/req/req_file.py#L60
2019-11-20 12:45:21 +08:00
Chris Hunt df42c80ff6 Make session required in pip._internal.req.req_file functions 2019-11-03 20:49:11 -05:00
Ananya Maiti bb047aa263 Document that "coding: utf-8" is supported in requirements.txt
Fixes #7182
2019-10-31 20:27:00 +05:30
Chris Hunt 85918afc5e Remove req_file.process_line and update tests
The behavior that was in process_line was moved to
RequirementsFileParser so it's no longer needed, we just had to
move the remaining tests to use the higher-level parse_requirements
interface.
2019-10-26 13:53:01 -04:00
Chris Hunt 4d4c4f4a02 Extract requirements file parsing from line handling
By using a separate entity to parse lines and recurse into other
requirements files, we can more easily use different strategies for
handling the incoming requirements info.
2019-10-26 13:52:39 -04:00
Chris Hunt 631807c10f Represent parsed lines with ParsedLine class
Also separate logic that handles normal requirement lines from those
that include other requirement/constraint files.
2019-10-26 12:08:19 -04:00
Chris Hunt a5d53eab0a Simplify skip_requirements_regex option handling
Decouples `process_lines` from our CLI options.
2019-10-20 13:33:15 -04:00
Chris Hunt c8307614f2 Do requirement file recursion first
This change makes factoring out the parsing more obvious.
2019-10-20 12:50:07 -04:00
Chris Hunt 4d7fc272b4 Remove no-action TODO
comes_from is only used in get_file_content, which expects to see a URL
or path, so there is no need to decorate it.
2019-10-20 12:45:10 -04:00
Chris Hunt f0b20f19ae Hide line parsing details behind a line parser
Simplifies reading the code that actually processes the line.
2019-10-20 12:24:24 -04:00
Chris Hunt 6645530952 Do not create line-specific parsers for requirements files
This clears the way and for us to create our parser outside
the function next.
2019-10-20 12:05:33 -04:00
Pradyun Gedam 2db6f428bf
Update imports to {index -> index.package_finder} 2019-10-19 22:24:01 +05:30
Chris Hunt d2a19aee7f Move download.get_file_content to req.req_file 2019-10-16 21:28:02 -04:00
Chris Hunt cf7ebdbbc2 Move PipSession to network.session 2019-09-27 01:02:52 -04:00
Chris Jerdonek a6cdb490b0 Move trusted_hosts logic to PipSession. 2019-08-21 03:03:17 -07:00
Pradyun Gedam f377148f6d
Use mypy's inline configuration syntax for opt-outs 2019-07-30 12:39:51 +05:30
Pradyun Gedam 537b0fca12
Change isort multi_line_output to 3 2019-07-22 10:15:27 +05:30
Chris Jerdonek 7d08bb37a5 Add SearchScope class. 2019-06-18 00:47:10 -07:00
Chris Jerdonek 6ac468e4fd
Merge pull request #6613 from cjerdonek/requirements-file-error
Improve the error message for invalid requirements files in certain situations
2019-06-16 20:09:24 -07:00
Chris Jerdonek e5a730a89f Improve the error message when reading a bad requirements file. 2019-06-15 10:47:24 -07:00
Chris Jerdonek c0bda1b906 Log when adding a trusted host from a file. 2019-06-14 01:14:36 -07:00
Chris Jerdonek d72758394d Fully support --trusted-host inside requirements files. 2019-06-13 01:21:05 -07:00
Chris Jerdonek 4c1ccaec73 Store PackageFinder.trusted_hosts instead of secure_origins. 2019-06-12 02:18:23 -07:00
Pradyun Gedam 83d813c01e
Updated comment-matching regex to be Jython-compatible (#5959) 2019-05-29 23:03:27 -04:00
Chris Jerdonek 4f26eba472 Add CandidateEvaluator.make_found_candidates(). 2019-05-19 13:18:43 -07:00
Chris Jerdonek 1bb21fd3ff
Merge pull request #6093 from mkurnikov/req-types-finished
Finish types for pip._internal.req, set disallow_untyped_defs flag
2019-03-23 02:16:35 -07:00
Pi Delport 5f3c56e188 Fix some typos 2019-03-12 21:54:18 +01:00
Maxim Kurnikov 8c70363262 add missing trailing commas on multiline imports 2019-02-25 14:24:55 +03:00
Maxim Kurnikov 2d3cd4de86 merge latest master 2019-02-23 16:58:54 +03:00
Maxim Kurnikov f77b8ca051 remove #noqa: F401 2019-02-22 14:17:07 +03:00