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

4183 commits

Author SHA1 Message Date
Paul Moore
0d6fadac6c Merge branch 'main' into python_option 2022-08-01 09:43:55 +01:00
Paul Moore
b5afdd6048 Fix test to cater for packages leaked into venv 2022-07-30 16:37:58 +01:00
Paul Moore
01e122ed41 Add tests 2022-07-30 16:12:42 +01:00
Paul Moore
ee6c7caabd Fix test_runner_work_in_environments_with_no_pip to work under --use-zipapp 2022-07-28 11:57:26 +01:00
Paul Moore
662f940c96 Merge branch 'main' into test_zipapp 2022-07-28 10:51:04 +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
80c3b9615f Textual: "locally built" rather than "built"
As per @sbidoul's remark
2022-07-26 08:16:49 +02:00
Klaas van Schelven
d57c5dd1ee Fixed the tests 2022-07-25 15:11:54 +02:00
Stéphane Bidoul
3f5436cf3d
Use installer instead of setuptools in test suite
Instead of using a private setuptools api to
install common wheels in "editable" mode,
use 'installer' together with a .pth.
2022-07-23 16:22:02 +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
Finn Womack
0c574f7290
Remove time import 2022-07-18 11:58:51 -07:00
Finn Womack
246fef1914
Remove utc fixture 2022-07-18 11:44:18 -07:00
Stéphane Bidoul
a7a35dc20d
Merge pull request #11245 from sbidoul/pip-inspect-sbi
Add pip inspect command
2022-07-18 08:10:07 +02:00
Stéphane Bidoul
909be0d786
Merge pull request #11259 from sbidoul/drop-html5lib
Drop html5lib
2022-07-16 20:04:49 +02:00
Stéphane Bidoul
6d02fe2410
Merge pull request #11262 from pradyunsg/reuse-environment-runner-sccript
Move `__pip-runner__` script into a module
2022-07-16 19:50:03 +02: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
Stéphane Bidoul
a7df613b78
inspect: add experimental status warning 2022-07-15 14:08:38 +02:00
Stéphane Bidoul
585136494e
Add pip inspect command 2022-07-15 14:08:38 +02:00
Pradyun Gedam
470b217e8c
Add a test that the runner script works in environments without pip
This ensures that the runner script can be used in environments where
pip is not installed.
2022-07-15 12:22:08 +01:00
Stéphane Bidoul
d830c96403
Merge pull request #10771 from sbidoul/install-report-sbi
Installation/resolution report (aka pip install --dry-run --report)
2022-07-15 12:29:06 +02:00
Stéphane Bidoul
074c6b5cad
install report: added experimental status warning 2022-07-15 11:08:56 +02:00
Stéphane Bidoul
e41b13424e
install report: use array instead of dict for install field 2022-07-15 11:08:56 +02: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
Paul Moore
ea2318fbf9 Minor zipapp-related fixes and skips for some tests 2022-07-12 10:12:17 +01:00
Paul Moore
c7e7e426cb Apply black 2022-07-12 09:02:11 +01:00
Paul Moore
b84e5f3d99 Actually build the zipapp 2022-07-11 23:52:44 +01:00
Paul Moore
9a51fc8e0c Make the zipapp in a fixture 2022-07-11 20:01:26 +01:00
Paul Moore
ef999f4c76 Ignore temporary extracted copies of cacert.pem when testing with a zipapp 2022-07-11 17:18:21 +01:00
Paul Moore
a57668ef12 Add an option to the test suite to specify a zipapp to test 2022-07-11 16:26:24 +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
Stéphane Bidoul
99818e1e9a
Merge pull request #10692 from t20100/fix-install-pre
Fix `pip install --pre` for packages with dependencies defined in `pyproject.toml` and `setup.py`
2022-07-10 13:17:57 +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
Stéphane Bidoul
7fdff17543
install report: add suport for stdout output 2022-07-05 10:05:57 +02:00
Stéphane Bidoul
d32a62b3df
Use canonical names as keys in installation report 2022-07-05 10:05:57 +02:00
Stéphane Bidoul
2c84a1c16d
Add requested_extras to installation report 2022-07-05 10:05:57 +02:00
Stéphane Bidoul
d6685d09cf
Test that the install report has requires_dist
This is important for legacy setuptools distributions that do not
have Requires-Dist in PKG-INFO.
2022-07-05 10:05:57 +02:00
Stéphane Bidoul
e37178775b
Add --report option to pip install 2022-07-05 10:05:57 +02: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
340054a6bd
Merge pull request #11052 from SpecLad/fix-script-record-hash
Update the RECORD entry when rewriting the shebang line in a script
2022-06-26 12:20:13 +02:00
Stéphane Bidoul
65680b4bb1
Merge pull request #11096 from sbidoul/install-dry-run-sbi
Add --dry-run option to pip install
2022-06-26 11:41:48 +02:00
Роман Донченко
e4cd6da6e5 Update the RECORD entry when rewriting the shebang line in a script
The code to do this already exists in `get_csv_rows_for_installed`, but it's
broken due to inconsistent usage of the `_fs_to_record_path` function. When
we build the dictionary of installed files, we call it with a base
directory, while when build the set of modified files, we call it without a
base directory. As a result, the values of `installed` do not match the
elements of `changed`, and `get_csv_rows_for_installed` fails to identify
the rows that should be updated.

Fix this by ensuring that `_fs_to_record_path` is always called with a base
directory. `_record_to_fs_path` also needs a a base directory parameter to
be able to transform the path back into an absolute path, so add one.
2022-06-25 01:27:08 +03:00
Stéphane Bidoul
25dd00571a
Merge pull request #11022 from SpecLad/download-propagate-pep517
pip download: make sure that --use-pep517 is propagated to the dependencies
2022-06-24 19:42:58 +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
3726f71720
Add a --dry-run option to pip install 2022-06-23 19:33:18 +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
q0w
3662f5e0df Disallow use of script fixture in unit tests 2022-06-23 17:42:50 +03:00
q0w
49657d8c94 Use os.fspath 2022-06-21 19:35:22 +03:00
q0w
3181063f94 Convert to str shutil.move src arg for py<=39
https://github.com/python/cpython/issues/76870
2022-06-15 22:07:15 +03:00
Роман Донченко
28d7730087 test_download_use_pep517_propagation: use a different approach
The approach it uses now doesn't work anymore due to 452d7da8.
The installation of `fake_dep` now succeeds whether or not `setuptools`
is installed in the test environment.

Use a different approach instead: try to import `pip` in the `setup.py`
script. If it succeeds, then we are not running in an isolated environment,
and therefore PEP 517 isn't being used.

To add this custom logic to `setup.py`, add a new argument to
`create_basic_sdist_for_package`. Note that to make this work, I had to
switch from f-strings to `str.format`, since the `dedent` has to happen
before formatting.
2022-06-15 18:11:07 +03:00
Роман Донченко
698784796b pip download: make sure that --use-pep517 is propagated to the dependencies 2022-06-15 18:10:22 +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
ad1b2d31d0 Use samefile instead == to compare to SRC_DIR
This resolves a behavioral different between Python 3.7 and 3.8+, where
a == comparison would incorrectly compare Path against str and cause
incorrect results.
2022-06-12 12:19:14 +08: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
e58a8a591b
Merge pull request #11137 from sbidoul/download-info-sbi
Add download_info: DirectUrl to InstallRequirement
2022-06-01 08:21:12 +02:00
Stéphane Bidoul
05d2b85d4a Add unit tests for cache origin.json... and fix a bug 2022-05-30 18:36:48 +02:00
Tzu-ping Chung
b91dbde21f
Merge pull request #11082 from uranusjr/truststore 2022-05-30 02:32:49 -04:00
Pradyun Gedam
90096394c3
Merge pull request #11134 from q0w/revert-10998-handle-netrc
Revert "Prioritize url credentials over netrc"
2022-05-25 12:38:57 +05:30
Stéphane Bidoul
e7449498d3
Record origin url in wheel cache 2022-05-22 22:46:35 +02:00
Stéphane Bidoul
c6baa7514a
Add download_info to InstallRequirement 2022-05-22 22:46:35 +02:00
Pradyun Gedam
f20ab575b9
Merge pull request #11124 from uranusjr/use-contain-for-checking
Allow pre-release to satisfy build requirements
2022-05-16 15:05:40 +01:00
Tzu-ping Chung
f7c05a5124 Allow pre-release to satisfy build requirements 2022-05-16 07:40:00 -04: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
q0w
e20aab9901 Revert "Merge pull request #10998 from q0w/handle-netrc"
This reverts commit eacc739320, reversing
changes made to d5e1eeecc8.
2022-05-14 20:48:29 +03: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
Pradyun Gedam
611e9253ff
Filter out build requirements that require an extra to be used
There is no mechanism provided for build requirements to have extras.

It should be acceptable to enforce that any "optional" packages
that are supposed to be conditionally installed based on the presence of
an extra should not be installed in a build environment.
2022-05-12 01:04:11 +01:00
Pradyun Gedam
cb24fb4052
Merge pull request #11085 from pypa/revert-10962-fix-hashes 2022-05-09 08:38:51 +01:00
Pradyun Gedam
cf3696a81b
Merge pull request #11080 from sbidoul/requested-with-constraints
Fix REQUESTED in presence of URL constraints
2022-05-06 18:15:35 +01:00
Tzu-ping Chung
a020e8c35c Add very simple tests to ensure feature is enabled 2022-05-03 11:04:05 -06:00
Pradyun Gedam
2d028e140e Revert "Filter available distributions using hash declarations from constraints files (#10962)"
This reverts commit 0c284520c6.
2022-05-03 17:50:21 +01:00
Stéphane Bidoul
3c62d1cbce
Add failing test for REQUESTED and URL constraints 2022-05-01 19:39:17 +02: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
Pradyun Gedam
7eb75413e8
Merge pull request #10959 from pradyunsg/better-upgrade-warning
Improve the presentation style of the pip upgrade prompt
2022-04-28 18:26:43 +01:00
Pradyun Gedam
7164b1af50
Merge pull request #10827 from q0w/project-urls
Include Project-URLs in `pip show -v` output
2022-04-23 21:39:51 +01:00
Paul Moore
437bb67900 Rename test file pep517 -> pyproject 2022-04-23 14:45:59 +01:00
Paul Moore
4db45851b6 Explicitly test installs (and fix a bug found by those tests!) 2022-04-23 13:14:22 +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
1401dbae56 Add an end-to-end test for config settings 2022-04-21 18:30:48 +01:00
Paul Moore
d9c4ebf7be Add tests for basic --config-settings parsing 2022-04-21 18:30:48 +01:00
Tzu-ping Chung
8133d83929
Merge pull request #11030 from uranusjr/build-env-req-check-evaluate-marker 2022-04-16 19:46:23 +08:00
Tzu-ping Chung
233db7c31b Skip conditional build req without matching marker 2022-04-16 16:02:15 +08:00
Pradyun Gedam
c6e274e7fd
Merge pull request #10709 from uranusjr/metadata-importlib-backend 2022-04-15 12:49:32 +01:00
Frost Ming
6a1ed5c0f4
Add completion script for powershell (#9025) 2022-04-15 09:32:42 +01:00
Tzu-ping Chung
8073f65c14 Properly normalize and handle linked dist 2022-04-12 03:33:18 +08:00
Tzu-ping Chung
17355f8d47 Unnormalized metadata version works now! 2022-04-12 03:33:18 +08:00
Tzu-ping Chung
675de98f42 Better test setup and teardown with fixture 2022-04-12 03:31:50 +08:00
Tzu-ping Chung
e3952f8357 Fix unit test to check against the correct backend 2022-04-12 03:26:12 +08:00
Pradyun Gedam
e679df4051
Merge pull request #11001 from pradyunsg/remove-out-of-tree
Drop out-of-tree/in-tree build transition flags
2022-04-09 16:02:40 +01:00
Pradyun Gedam
eacc739320
Merge pull request #10998 from q0w/handle-netrc 2022-04-08 13:09:36 +01: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
q0w
b953f9aaa7 Use explicit wrong credentials 2022-04-07 11:15:48 +03:00
Henrich Hartzer
2cfe36dc9e Update pre-commit hooks
Co-Authored-By: q0w <43147888+q0w@users.noreply.github.com>
2022-04-04 16:02:02 +03:00
q0w
ee67cf714b Prioritize url credentials over netrc 2022-03-29 20:27:24 +03: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
62516b8ad3
Rename PIP_{REQ -> 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
q0w
db71def50f replace git scheme with https 2022-03-19 14:17:05 +03:00
Pradyun Gedam
25861e564d
Merge pull request #10560 from pradyunsg/fix-protect-pip-on-windows
Fix the protect-pip-on-windows logic
2022-03-18 12:32:18 +00:00
q0w
0c284520c6
Filter available distributions using hash declarations from constraints files (#10962) 2022-03-16 07:43:06 +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
Pradyun Gedam
afda75625c
Present the result, when the script passes unexpectedly 2022-02-26 12:32:53 +00:00
Pradyun Gedam
ce30e6c532
Fix the protect-pip-on-windows logic
The names for the executables does not contain a `.exe` suffix anymore.
2022-02-26 12:32:52 +00:00
Pradyun Gedam
201135fd2e Normalise name to match newer flit behaviour 2022-02-25 12:08:44 +00:00
q0w
0c6d20f8c7
Validate build deps when --no-build-isolation is passed (#10886)
This can help catch issues in setting up the build environment, helping
ensure that packages get built according to their declared metadata.
2022-02-18 14:58:40 +00:00
Shivansh-007
5086e57997
Add test for failed parse log with invalid git version 2022-02-18 18:32:24 +05:30
Yusuke Hayashi
d854b1e20d
fix: spelling mistakes and typos 2022-02-17 18:05:59 +09:00
Tzu-ping Chung
ec8edbf5df
Merge pull request #10819 from q0w/file404 2022-02-03 20:37:38 +08:00
q0w
7f6a9cad22 Add test 2022-02-03 14:57:21 +03: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
q0w
8749d0baad Add docstring 2022-02-02 21:11:23 +03: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
Pradyun Gedam
ef7e0c34de
Avoid setuptools 60.6.0
It has a bug that breaks our test suite, and the relevant bug is being
investigated at the moment.
2022-02-01 09:04:00 +00: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
a78845ab33
Pacify functional tests that don't start with <!doctype html> 2022-01-30 21:57:22 +00: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
9a9c1def6e
Merge pull request #10846 from pradyunsg/fix-html5lib-fallback 2022-01-30 18:22:14 +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
Pradyun Gedam
f13104abb2
Accept lowercase doctype declarations 2022-01-30 13:11:13 +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
ca78aba456
Test that the resolver skips packages, as instructed by constraints 2022-01-27 18:11:05 +00:00
Pradyun Gedam
8eeee22304
Abort immediately on metadata generation failure instead of backtracking
This behaviour is more forgiving when a source distribution cannot be
installed (eg: due to missing build dependencies or platform
incompatibility) and favours early eager failures instead of trying to
ensure that a package is installed regardless of the amount of effort it
takes.
2022-01-27 18:11:02 +00:00
Pradyun Gedam
1cda23bd6b
Merge pull request #10795 from pradyunsg/better-subprocess-errors 2022-01-27 07:09:18 +00:00
Andy Freeland
e752b1a26b
Include files/folders in pip install autocomplete (#10682) 2022-01-25 18:27:09 +00:00
q0w
24bee84f44 Show Project-URLs 2022-01-25 18:26:06 +03: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
deb2d754e7
Tweak the chattymodule to not leak potentially information
I'd like to use this in screenshots, but the os.environ makes it a bit
tricky to do.
2022-01-25 01:38:23 +00:00
Pradyun Gedam
a835e0a277
Prettify messages for discarding candidates due to issues
These are more pleasing colours and, more importantly, a clearer
presentation style of the package vs the error.
2022-01-25 01:38:23 +00:00
Pradyun Gedam
68e0bd46c8
Add an example setuptools-based package that always fails 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
57198c6688
Use logger.warning instead of warnings.warn
This is more in line with the rest of our output presentation logic.
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
42075efa61
Annotate an unannotated test 2022-01-25 01:32:34 +00:00
Pradyun Gedam
997c5a742b
Merge pull request #10625 from albertosottile/ignore_yanked 2022-01-24 23:47:54 +00:00
Pradyun Gedam
ff8b9a167e
Mark TestPipResult as not having tests
This makes pytest stop warning about it.
2022-01-21 14:10:40 +00:00
Pradyun Gedam
b82dfd1745
Restore colors in regular logging messages
Also, reflects that `--no-color` does not mean no-ansi-escapes but only
affects colour rules.
2021-12-12 13:11:36 +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
Thomas VINCENT
077867237b Add test to reproduce issue #10222 2021-12-06 15:54:07 +01:00
Tzu-ping Chung
496343ead0 Fix in-site-packages patch for user install tests 2021-12-04 17:57:34 +08:00
Tzu-ping Chung
6ed6aa819f Fix test failures caused by name normalization 2021-12-04 17:57:34 +08: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
d130d31b14
Merge pull request #10674 from uranusjr/mypy-fix-windows 2021-12-04 14:49:27 +08:00
Pradyun Gedam
8d4fb059dd
Merge pull request #10686 from mgorny/missing-cryptography 2021-12-03 12:09:56 +00:00
Dustin Ingram
06cd803328
Add type annotations 2021-12-02 16:43:03 -05:00
Dustin Ingram
772a17c698
Add failing test 2021-12-02 15:57:17 -05:00
Michał Górny
3d5da04004 Move cryptography-based imports into the fixture
Move the imports that require cryptography into the cert_factory
fixture.  This makes it possible to deselect these tests on systems
where cryptography cannot be installed.
2021-11-27 07:58:42 +01: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
1181b22119 Apply mypy config override to blocked_signals 2021-11-22 17:05:15 +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
Tzu-ping Chung
f9250d29c9 Fix typing for uninstallation test 2021-11-21 23:43:49 +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
Jon Dufresne
c71cf88049 Complete type annotations of tests/functional/ directory 2021-11-18 18:26:17 -08: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
Alberto Sottile
51bda9637b Lint 2021-11-06 16:27:39 +01:00
Alberto Sottile
99cb1e0fc3 Add test_error_all_yanked_files_and_no_pin test 2021-11-06 16:22:56 +01:00
Pradyun Gedam
c99e91224c
Merge pull request #10538 from pradyunsg/diagnostic-errors 2021-10-29 12:44:16 +01:00
Tzu-ping Chung
c4d9f563dd Add failing test for extra-already-installed case 2021-10-23 23:49:30 +08: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
619b257ed9
Add failing tests for issue 10573 2021-10-18 14:31:11 +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
Alex Hedges
e1f81bfa4d Fix many typos 2021-10-11 15:48:17 -04:00
Pradyun Gedam
9f18a403ca
Merge pull request #10481 from notatallshaw/prefer_failures 2021-10-10 00:06:30 +01:00
Pradyun Gedam
db496cbce5
Merge pull request #10563 from pradyunsg/shorter-timeout 2021-10-10 00:02:22 +01:00
Pradyun Gedam
4fac2b90a5
Merge pull request #10550 from jbylund/joe/cache_requirement_creation 2021-10-09 14:56:09 +01:00
Pradyun Gedam
786957cf85
Use a shorter timeout, to ensure that this fails more often 2021-10-09 11:34:23 +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
Pradyun Gedam
ae2c9eda54
Merge pull request #10543 from pradyunsg/drop-sdist-reinstall
Un-deprecate source distribution re-installation behaviour
2021-10-09 07:37:36 +01:00
Diego Ramirez
02b4f86489
Return a better error message if a file: URL is not found (#10263)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2021-10-08 14:24:54 +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
Pradyun Gedam
68e22aa959
Un-deprecate source distribution re-installation behaviour
This will be handled as part of a broader effort to make the reinstall
behaviours more ergonomic and easier to reason about.
2021-10-08 12:22:15 +01: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
Tzu-ping Chung
0981e071be
Merge pull request #10539 from pradyunsg/vendoring-upgrade 2021-10-05 15:40:09 +08:00
Pradyun Gedam
bc98892d0b
Drop --build-dir from the CLI
This was restored as a no-op for PyCharm, as a way to soften the
migration for them. It is no longer necessary, since the migration has
completed.
2021-10-04 22:35:48 +01: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
Pradyun Gedam
9a058c62b7
Fix a failing test
This was caused due to an overlap between two PRs which ended up being
incompatible.
2021-10-02 15:01:05 +01:00
Pradyun Gedam
7616583dbb
Merge pull request #10202 from domdfcoding/platformdirs 2021-10-02 12:47:44 +01:00
Pradyun Gedam
a07bfb33a0
Merge pull request #10495 from sbidoul/out-of-tree-build-flag 2021-10-02 12:34:24 +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
Jon Dufresne
b0bf93f174 Remove unconditionally skipped test (fails if skip removed)
The test was introduced in f9990605dc (May
2017) and was unconditionally skipped in
6cf5d7db54. It remains skipped to this
day.

In commit bd850c0798, the patched_file
method was removed/renamed. So even if the skip were removed, it would
fail on the undefined attribute.

This was caught via mypy which emits an error due to the missing method.
2021-09-30 04:58:49 -07: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
12cb745985 Remove xfail from a weird but passing test 2021-09-30 15:59:58 +08:00
Tzu-ping Chung
fbdc4648c2 Remove --build xfail for now
The option is current restored. We should remove this test after the
option is removed (again).
2021-09-30 15:55:57 +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
Tzu-ping Chung
ad9b041650 Don't skip extra-merging test on 2020 resolver 2021-09-30 01:37:22 +08:00
Stéphane Bidoul
348d884d09
Merge pull request #8212 from sbidoul/pep517-editable-sbi
PEP 660 (build_editable) support
2021-09-29 11:36:06 +02:00
Pradyun Gedam
8ea265186a
Merge pull request #10459 from NoahGorny/do-not-throw-error-on-cache-purge 2021-09-28 22:53:34 +01:00
Stéphane Bidoul
e5be3f796e
Add PEP 660 support (build_editable) 2021-09-28 23:04:51 +02:00
Tzu-ping Chung
d91fecdb5a
Merge pull request #10436 from jdufresne/fixture-data
Set TestData.__test__ to False to avoid pytest discovery
2021-09-28 21:50:37 +08:00
Noah Gorny
2d3f17c214 tests: cache: Add no files to remove cases 2021-09-28 14:18:52 +03: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
Jon Dufresne
e1acf245a9 Handle PY2 TODO comment in tests/lib/filesystem.py 2021-09-25 07:38:09 -07:00
Stéphane Bidoul
040cc391ba
Make in-tree-build the default
Add an out-of-tree-build feature flag to ease the transition.
2021-09-25 13:11:01 +02: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
605d68ead3
Merge pull request #10492 from jdufresne/with-wheel
Use @pytest.mark.usefixture("with_wheel") in tests
2021-09-21 21:27:29 +08: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
Stéphane Bidoul
0199c500f0
Use editable project location in pip freeze 2021-09-21 11:18:00 +02:00
Stéphane Bidoul
d251b4bf94
Add editable project location to pip list output 2021-09-21 11:18:00 +02:00
Stéphane Bidoul
cee422f5bc
Refactor direct_url test helper 2021-09-21 11:18:00 +02:00
Jon Dufresne
fa0804b98c Use @pytest.mark.usefixture("with_wheel") in tests
The with_wheel fixture doesn't have a value and isn't ever referenced
within a test function.

To avoid typing it every test function, change tests to use
pytest.mark.usefixture. It will no longer appear as an argument.

https://docs.pytest.org/en/latest/how-to/fixtures.html#use-fixtures-in-classes-and-modules-with-usefixtures
2021-09-20 21:44:29 -07: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
Tzu-ping Chung
9c3286873b
Merge pull request #10465 from jdufresne/mypy-pytest
Install pytest in mypy environment
2021-09-21 06:10:57 +08:00
Pradyun Gedam
4c609d5b68
Merge pull request #10437 from jdufresne/unused-tmpdir 2021-09-20 19:12:59 +01:00
ronaudinho
22ea509025
update log message 2021-09-21 00:33:02 +07:00
ronaudinho
f2727bcf11 include skips due to requires-python in logged links 2021-09-19 12:55:29 +07:00
ronaudinho
2528dc5926 fix unit test 2021-09-19 12:54:13 +07:00
Noah Gorny
b0bb352b9f tests: network: Add http trusted host adapter tests 2021-09-15 17:21:51 +03:00
Tzu-ping Chung
0de0b8dd9f
Merge pull request #10448 from jdufresne/unused-test-class
Remove unused class TestUpgradeDistributeToSetuptools
2021-09-15 14:25:23 +08:00
Jon Dufresne
426691dc14 Install pytest in mypy environment
pytest includes type annotations and is PEP-561 compliant. This helps
ensure correct pytest API usage.

This caught a misuse of pytest.mark.skipif which did not include a
boolean argument. The test is now marked "network" and no longer
skipped.
2021-09-12 20:49:56 -07:00
Pradyun Gedam
57ce346f55
Merge pull request #10457 from jdufresne/assert-todo
Handle TODO comment in tests/functional/test_new_resolver.py
2021-09-12 21:25:59 +01:00
Pradyun Gedam
f5e4b612c7
Merge pull request #10413 from jdufresne/raises
Replace assert_raises_regexp function with pytest.raises
2021-09-12 21:25:20 +01:00
Jon Dufresne
5c6169465e Remove unused class TestUpgradeDistributeToSetuptools
Unused since 6b54145783 when the last test
method was removed.

Removing the class avoids the need to add type annotations.
2021-09-12 12:55:09 -07:00
Jon Dufresne
a4f483e96f Handle TODO comment in tests/functional/test_new_resolver.py 2021-09-12 12:54:54 -07:00
Jon Dufresne
8c5d3556bd Fix failing test due to removed setuptools feature, use_2to3
setuptools removed use_2to3 in version v58.0.1 (2021-09-06). Some tests
install the anyjson package which uses this feature and so those tests
result in a command failure. The failure appeared as:

    error in anyjson setup command: use_2to3 is invalid.

As anyjson package is no longer maintained (last release was 2012),
change the tests to use a package that is healthy.

For details on the setuptools change, see the history at:

https://setuptools.readthedocs.io/en/latest/history.html#v58-0-2
2021-09-08 05:37:55 -07:00
Jesse Rittner
d05d3c1e97 fix auth cache to allow for username in index url 2021-09-06 10:04:50 -04:00
Jon Dufresne
8b24a66aa1 Set TestData.__test__ to False to avoid pytest discovery
As the class name starts with "Test", pytest interprets it as a test
case, but it is not one. Further, due to its `__init__` method, pytest
emits the following warning:

    .../pip/tests/lib/__init__.py:141: PytestCollectionWarning: cannot
    collect test class 'TestData' because it has a __init__ constructor

For additional information on pytest discovery, see:
https://docs.pytest.org/en/latest/example/pythoncollection.html
2021-09-05 13:51:46 -07:00
Jon Dufresne
ad25b61e07 Remove unused tmpdir fixtures from tests
There was also one unused monkeypatch fixture removed.
2021-09-05 07:08:06 -07:00