Commit Graph

57 Commits

Author SHA1 Message Date
Nguyễn Gia Phong f8b06a3906 Enable flake8-logging-format 2020-07-17 14:33:19 +07:00
Jussi Kukkonen 76b20d738e Deprecate requirements format "base>=1.0[extra]"
This requirements format does not conform to PEP-508. Currently the
extras specified like this work by accident (because _strip_extras()
also parses them). The version checks end up being done with a
misparsed version '1.0[extra]' -- this is not changed in this commit.

Add deprecation warning and fix the corresponding resolver test. Add a
command line test.

Note that we really only check that the Requirement has SpecifierSet
with a specifier that ends in a ']'. A valid version number cannot
contain ']' and no wheels currently on pypi have versions ending in ']'.
2020-07-13 12:33:50 +03:00
Stéphane Bidoul aa0c167498
Make sure user_supplied is propagated where needed 2020-05-31 18:33:51 +02:00
Devesh Kumar Singh ac39efa537 Update parse_editable to return Set[str] 2020-05-22 04:21:14 +05:30
Devesh Kumar Singh 2c5cab492c Pass empty set if parts.extras is None 2020-05-22 04:20:32 +05:30
Devesh Kumar Singh ea3aa04987 Add mypy annotations to pip._internal.req.constructors 2020-05-22 01:56:59 +05:30
Stéphane Bidoul 58295d0df7
Remove InstallRequirement source_dir parameter
source_dir is only passed to the InstallRequirement constructor
in the case of editable requirements, and it is built from link,
which is also passed to the same constructor. So we let
InstallRequirement compute source_dir, to remove that burden
from call sites.
2020-04-12 11:39:09 +02:00
Tzu-ping Chung 74c5042052 Accept InsatllRequirement as comes_from 2020-04-05 12:17:25 +08:00
Tzu-ping Chung 6db0df928c Move wheel cache out of InstallRequirment 2020-03-30 17:36:03 +08:00
Jason R. Coombs 3511d3d493 Convert the remaining '%' formatters to '.format'. Fixes #6973. 2020-03-06 12:43:03 -05:00
Christopher Hunt 40523794d8
Merge pull request #7747 from pfmoore/parsed_requirement
Refactor parse_requirements to be independent of InstallRequirement
2020-02-24 00:21:28 +08:00
Anudit Nagar 082c0f01d2
Update old-style formatting to new-style formatting (#7762) 2020-02-21 21:48:14 +05:30
Paul Moore aac5d821f9 Move make_requirement to pip._internal.req.constructors (and rename it) 2020-02-14 12:22:50 +00:00
Paul Moore a9f1d8562b Pass individual options to InstallRequirement rather than an options object 2020-02-06 16:05:11 +00:00
Deepak Sharma 61e1721b80 msg formatting updated 2020-01-30 21:57:31 +05:30
Deepak Sharma d31cf696e8 string_formatting 2020-01-30 20:33:00 +05:30
Chris Hunt 60f6ed9387 Move wheel.Wheel to models.wheel.Wheel
This aligns more closely with how the class is used and makes it easier
to move the rest of the wheel module to a dedicated module for
installation.
2019-12-02 11:52:51 +08:00
Christopher Hunt 1b4c0866ab
Remove untyped defs (#7382) 2019-11-19 11:46:26 +08:00
Maxim Kurnikov 3692097cca add per-file disallow_untyped_defs=False, and set it to True globally 2019-09-29 23:31:15 +02:00
Chris Jerdonek 0435316fde Move path_to_url() to utils/urls.py. 2019-09-24 02:01:52 -07:00
Chris Hunt ad82dd0981 Move RequirementParts above new function 2019-09-22 12:03:47 -04:00
Chris Hunt 8fe2eb068a Factor out editable parsing into a function 2019-09-22 12:02:14 -04:00
Chris Hunt 903580cace Use RequirementParts to populate editable InstallRequirement 2019-09-22 09:51:25 -04:00
Christopher Hunt 16f1b4b5dd
Merge pull request #7046 from chrahunt/refactor/constructors-req-parsing
Refactoring req.constructors requirement parsing
2019-09-20 12:16:03 -04:00
Chris Hunt d0336be3ee Move requirement parsing to separate function in req.constructors 2019-09-19 21:30:00 -04:00
Chris Hunt 1ae28f6946 Add RequirementParts to hold parsed requirement info 2019-09-19 21:23:13 -04:00
Chris Hunt 8d19b31b66 Remove unnecessary else in convert_extras 2019-09-19 19:28:54 -04:00
Pradyun Gedam 83780a2991
Merge pull request #7025 from chrahunt/refactor-1
Clean up req.constructors.install_req_from_line
2019-09-19 11:17:23 +05:30
Chris Hunt 6a8b47d20b Move file type info to utils.filetypes. 2019-09-17 23:40:02 -04:00
Chris Hunt 0555261087 Move extra conversion to function. 2019-09-17 19:02:59 -04:00
Chris Hunt ec8bf2cc22 Clean up source location message creation. 2019-09-17 19:02:59 -04:00
Christopher Hunt 82c2dd40eb
Merge pull request #6203 from vinicyusmacedo/fix-pep-508
Fix is_url from splitting the scheme incorrectly when using PEP 440's direct references
2019-09-16 09:52:40 -04:00
Chris Jerdonek 3303c11828 Remove index.py and req/constructors.py's dependence on download.py. 2019-09-13 09:57:04 -07:00
Vinicyus Macedo 16af35c613 Adding improvements to the _get_path_to_url function 2019-08-12 14:32:03 -03:00
Vinicyus Macedo 5b93c09199 Added test to fail pep508 2019-08-12 14:32:03 -03:00
Pradyun Gedam f377148f6d
Use mypy's inline configuration syntax for opt-outs 2019-07-30 12:39:51 +05:30
Savio Jomton 1b331851f1 Improve error message for invalid editable requirement. (#6679) 2019-07-11 20:07:54 +05:30
Chris Jerdonek e5a730a89f Improve the error message when reading a bad requirements file. 2019-06-15 10:47:24 -07:00
Chris Jerdonek 99228e503a Import path_to_url() from utils/misc.py instead of download.py. 2019-06-03 02:31:40 -07:00
Andy Freeland bb14ff42b0 Fix NameError when handling InvalidRequirement in install_req_from_req_string (#6419)
Previously, an InvalidRequirement would raise a NameError while trying
to raise an InstallationError because `req` was not defined.

Discovered while working on #6402.
2019-04-19 02:37:33 -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
Alex Loosley d245434c02 Fix #5889: AttributeError: 'NoneType' object has no attribute 'netloc' (#6336) 2019-03-20 16:59:24 +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 c4dfdbe265 remove unused imports 2019-02-22 14:18:46 +03:00
Maxim Kurnikov f77b8ca051 remove #noqa: F401 2019-02-22 14:17:07 +03:00
Chris Jerdonek d619aba150 Provide a better error message for a pyproject.toml editable install.
The message looks like this:

  File "setup.py" not found. Directory cannot be installed in editable
  mode: <absolute-dir-path>
  (A "pyproject.toml" file was found, but editable mode currently
  requires a setup.py based build.)
2019-01-26 07:00:22 -08:00
Maxim Kurnikov c4cf730145 sort imports under TYPE_CHECKING alphabetically 2019-01-25 20:08:59 +03:00
Pradyun Gedam 22fe45d462
Fix new issues found in mypy 0.620 -> 0.650 2018-12-18 11:20:14 +05:30
Maxim Kurnikov 05eb7d8e92 Add type annotations for pip._internal.req (#6063) 2018-12-17 16:43:00 +05:30