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

355 commits

Author SHA1 Message Date
hauntsaninja
666be3544b Avoid use of 2020-resolver and legacy-resolver 2023-09-23 13:34:06 -07:00
Shantanu
eddd9ddb66
Enable mypy's strict equality checks (#12209)
This makes mypy check more behaviours within the codebase.

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2023-09-23 17:10:13 +01:00
Christian Clauss
85eea44623
Merge branch 'main' into ruff-rules-C4-and-PERF 2023-09-02 00:13:31 +02:00
Paul Ganssle
f612503035
Remove uses of utcnow in non-vendored code (#12006)
* Remove reference to utcnow

This cleans up some of the datetime handling in the self check.

Note that this changes the format of the state file, since the datetime
now uses ``.isoformat()`` instead of ``.strftime``. Reading an outdated
state file will still work on Python 3.11+, but not on earlier versions.

* Use aware datetime object in x509.CertificateBuilder
2023-08-31 09:28:31 +01:00
Christian Clauss
0a24a001fb Fix issues raised in code review 2023-08-28 15:04:54 +02:00
Christian Clauss
69a1e956da Ruff rules C4,C90,PERF 2023-08-28 14:51:13 +02:00
Shantanu
d8cd93f4fa
Fix incorrect use of re function in tests (#12213) 2023-08-08 07:37:38 -05:00
Tzu-ping Chung
4abb8ac07b Fix Pytest --use-venv init 2023-07-04 15:53:01 +08:00
Paul Moore
7c3418b2d0
Add explicit ID to noqa comment
Co-authored-by: q0w <43147888+q0w@users.noreply.github.com>
2023-06-05 14:50:10 +01:00
Paul Moore
9824a426d4 Fix new lint errors 2023-06-05 14:32:44 +01:00
Роман Донченко
44c1ccaf40 Replace deprecated setup/teardown usage
As explained in
<https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose>,
`setup`/`teardown` are a part of nose compatibility, which is deprecated.
You're supposed to use `setup_method` and `teardown_method` instead.
2023-01-27 22:00:50 +03:00
Tzu-ping Chung
50e194f107 Selectively enable user site
The modern virtual environment structure does not allow us to enable
"fake user site" while disabling the global site, so we need to do more
fine-grained configuration to correctly set up test environments for
each test case.

With this done, we can also properly support the stdlib venv ad the test
environment backend, since it basically works identically with modern
virtualenv. The incompatible_with_test_venv is thus removed.
2022-10-28 01:51:13 +08:00
Tzu-ping Chung
83c85e94b7 Fix legacy virtualenv setup in tests 2022-10-28 01:51:13 +08:00
Tzu-ping Chung
4f20a7e3e7 Set include-system-site-packages for user site 2022-10-28 01:51:13 +08:00
Tzu-ping Chung
4d533cc269 Don't enable global site when enabling user site 2022-10-28 01:51:13 +08:00
Tzu-ping Chung
1d05ba8ffd Rewrite virtualenv tool in tests for 20+ support
Co-Authored-By: Lumir Balhar <lbalhar@redhat.com>
2022-10-28 01:51:13 +08: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
58d8dc28cb
Do not fail tests on our own deprecation warnings 2022-08-05 09:35:00 +02:00
Stéphane Bidoul
b423c07ff4
Detected indented ERROR and WARNING messages in tests 2022-08-05 09:35:00 +02:00
Paul Moore
662f940c96 Merge branch 'main' into test_zipapp 2022-07-28 10:51:04 +01: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
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
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
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
q0w
c8c88ce520 Adapt tests 2022-06-23 19:20:18 +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
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
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
afda75625c
Present the result, when the script passes unexpectedly 2022-02-26 12:32:53 +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
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
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
ff8b9a167e
Mark TestPipResult as not having tests
This makes pytest stop warning about it.
2022-01-21 14:10:40 +00: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
Jon Dufresne
c71cf88049 Complete type annotations of tests/functional/ directory 2021-11-18 18:26:17 -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
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
Tzu-ping Chung
b392833a0f
Merge pull request #10435 from jdufresne/typing-unit 2021-09-26 16:29:29 +08:00
Jon Dufresne
e1acf245a9 Handle PY2 TODO comment in tests/lib/filesystem.py 2021-09-25 07:38:09 -07:00
Jon Dufresne
60c274be2d Complete type annotations of tests/unit/ directory 2021-09-23 05:44:54 -07:00
Stéphane Bidoul
cee422f5bc
Refactor direct_url test helper 2021-09-21 11:18:00 +02:00