Commit Graph

19 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
Christian Clauss 69a1e956da Ruff rules C4,C90,PERF 2023-08-28 14:51:13 +02:00
Daniele Nicolodi 7ff4da6e8f
Reconcile computation of isolated build environment paths (#11740)
Use the same code to determine isolated environment paths at
dependency install time and at environment setup time. We do not care
about the exact paths but the paths needs to be consistent at package
installation time and environment setup.

This should fix issues observed on platforms that customize the
installation schemes, such as Debian and Homebrew, where dependency
installation and isolated build environment setup resolved to
different paths.
2023-02-06 11:27:44 +00:00
Daniele Nicolodi f8beb61f1c Rename get_prefixed_libs() to get_isolated_environment_lib_paths()
Since this function is only used for creating isolated environments,
rename it to better describe what it does.  This avoids needing to
think about why the implementation uses the "venv" paths scheme even
when pip is not running in a virtual environment.
2022-11-16 22:52:29 +01: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
Brett Rosen 50eb337a0f Ensure that removing shim in older setuptools does not error 2022-07-29 16:53:32 -04:00
Pradyun Gedam b728bdad2a
Remove the setuptools-provided distutils hack, if using distutils
This ensures that pip's imported copy of distutils comes from the
standard library, if/when the hack needs to be used.
2022-07-26 19:39:41 +01: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
Tzu-ping Chung a3b186acf8 Normalize sys.prefix for old virtualenv
virtualenv<14 does not normalize sys.prefix correctly, so we need to do
it on our own.
2021-08-06 16:20:59 +08:00
Tzu-ping Chung fcadb92b9e Prevent returning relative paths for a location
Our own override for the distutils implementation has a bug :)
2021-08-06 16:10:54 +08:00
Tzu-ping Chung dac6068d9f Post a deprecation warning for distutils configs
Since we can't do anything about them in the transition (CPython is
dropping support for those entirely), there's nothing we can do but to
tell users to not use them.

This also accounts for Homebrew and Linuxbrew for now. Hopefully they
will come up with better solutions that don't trigger the location
mismatch warning.
2021-07-27 12:28:12 +08:00
Tzu-ping Chung c5f9bc5f3b try-except distutils config parsing 2021-07-12 15:06:37 +08:00
Harutaka Kawamura 23eb69fe21
Complete type annotations in `pip/_internal/locations` (#10127) 2021-07-12 11:42:16 +08:00
Tzu-ping Chung b7068f643e Split bin_user and bin_prefix implementations
Module-level logic is bad.
2021-02-23 04:29:46 +08:00
Tzu-ping Chung 1e1289e550 User-site special case fixes 2021-02-23 03:51:15 +08:00
Tzu-ping Chung 7563a9c6cc Goodness 2021-02-23 02:04:15 +08:00
Tzu-ping Chung 08c282919f Blackify 2021-02-23 01:58:40 +08:00
Tzu-ping Chung edbda257c6 Abstract out get_python_lib() usages 2021-02-23 01:58:38 +08:00
Tzu-ping Chung 738e600506 Move distuitls location logic into subpackage 2021-02-23 01:57:40 +08:00
Renamed from src/pip/_internal/locations.py (Browse further)