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

1760 commits

Author SHA1 Message Date
Phil Elson
b777bcda81 Add the "base" config level concept, to allow configuration of all virtual environments sharing the same base.
The new functionality serves a use case which was not previously possible with pip configuration files, namely the situation where you have a base Python installation and want to influence the pip configuration for all derivative virtual environments *without* changing the config for all other environments on a machine (global), or for all other environment run by the same user (user). Concretely, this could be used for a centrally managed network mounted filesystem based Python installation, from which multiple users can build virtual environments and inside which a specific pip configuration is needed (e.g. an index URL).
2022-10-06 09:33:38 +02:00
Stéphane Bidoul
65641f10ad
Fix test_install_requirements_with_options 2022-09-25 11:21:36 +02:00
Danny McClanahan
bad03ef931
Use data-dist-info-metadata (PEP 658) to decouple resolution from downloading (#11111)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2022-09-10 11:28:57 +01:00
Tzu-ping Chung
bfbe919fd2
Merge pull request #11277 from vanschelven/respect-no-index-from-requirements-file 2022-08-30 15:47:51 +08:00
hauntsaninja
edbfeae9fb fix tests 2022-08-12 19:01:26 -07:00
Stéphane Bidoul
d8e2d6605a
Rename BinaryAllowedPredicate
It really is a BdistWheelAllowedPredicate and
this will make it easier to reason when --no-binary
does not imply setup.py install anymore.
2022-08-12 13:51:45 +02:00
Paul Moore
ebe491a82a Get rid of the --python python/py shortcuts 2022-08-01 10:54:20 +01:00
Paul Moore
01e122ed41 Add tests 2022-07-30 16:12:42 +01:00
Klaas van Schelven
2ec5097281 Add a test for 'respect --no-index'
See #11276
2022-07-27 11:49:06 +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
Tzu-ping Chung
b1a01ef762
Merge pull request #11265 from finnagin/main 2022-07-19 15:53:00 +08:00
Finn Womack
48bcb0a4cc
reformat to pass pre-commit check 2022-07-18 12:30:17 -07:00
finnagin
a7c1fe3bff Remove utc fixture from tests 2022-07-18 12:20:56 -07:00
Stéphane Bidoul
bb2a3d7410
Remove the html5lib deprecated feature flag. 2022-07-16 19:37:11 +02:00
Donald Stufft
c1b50e1f4d Add a test for parsing links from JSON 2022-07-15 17:55:15 -04:00
Donald Stufft
68836d479f fix number of calls 2022-07-15 17:22:46 -04:00
Donald Stufft
7cb5aae880 fix a stray ' 2022-07-15 17:22:46 -04:00
Donald Stufft
6f9ccfc136 Fix link hashes 2022-07-15 17:22:46 -04:00
Donald Stufft
d67cac3c13 formatting 2022-07-15 17:22:46 -04:00
Donald Stufft
799c88f13d Update some tests to work again 2022-07-15 17:22:46 -04:00
Donald Stufft
9c98346df9 Add new accept headers 2022-07-15 17:22:46 -04:00
Donald Stufft
21a99e4b87 Update tests to use new names 2022-07-15 17:22:46 -04:00
Donald Stufft
55192a1674 Fix tests 2022-07-15 17:22:46 -04:00
Finn Womack
61862a3b3c
Update test_logging.py for non-utc windows env 2022-07-15 14:00:57 -07:00
Finn Womack
6c822e6224
Update fixed_time patch for non-utc windows env 2022-07-15 13:59:02 -07:00
Tzu-ping Chung
534262d1d6
Merge pull request #11241 from pradyunsg/drop-backtrack-on-build-failures 2022-07-15 16:34:10 +08: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
Stéphane Bidoul
f66b3e8d01
Merge pull request #11195 from pradyunsg/distutils-replace-fancygetopt-with-getopt
Replace `distutils.fancy_getopt` with `getopt`
2022-07-10 13:18:33 +02:00
Pradyun Gedam
8cbb89b6cc
Replace distutils.fancy_getopt with getopt
This eliminates one location where distutils may be imported on
Python 3.12+, by replacing the logic with mostly equivalent logic.
2022-07-08 17:14:01 +01:00
Tzu-ping Chung
6eaa8e9135 Don't consider dist-info in a wheel as "installed"
This applies to the new importlib.metadata backend. The legacy
pkg_resources backend already does this (albeit accidentally).

A package inside a wheel is not guaranteed to "work" when directly
imported, so we should not treat it as an installed distribution.
2022-06-30 21:49:39 +08:00
Stéphane Bidoul
f1a5cfce16
Merge pull request #11186 from venthur/fix_spelling
fixed some spelling mistakes
2022-06-26 12:34:26 +02:00
Stéphane Bidoul
ae67371450
Rename json_metadata to metadata_dict 2022-06-23 19:35:45 +02:00
Stéphane Bidoul
aac65f0b86
Add json_metadata 2022-06-23 19:35:45 +02:00
Stéphane Bidoul
422719863a
Merge pull request #11163 from sbidoul/ref-metadata-sbi
Refactor `BaseDistribution.metadata` property to make sure it has `Requires-Dist` and `Provides-Extra`
2022-06-23 19:31:27 +02:00
q0w
c8c88ce520 Adapt tests 2022-06-23 19:20:18 +03:00
Bastian Venthur
5da767c946 fixed some spelling mistakes
that's all :)
2022-06-14 21:24:58 +02:00
Stéphane Bidoul
a814290ff4 Make sure metadata has Requires-Dist and Provides-Extra
egg-info distributions may not have the Requires-Dist and Provides-Extra
fields in their metadata. For consistency and to provide an
unsurprising metadata property, we emulate it by reading requires.txt.
2022-06-12 19:40:42 +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
Stéphane Bidoul
05d2b85d4a Add unit tests for cache origin.json... and fix a bug 2022-05-30 18:36:48 +02:00
Stéphane Bidoul
c6baa7514a
Add download_info to InstallRequirement 2022-05-22 22:46:35 +02:00
Pradyun Gedam
30af8074bf
Merge pull request #11117 from q0w/opt-check
Opt to check build dependencies
2022-05-14 21:55:18 +01:00
Pradyun Gedam
d673aa1428
Move RequirementSet.add_requirement into LegacyResolver
This was the only call-site for this method and, realistically, it is
highly coupled with the legacy resolver's dependency resolution
strategy/approach; so it makes sense for this code to live as part of
the resolver, rather than the container object the various resolvers.
2022-05-13 18:59:53 +01:00
q0w
3166157e40 Opt to check build dependencies 2022-05-13 03:05:55 +03:00
wim glenn
32f642d123 provide a better error message for "pip config get index-url" 2022-04-29 22:51:16 -05:00
wim glenn
af20d93d71 placate pre-commit 2022-04-29 22:38:38 -05:00
wim glenn
4b35763d5f `pip config` normalizes names, converting underscores into dashes. closes #9330 2022-04-29 22:38:38 -05:00
Paul Moore
cdeb8f9e63
Merge pull request #11059 from pfmoore/config_settings
Add a UI to set config settings for PEP 517 backends
2022-04-29 12:58:32 +01:00
Paul Moore
437bb67900 Rename test file pep517 -> pyproject 2022-04-23 14:45:59 +01:00
Pradyun Gedam
26d8441100
Pacify linters by passing logging.DEBUG instead of "DEBUG" 2022-04-23 12:30:42 +01:00
Pradyun Gedam
ca84a83633
Rework the tests for self_check_outdated to do less mocking
This makes the tests more reliable and easier to reason about. This also
adds a few more cases under the test conditions.
2022-04-23 12:30:42 +01:00
Pradyun Gedam
4f35572ae7 Refactor the logic in self_outdated_check
- Move the lookup within `selfcheck/*.json` files into a method on
  `SelfCheckState`.
- Factor out `PackageFinder` interaction into a separate function.
- Rename variables to more clearly reflect what they're for.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
2022-04-22 16:36:29 +01:00
Pradyun Gedam
c4470ba3bd Rename [present-diagnostic] to [present-rich]
This makes it more reasonable to use a rich renderable for regular
logging messages, instead of only using it for the diagnostic error
messages.
2022-04-22 16:36:29 +01:00
Pradyun Gedam
b68de249d1 Remove a no-longer-needed type: ignore comment 2022-04-22 16:13:35 +01:00
Paul Moore
d9c4ebf7be Add tests for basic --config-settings parsing 2022-04-21 18:30:48 +01:00
Tzu-ping Chung
e3952f8357 Fix unit test to check against the correct backend 2022-04-12 03:26:12 +08:00
Pradyun Gedam
428e886ad6
Drop out-of-tree/in-tree build transition flags
These were intended to help users transition when the default behaviour
changed to no longer perform out-of-tree builds. The transition is now
considered complete.
2022-04-08 12:20:36 +01: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
Thiago
fffd5ac422
Pass the session's proxies property to request (#10680) 2022-03-11 15:04:21 +00:00
Tzu-ping Chung
d61b539353 More structured link evaluation result
A new enum class is implemented for the link evaluator to use instead
of a simple boolean to better distinguish between various evaluation
errors. This allows the caller to better distinguish error sources with
a structured check instead of fragile error string comparison.
2022-03-10 20:41:26 +08:00
Tzu-ping Chung
2e5e9e54bc
Merge branch 'main' into requires-python 2022-03-10 15:41:05 +08:00
q0w
a4f7508592
Drop the doctype check (#10906)
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2022-02-27 12:39:06 +00:00
Yusuke Hayashi
d854b1e20d
fix: spelling mistakes and typos 2022-02-17 18:05:59 +09:00
Pradyun Gedam
ff8dbb458a
Merge pull request #10867 from mauritsvanrees/maurits-topoligical-weights-requirements-only-issue-10851 2022-02-03 08:20:28 +00:00
Pradyun Gedam
4f0ce011fe
Switch to using html.parser even when the doctype isn't proper
This ensures that we handle html5lib parsing as non-default deprecated
behaviour.
2022-02-01 17:58:34 +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
Pradyun Gedam
c01b0b2729
Gracefully fallback to html5lib for parsing non-compliant index pages
This reworks the HTML parsing logic, to gracefully use `html5lib` on
non-compliant HTML 5 documents. This warning softens the failure mode
for users who are using commercial package index solutions that do not
follow the requisite standards and serve malformed HTML documents.
2022-01-30 21:21:11 +00:00
Pradyun Gedam
80609e8c20
Properly yield results from html5lib parsing
The earlier variant _returned_ an iterable object from a generator. This
did not properly handle the fallback, resulting in the html5lib code
path not being executed.
2022-01-30 16:54:45 +00: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
Pradyun Gedam
1cda23bd6b
Merge pull request #10795 from pradyunsg/better-subprocess-errors 2022-01-27 07:09:18 +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
Pradyun Gedam
723b2df7b4
Double-escape paths on Windows
This helps ensure that they aren't improperly handled due to the newer
string-in-string design for the setuptools invocation script.
2022-01-25 08:24:31 +00:00
Pradyun Gedam
94668c6df6
Pacify unit tests 2022-01-25 01:38:23 +00:00
Pradyun Gedam
1ee370637f
Add diagnostics to InstallationSubprocessError
This more clearly states where the error came from, presents it in a
more approachable format with context provided for what this error is
related to.
2022-01-25 01:38:22 +00:00
Pradyun Gedam
7a13f7c213
Improve our setuptools shim
Modernise the shim, to account for the Python 3.2+ support matrix.

This also presents clearer error messages on failures, the included
comment helps inform users about why this shim exists and the traceback
now explicitly mentions `<pip-setuptools-shim>` to make it clearer to
users that this shim exists.
2022-01-25 01:38:22 +00:00
Pradyun Gedam
531c991ef9
Require every call_subprocess call-site to pass command_desc
This serves as additional context that can be presented in error
messages.
2022-01-25 01:38:22 +00:00
Pradyun Gedam
e857d0f532
Properly handle newlines in diagnostic error tests
This is necessary to ensure that the output can be compared directly.
2021-12-12 13:11:36 +00:00
Pradyun Gedam
9f4117f2b8
Replace {attention -> note}_stmt
The new name is a closer match with what is presented to the user.
2021-12-12 13:11:36 +00:00
Pradyun Gedam
8feb24fd12
Enable the use of rich for presenting output
This makes it possible to present output with rich markup, within the
constraints of our logging infrastructure.

Further, diagnostic errors can now by presented using rich, using their
own special "[present-diagnostic]" marker string, since those need to be
handled differently from regular log messages and passed directly
through to rich's console object, after an indentation wrapper.
2021-12-12 13:11:36 +00:00
Pradyun Gedam
03a87c22de
Improve DiagnosticPipError presentation
Borrow error presentation logic from sphinx-theme-builder, and
exhaustively test both the unicode and non-unicode presentation.

Utilise rich for colours and presentation logic handling, with tests to
ensure that colour degradation happens cleanly, and that the content is
stylized exactly as expected.

Catch diagnostic errors eagerly, and present them using rich. While this
won't include the pretty presentation in user logs, those files will
contain the entire traceback upto that line.
2021-12-12 13:11:35 +00:00
Tzu-ping Chung
e50c07e6b5 Merge DictMetadata tests into metadata tests 2021-12-04 17:57:34 +08:00
Tzu-ping Chung
cd01e4fd8f Remove pkg_resources usages from utils modules
Relevant functionalities are moved into pip._internal.metadata.
2021-12-04 17:57:33 +08:00
Tzu-ping Chung
cf1dda196c Revert freezegun workaround 2021-11-24 05:49:53 +08:00
Tzu-ping Chung
51f7aa9fcc Work around platformdirs.windows 2021-11-22 17:51:07 +08:00
Tzu-ping Chung
7d27b9c412 Fix various typing errors on Windows 2021-11-22 15:55:31 +08:00
Tzu-ping Chung
e0c7f24ee4
Merge pull request #10511 from uranusjr/metadata-uninstall 2021-11-22 09:54:15 +08:00
Pradyun Gedam
95a160592e
Merge pull request #10654 from hroncok/allow-to-force-distutils 2021-11-20 16:37:26 +00:00
Miro Hrončok
85db5496b6 Allow to decide whether to use distutils or sysconfig with sysconfig._PIP_USE_SYSCONFIG
Fixes https://github.com/pypa/pip/issues/10647
2021-11-20 17:01:19 +01: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
Tzu-ping Chung
d81edc8bfc Always use packaging's version parser 2021-11-18 17:58:12 +08:00
Tzu-ping Chung
ad158b03e8 Fix types in tests on Windows 2021-11-18 17:58:12 +08:00
Tzu-ping Chung
c54d40474a CHange ireq.satisfied_by to abstract distribution 2021-11-18 17:58:10 +08:00
Tzu-ping Chung
62b91dfbf1 Return abstract metadata type from ireq.get_dist() 2021-11-18 17:56:26 +08:00
Tzu-ping Chung
ebd693e0b5 Abstract pkg_resources from uninstall operation 2021-11-18 17:55:38 +08:00
Pradyun Gedam
e7c80c7b46
Merge pull request #10535 from lukasjuhrich/main 2021-11-12 09:57:11 +00:00
Hugo van Kemenade
0252c04a16 Drop support for soon-EOL Python 3.6 2021-11-08 12:02:16 +02:00
Lukas Juhrich
2e67986782 make linters happy 2021-10-23 17:42:22 +02:00
Lukas Juhrich
58996b5ddb Add tests for BadZipFile handling
Note that the functional test does not actually detect the behavioral
change of throwing unhandled `BadZipFile` → throwing unhandled
`InvalidWheel`, whereas the unit test does.
2021-10-23 17:42:22 +02:00
Lukas Juhrich
cd3aefe7ad adapt network test to InvalidWheel 2021-10-23 17:42:22 +02:00
Pradyun Gedam
a00e7bcd88
Implement diagnostic errors for build-system.requires issues
This demonstrates how the new diagnostic errors are to implement, and
how they get presented to users.
2021-10-22 13:47:53 +01:00
Pradyun Gedam
85b43482bb
Introduce DiagnosticPipError
This introduces an exception and presentation model, for providing
better errors messages. The motivating idea is that the better error
messages contain clear wording and provide additional context to users
to better understand what is happening.

The `DiagnosticPipError` class introduces a structured framework in our
exception model, for code authors to write their error messages. The
usage explicitly requires passing "context" and a "hint" (which accept
None values). This should nudge code authors to explicitly think about
what additional information can/should be presented to the user, and
to provide relevant hints to them whenever possible. It also makes it
straightforward to identify cases where we don't do this, which may
serve as clear areas for improvement in the future.

The initial implementation is intentionally basic and doesn't do much;
however we should be able to introduce better usage of terminal colors
and other features (eg: hyperlinks!) to further improve the presentation
of these errors. It does improve the presentation style by a bit, even
though there are significant presentation-related improvements to be
made.

Additionally, having a structured framework means that these would be
improvements in presentation of *all* the errors that are within this
framework -- increasing the benefits of investing in the presentation
of these errors.
2021-10-22 13:41:40 +01:00
Stéphane Bidoul
ae512892eb
Prepare legacy editable metadata in isolated env
When there is a pyproject.toml, metadata preparation must be
done in the isolated build environment for legacy editable installs too
(fixes a regression).

Also detect earlier if an editable install must go through the
legacy install path, to be sure to run it in an environment
with the correct build requirements.
2021-10-18 14:34:50 +02:00
Stéphane Bidoul
ddfeaaef20
Reject projects that have neither a pyproject.toml nor a setup.py 2021-10-18 14:31:11 +02:00
Pradyun Gedam
1b4ee832db
Rework MacOS configuration paths, to match documentation
This brings us in line with pre-platformdirs behaviours on these,
following the details of the configuration paths, as documented in pip's
own documentation.
2021-10-17 15:07:58 +01:00
Pradyun Gedam
9f18a403ca
Merge pull request #10481 from notatallshaw/prefer_failures 2021-10-10 00:06:30 +01: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
Joseph Bylund
98d8401035
Apply suggestions from code review
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2021-10-08 07:27:38 -04:00
Joseph Bylund
dee6690f06 Renames, moves, docstrings, comments 2021-10-07 07:11:33 -04:00
Joseph Bylund
0862d40d35 (joe) work around no equality operator for requirement objects 2021-10-06 13:04:23 -04:00
Joseph Bylund
bd87828eae (joe) black + imports 2021-10-06 12:48:48 -04:00
Joseph Bylund
bb8824439e (joe) requirement creation is very expensive, and at least in my test case there were only ~200 unique requirement objects created in ~5-10 minutes of resolution time 2021-10-06 12:42:44 -04:00
Pradyun Gedam
377754b44a
Drop the hacky appdirs tests
There is no reason to try to test for other platforms.
2021-10-03 14:30:52 +01:00
Dominic Davis-Foster
78b8b8b5d2
Reformat test_appdirs.py, add type annotations, and switch to @pytest.mark.usefixtures 2021-09-30 16:48:40 +01:00
Dominic Davis-Foster
147e8a8a55
Remove duplicate monkeypatches 2021-09-30 15:37:12 +01:00
Dominic Davis-Foster
d031c640eb
Bump platformdirs version. 2021-09-30 15:36:13 +01:00
Dominic Davis-Foster
f2ff6effc1
Lint test_appdirs.py 2021-09-30 15:36:13 +01:00
Dominic Davis-Foster
ae6cf66c79
Switch from appdirs to platformdirs 2021-09-30 15:34:35 +01:00
Tzu-ping Chung
cb2d4b89a7
Merge pull request #10526 from uranusjr/remove-extra-merge-xfail 2021-09-30 16:34:39 +08:00
Tzu-ping Chung
8043eb267e Remove stale xfail on macOS tag generation 2021-09-30 15:30:42 +08:00
Jon Dufresne
72937f6520 Complete type annotations for tests/conftest.py and tests/lib/* 2021-09-29 19:57:29 -07:00
Stéphane Bidoul
e5be3f796e
Add PEP 660 support (build_editable) 2021-09-28 23:04:51 +02: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
Tzu-ping Chung
f609d35a8f
Merge pull request #10482 from notatallshaw/known_depths 2021-09-26 12:42:12 +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
Tzu-ping Chung
58b1b73f30
Merge pull request #9498 from NoahGorny/cache-http-requests
session: Cache http requests of trusted hosts
2021-09-22 11:03:56 +08:00
Tzu-ping Chung
f6665f3512
Merge pull request #10288 from rittneje/fix-credential-cache 2021-09-22 10:23:08 +08:00
Stéphane Bidoul
42c1b2997a
Merge pull request #10493 from jdufresne/excinfo
Fix unreachable code in tests/unit/test_network_utils.py
2021-09-21 17:35:42 +02:00
Tzu-ping Chung
a902f5cba4
Merge pull request #10494 from jdufresne/missing-session
Add missing "session" fixtures in tests/unit/test_req_file.py
2021-09-21 21:26:08 +08:00
Stéphane Bidoul
2de1e5b1bf
Remove egg_link_path() 2021-09-21 11:18:02 +02:00
Stéphane Bidoul
5fa413d363
Extract egg_link* function to a separate module 2021-09-21 11:18:02 +02:00
Stéphane Bidoul
d051a00fc5
Remove unused get_installed_distributions 2021-09-21 11:18:01 +02:00
Jon Dufresne
09450dd052 Add missing "session" fixtures in tests/unit/test_req_file.py
Caught by mypy:

    tests/unit/test_req_file.py:342: error: Argument "session" to "parse_reqfile"
    has incompatible type "Callable[[], PipSession]"; expected "PipSession"
    [arg-type]
        ...  reqs = list(parse_reqfile("./parent/req_file.txt", session=session))
                                                                        ^
2021-09-20 21:38:16 -07:00
Jon Dufresne
bec53e0388 Fix unreachable code in tests/unit/test_network_utils.py
Examining the pytest.raises excinfo object should be done outside the
with statement block. Previously, the raised exception prevented the
assert from being executed.

Per the docs:
https://docs.pytest.org/en/latest/how-to/assert.html#assertions-about-expected-exceptions

The exception is the "value" attribute, not "info".

mypy also caught this mistake:

    tests/unit/test_network_utils.py:23: error:
    "ExceptionInfo[NetworkConnectionError]" has no attribute "info"  [attr-defined]
                assert str(exc.info) == (
2021-09-20 20:58:06 -07:00