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

79 commits

Author SHA1 Message Date
Sander Van Balen fbda0a2ba7
Update tests/unit/resolution_resolvelib/test_requirement.py
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2023-09-08 16:32:42 +02:00
Sander Van Balen 449522a828 minor fixes and linting 2023-09-06 15:16:22 +02:00
Sander Van Balen 937d8f0b61 partial improvement 2023-06-21 17:34:30 +02:00
Klaas van Schelven 5d7a1a68c7 Respect --no-index from the requirements file
See #11276

SearchScope was extended with an extra parameter to be able to pass-on the
value of no_index as we do with the other parameters. This allows us to respect
its value regardless of the order in which options are evaluated.
2022-07-20 15:55:17 +02:00
Stéphane Bidoul bb2a3d7410
Remove the html5lib deprecated feature flag. 2022-07-16 19:37:11 +02:00
Pradyun Gedam 8bebea801d
Remove --use-deprecated=backtrack-on-build-failures
This flag is due for removal, in pip 22.2.
2022-07-15 08:27:23 +01:00
Bastian Venthur 5da767c946 fixed some spelling mistakes
that's all :)
2022-06-14 21:24:58 +02:00
Tzu-ping Chung 42359a9605 Migrate tests to use pathlib.Path
The pip-specific Path implementation has been removed, and all its
usages replaced by pathlib.Path. The tmpdir and tmpdir_factory fixtures
are also removed, and all usages are replaced by tmp_path and
tmp_path_factory, which use pathlib.Path.

The pip() function now also accepts pathlib.Path so we don't need to put
str() everywhere. Path arguments are coerced with os.fspath() into str.
2022-06-08 19:58:46 +08:00
Pradyun Gedam de1c798243
Rename all {req -> build}_tracker arguments/variables 2022-03-26 12:09:32 +00:00
Pradyun Gedam e5542dc024
Move BuildTracker to operations.build.build_tracker 2022-03-26 12:09:32 +00:00
Pradyun Gedam cbfcbd2d94
Rename get_{requirement -> build}_tracker 2022-03-26 12:09:32 +00:00
Maurits van Rees b830de6596
test_resolver: extra tests for cycles plus restricted keys. 2022-02-01 18:02:35 +01:00
Maurits van Rees 63b19afac2
Fix assertion error when determining installation order.
Fixes https://github.com/pypa/pip/issues/10851
2022-01-31 20:18:37 +01:00
Jon Dufresne bf5f4008e7
Replace vendored html5lib with stdlib
The html5lib library isn't strictly required as the same functionality
can be achieved through the stdlib html.parser module.

The html5lib is one of the largest uses of the six library. By dropping
this unnecessary dependency, the pip project is closer to dropping the
six library.

Additionally, html5lib maintenance has slowed down and the project has
rejected pull requests to drop Python 2 support.

For now, the html5lib code remains, but is gated behind a command
line option: `--use-deprecated=html5lib`. After a sufficient amount of
time has passed without any reported bugs, the vendored library and this
flag can be removed completely.
2022-01-28 06:45:57 +00:00
Pradyun Gedam 9d0db8839f
Add --use-deprecated=backtrack-on-build-failures
This serves as an opt-out from build failures causing the entire
installation to abort.
2022-01-27 18:11:05 +00:00
James Gerity 5c24a798b8
Change VCS tooling verbosity along with pip's verbosity (#9639)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
2022-01-25 08:54:02 +00:00
Maurits van Rees ba979fd4b1
Simplify graph in get_topological_weights. (#10574)
Fixes https://github.com/pypa/pip/issues/10557 where the resolver spends too much time calculating the weights.

Also, do not let `get_installation_order` calculate these weights at all when there is nothing left to install.

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2021-11-20 13:29:50 +00:00
Pradyun Gedam 610424f9f8
Quote "PreferenceInformation" to avoid runtime NameError 2021-10-09 09:41:56 +01:00
Pradyun Gedam c01b5c6d8a
Update a test for resolvelib 0.8.0 2021-10-09 09:41:35 +01:00
Jon Dufresne dadc9fc2fb Fix new mypy failures in tests/unit/resolution_resolvelib/
Before, during, or after merge b392833a0f,
new code was added that now requires typing.
2021-09-26 07:02:56 -07:00
Tzu-ping Chung b392833a0f
Merge pull request #10435 from jdufresne/typing-unit 2021-09-26 16:29:29 +08:00
Damian d311c8c7c6 further simplification 2021-09-23 20:34:25 -04:00
Damian 23050dfae6 Replace requirement creation with install_req_from_req_string 2021-09-23 19:59:20 -04:00
Damian 9844d79b18 Better names 2021-09-23 19:29:18 -04:00
Damian 8aef5c2a49 Add argument names 2021-09-23 18:58:50 -04:00
Damian d7bd6dc084 Typo 2021-09-23 18:55:30 -04:00
Damian 724291214f Simplify test 2021-09-23 18:52:17 -04:00
Damian f226b2f17a Fix linting 2021-09-23 11:46:24 -04:00
Damian b8ff7f3f50 Replace build_iter_view with iter 2021-09-23 11:45:26 -04:00
Damian 0e40c942d4 Fix comment 2021-09-23 11:39:39 -04:00
Damian 4852663019 Fix lint issues 2021-09-23 11:29:25 -04:00
Jon Dufresne 60c274be2d Complete type annotations of tests/unit/ directory 2021-09-23 05:44:54 -07:00
Damian 478c5e5c3f Remove comments, add new line 2021-09-23 00:15:58 -04:00
Damian 27da19920d First attempt at provider known depths test 2021-09-23 00:11:13 -04:00
Jon Dufresne 943af79f26 Run mypy on the tests directory
The tests are a large consumer of the pip API (both the internal API and
otherwise). By running mypy on tests, we help to:

1. Ensure the internal API is consistent with regards to typing

2. Ensure the tests are representative of real life scenarios as the API
   are used correctly.

3. Helps to recognize unnecessary tests that simply pass junk data to
   functions which can be caught by the type checker.

4. Make sure test support code in tests/lib/ is correct and consistent.
   This is especially important when refactoring such code. For example, if
   we were to replace tests/lib/path.py with pathlib.

As a first start, untyped defs are allowed. All existing typing issues
have been resolved. Overtime, we can chip away at untyped defs and
eventually remove the configuration option for stricter type checking of
tests.

The following changes were made to help make mypy pass:

Remove unused record_callback argument from make_wheel() in tests.
Unused since its introduction in
6d8a58f7e1.

Replace toml with tomli_w in tests/functional/test_pep517.py. Unlike the
toml package, tomli_w contains inline typing annotations.

Remove unnecessary make_no_network_finder(). Unnecessary since
bab1e4f8a1 where the _get_pages method was
removed.
2021-08-22 09:57:26 -06:00
Pradyun Gedam 94999255d5
Reformat the codebase, with black 2021-08-20 13:37:49 +01:00
Tzu-ping Chung 4e56f1c52d Take responsibility to remove incompatibilities 2021-04-04 20:39:28 +08:00
Tzu-ping Chung 8d5832b079
Merge pull request #9426 from uranusjr/new-resolver-resolve-user-order
Order resolution preference by command ordering
2021-02-18 23:59:12 +08:00
Andrey Bienkowski 50db373adb Lint 2021-02-10 13:38:21 +03:00
Andrey Bienkowski ab35018c04 Use unittest.mock instead of mock 2021-02-10 13:28:55 +03:00
Tzu-ping Chung 0866bfa7ee Order resolution preference by command ordering 2021-01-04 13:46:14 +08:00
Pradyun Gedam 45d3a3e859
Update tests for new signature 2020-10-27 01:05:29 +05:30
Tzu-ping Chung 761433cee8 Eliminate len() usage in tests 2020-10-13 16:12:11 +08:00
Tzu-ping Chung 8326148149 Implement "lazy sequence" to avoid Internet
find_matches() is modified to return a special type that implements
the sequence protocol (instead of a plain list). This special sequence
type tries to use the installed candidate as the first element if
possible, and only access indexes when the installed candidate is
considered unsatisfactory.
2020-10-13 16:06:00 +08:00
Pradyun Gedam 58c594c06b
Prepare isort for black 2020-09-23 21:47:47 +05:30
Tzu-ping Chung dfaa111004 Pull in hashes from constraint files 2020-09-03 17:26:52 +08:00
Devesh Kumar Singh db11f83e2a Fix tests module with flake8-bugbear 2020-06-05 02:41:08 +05:30
Tzu-ping Chung 6c6b6a7765 Implement new Provider.find_matches() 2020-05-27 23:10:56 +08:00
Tzu-ping Chung bc9b288b1e Implement wheel cache lookup in the new resolver 2020-05-27 20:19:37 +08:00
Paul Moore e28b388c73
Merge pull request #7997 from uranusjr/resolver-use-user-site
New resolver: implement --user
2020-05-15 20:01:50 +01:00