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

634 commits

Author SHA1 Message Date
Damian Shaw
2a0acb595c
Update and provide fixes for mypy pre-commit (#12389)
* Update mypy to 1.6.1

* Fix mypy "Source file found twice under different module names" error

* Ignore type of intialized abstract class in tests

* Use more specific type ignore method-assign

* Type ignore for message.get_all

* Remove unused type ignore

* Add SizedBuffer type for xmlrpc.client.Transport subclass

* Add Self type for RequestHandlerClass in test

* Add type ignore for shutil.rmtree onexc handler

* Quote SizedBuffer

* Add news entry

* Remove no longer correct comment

* Update self import

* Also ignore type onerror=handler

* Update news entry

* Update news entry
2023-11-07 09:39:01 +00:00
Damian Shaw
68529081c2
Enforce f-strings via Ruff (#12393) 2023-11-07 09:14:56 +00:00
Stéphane Bidoul
8f0ed32413 Redact URLs in Collecting... logs 2023-10-14 14:02:55 +02:00
Pradyun Gedam
3f6e81694f
Rework how the logging stack handles rich objects
This makes it possible to render content via rich without a magic string
and relies on a proper mechanism supported by the logging stack.
2023-10-01 12:24:10 +01: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
Danny McClanahan
454e9768fb
incorporate review comments 2023-07-28 02:43:49 -04:00
Danny McClanahan
eabefd4021
revert the traceback wrapping 2023-07-28 02:18:36 -04:00
Danny McClanahan
eeb3d8fdff
synthesize a traceback to get a normal exc_info from an exception
- as per https://docs.python.org/3.12/whatsnew/3.12.html#shutil, we must expect only an exception
  and *not* the full exc_info from the new onexc function (the documentation of this is very
  misleading and still uses the label "excinfo":
  https://docs.python.org/3.12/library/shutil.html#shutil.rmtree)
2023-07-28 01:00:06 -04:00
Tzu-ping Chung
d0641740d5
Merge pull request #11394 from ales-erjavec/temp-cleanup-ignore-errors 2023-07-27 15:11:40 +08:00
Illia Volochii
5e4e44a254
Drop a fallback to using SecureTransport on macOS 2023-07-22 20:39:04 +03:00
Aleš Erjavec
2928750ae6 Change warning wording
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2023-07-17 15:15:41 +02:00
Ales Erjavec
6a9098ed48 Show a single warning on temp directory cleanup
Log individual errors at debug logging level.
2023-07-17 15:15:41 +02:00
Ales Erjavec
4ff65abdf7 Fix 'force' remove file without write permissions
Preserve existing mode flags, handle case where we even lack
permission to change the mode.
2023-07-17 15:15:41 +02:00
Ales Erjavec
660dafb37f Ignore errors in temporary directory cleanup
pip should not exit with an error when it fails to cleanup temporary
files after it has already successfully installed packages.
2023-07-17 15:15:41 +02:00
Shantanu
593b85f4ab
Use strict optional checking in misc.py (#11382) 2023-07-17 10:40:25 +01:00
Greg Roodt
9b47bc0fea Make black formatter happy 2023-07-10 22:04:46 +10:00
Greg Roodt
25f4e6eabf Fix deprecation warnings in Python 3.12 for usage of shutil.rmtree 2023-07-10 21:59:42 +10:00
hauntsaninja
b5377aeb73 nope 2023-06-20 02:04:36 -07:00
hauntsaninja
e995f25644 nope 2023-06-20 01:54:20 -07:00
hauntsaninja
36014e6f49 don't catch attributeerror 2023-06-20 01:51:56 -07:00
hauntsaninja
4211775631 remove the error code to silence ruff 2023-06-20 01:48:49 -07:00
hauntsaninja
54be97e05c Use strict optional checking in glibc
Suggested by pradyunsg in #11374

`--no-strict-optional` defeats half the purpose of using mypy.

This change is trivial, we already catch AttributeError in the case that
mypy is concerned about.
2023-06-20 01:42:51 -07:00
Stéphane Bidoul
8e2205d849 Add function to check hashes against known digests 2023-04-14 08:03:48 +02:00
Stéphane Bidoul
bc3feef9cc Remove setup.py install legacy 2023-03-31 09:47:09 +02:00
Stéphane Bidoul
48986a6d1f Don't fallback to setup.py install when build failed 2023-03-31 09:47:08 +02:00
Stéphane Bidoul
123e8a4c59
Merge pull request #11871 from sbidoul/always-use-pep517-when-wheel-absent-sbi
Always use pep 517 when the 'wheel' package is absent
2023-03-27 16:21:04 +02:00
Stéphane Bidoul
82f1ff0adb Fix type of config_settings arguments 2023-03-27 14:01:36 +02:00
Stéphane Bidoul
8a1a8d7915 Always use pep 517 when the 'wheel' package is absent 2023-03-27 11:55:20 +01:00
Stéphane Bidoul
a04748db8e Remove support for the deprecated --install-options 2023-03-18 11:20:51 +01:00
Stéphane Bidoul
5189a6e0f4 --no-binary does not imply setup.py install anymore 2023-03-12 17:18:53 +01:00
Pradyun Gedam
eb7b4ed62e
Update vendored pkg_resources 2023-02-04 21:18:10 +00:00
Tzu-ping Chung
95a58e7ba5
Merge pull request #11663 from uranusjr/pep-668 2023-01-18 11:50:26 +08:00
Tzu-ping Chung
a2519ebf49 Enable strict optionals in egg_link code
Newer typeshed correctly annotates sysconfig.get_path() to return str
so this just works now.
2023-01-17 10:07:13 +08:00
Tzu-ping Chung
095fd850fd Isolate EXTERNALLY-MANAGED parsing logic
This makes the parser easier to test.
2023-01-03 07:57:21 +08:00
Tzu-ping Chung
e27a819883 Use ExternallyManagedEnvironment to show error
This moves most of the displaying logic into the exception class so it
can better leverage DiagnosticPipError and Rich functionalities.
2023-01-03 07:57:21 +08:00
Tzu-ping Chung
69cb3f8617 Check EXTERNALLY-MANAGED in install and uninstall
This implements the PEP 668 logic to 'pip install' and 'pip uninstall'.
Are there any other commands that may need it?

This implementation disables the check is any of --prefix, --home, or
--target is provided, since those can indicate the command does not
actually install into the environment. Note that it is still possible
the command is still modifying the environment, but we don't have a
way to stop the user *that* determined to break the environment anyway
(they can always just use those flags in a virtual environment).

Also not sure how best this can be tested.
2023-01-03 07:57:21 +08:00
Pradyun Gedam
fa4b2efbab
Replace pep517 with pyproject_hooks
The `pep517` package has been superseded by a new package.
2022-12-28 20:13:57 +00:00
Tzu-ping Chung
5ded5474ac Name virtualenv<20 as "legacy"
Well they are. At least not "regular" anymore.
2022-10-28 01:51:13 +08:00
Stéphane Bidoul
b44a454535
Merge pull request #11452 from sbidoul/deprecate-no-binary-imply-pip-install
Deprecate --no-binary implying setup.py install
2022-09-25 11:06:25 +02:00
Stéphane Bidoul
24c8ebc85e
Set deprecation deadlines 2022-09-17 15:43:40 +02:00
Stéphane Bidoul
f39d38668a
Deprecate --no-binary implying setup.py install 2022-09-17 15:37:04 +02:00
Tzu-ping Chung
0930237775
Merge pull request #11318 from q0w/check-binary-exe 2022-08-31 18:25:46 +08:00
hauntsaninja
4d13842ec6 fixups 2022-08-12 18:48:39 -07:00
hauntsaninja
b9ec5ddc29 Use --no-implicit-optional for type checking
This makes type checking PEP 484 compliant (as of 2018).
mypy will change its defaults soon.

See:
https://github.com/python/mypy/issues/9091
https://github.com/python/mypy/pull/13401
2022-08-12 18:44:48 -07:00
Stéphane Bidoul
ae802e3e66
Deprecate setup.py install fallback when wheel package is absent 2022-08-06 19:33:30 +02:00
Stéphane Bidoul
27878a52af
Refactor legacy_install_reason 2022-08-06 19:29:31 +02:00
Stéphane Bidoul
d5317f2778
Revert "PipDeprecationWarning subclass DeprecationWarning"
This reverts commit f1bc96a4a3.
2022-07-31 17:34:39 +02:00
q0w
278141678e Check if binary_executable exists 2022-07-28 07:36:02 +03: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