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

1614 commits

Author SHA1 Message Date
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