Commit Graph

58 Commits

Author SHA1 Message Date
Damian Shaw 68529081c2
Enforce f-strings via Ruff (#12393) 2023-11-07 09:14:56 +00:00
Dale fd77ebfc74
Rework the functionality of PIP_CONFIG_FILE (#11850) 2023-10-27 14:59:56 +02:00
Tzu-ping Chung 256af8f691
Catch OSError instead of IOError 2023-06-29 17:28:16 +08:00
Tzu-ping Chung 41f138e43a
Minimize changeset 2023-06-29 16:51:34 +08:00
Tzu-ping Chung 6507734aac
Fix string formatting 2023-06-29 16:51:11 +08:00
JasonMo1 7572dbc095 Add IO check before save configuration1 2023-06-22 12:03:58 +08:00
JasonMo1 c4709d2b22 Add permission check before configuration11 2023-06-22 11:31:43 +08:00
JasonMo1 c57bad63da Add permission check before configuration10 2023-06-22 11:27:48 +08:00
JasonMo1 81c8a3ffbc Add permission check before configuration9 2023-06-17 12:42:47 +08:00
JasonMo1 8747268d44 Add permission check before configuration8 2023-06-17 12:30:36 +08:00
JasonMo1 05e936aecb Add permission check before configuration7 2023-06-17 12:16:25 +08:00
JasonMo1 5986dd27c5 Add permission check before configuration 2023-06-17 11:23:10 +08:00
JasonMo1 17147b8fd3 Add permission check before configuration 2023-06-17 11:23:10 +08:00
JasonMo1 2dbda58efc Add permission check before configuration 2023-06-17 11:23:10 +08:00
JasonMo1 f74650725b Add permission check before configuration 2023-06-17 11:23:10 +08:00
Paul Moore 7ba5a625bc Revert "Merge pull request #11487 from pelson/feature/base-prefix-config"
This reverts commit 56e5fa3c0f, reversing
changes made to 2c09e9c760.
2023-04-21 17:05:49 +01:00
Phil Elson b777bcda81 Add the "base" config level concept, to allow configuration of all virtual environments sharing the same base.
The new functionality serves a use case which was not previously possible with pip configuration files, namely the situation where you have a base Python installation and want to influence the pip configuration for all derivative virtual environments *without* changing the config for all other environments on a machine (global), or for all other environment run by the same user (user). Concretely, this could be used for a centrally managed network mounted filesystem based Python installation, from which multiple users can build virtual environments and inside which a specific pip configuration is needed (e.g. an index URL).
2022-10-06 09:33:38 +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 4b35763d5f ``pip config`` normalizes names, converting underscores into dashes. closes #9330 2022-04-29 22:38:38 -05:00
gousaiyang 7b6a1eddb7 Convert str.format to f-string 2021-10-17 11:56:43 -07:00
gousaiyang 71d21ccaa0 Fix 2 places where encoding is not specified
- In `pip/_internal/configuration.py`, explicitly use locale encoding to parse configuration file
- In `pip/_internal/build_env.py`, use UTF-8 when generating `sitecustomize.py`

Fixes #10590.
2021-10-16 11:48:11 -07:00
Noah Gorny 61db4f35bb configuration: Add back load_file verbose log instead of debug one 2021-09-11 16:50:24 +03:00
Pradyun Gedam 94999255d5
Reformat the codebase, with black 2021-08-20 13:37:49 +01:00
harupy 6d665fd065 convert type comments 2021-07-24 13:13:10 +09:00
Jon Dufresne 0945809afc Remove typing.TYPE_CHECKING guards
The typing module has been available since Python 3.5. Guarding the
import has been unnecessary since dropping Python 2.

Some guards remain to either:

- Avoid circular imports
- Importing objects that are also guarded by typing.TYPE_CHECKING
- Avoid mypy_extensions dependency
2021-02-19 18:34:21 -08:00
Jon Dufresne a6392bd62e Replace pip._internal.utils.typing with stdlib typing
The stdlib module has been available since Python 3.5 and the
TYPE_CHECKING constant has been available since 3.5.2.

By using stdlib, this removes the need for pip to maintain its own
Python 2 typing compatibility shim.
2021-02-18 19:09:13 -08:00
Jon Dufresne 5150129f6b Replace compat.expanduser() with os.path.expanduser()
The upstream bug has been fixed and released in all supported Python
version: https://bugs.python.org/issue14768
2020-12-29 08:15:55 -08:00
Pradyun Gedam 86afa89043
Merge pull request #9361 from jdufresne/f-strings
Use f-strings for simple string formatting
2020-12-26 10:24:18 +00:00
Jon Dufresne cdcf74fb8e Use f-strings for simple string formatting
Use pyupgrade to convert simple string formatting to use f-string
syntax. pyupgrade is intentionally timid and will not create an f-string
if it would make the expression longer or if the substitution parameters
are anything but simple names or dotted names.
2020-12-25 16:21:20 -08:00
Jon Dufresne 09b3d3a50b Remove object from class definitions
Unnecessary since dropping Python 2 support. In Python 3, all classes
are new style classes.
2020-12-25 15:48:11 -08:00
Jon Dufresne c148bcc1aa Use short Python3 super() syntax 2020-12-24 15:11:51 -08:00
Hugo van Kemenade 817ee23051 Remove redundant Python 2.7 code 2020-12-22 09:06:26 +02:00
Pradyun Gedam 25ab172b55
Update linter: isort 2020-09-23 19:52:28 +05:30
Nguyễn Gia Phong e0f311b1f4 Declare constants in configuration.py as such 2020-07-14 16:45:34 +07:00
Nguyễn Gia Phong c5e19c01c4 Clean up Configuration.unset_value and nit __init__ 2020-07-11 15:56:34 +07:00
Devesh Kumar Singh 4cc731c62b Add type annotations to pip._internal.configuration 2020-07-11 01:38:19 +05:30
Devesh Kumar Singh f0f692e8e9 Add env and env var values 2020-06-28 16:22:00 +05:30
Devesh Kumar Singh b9d19a64d7 List values per configuration file 2020-06-28 16:22:00 +05:30
Devesh Kumar Singh 7a8f374c39 Add option to list config files with pip config 2020-06-28 16:22:00 +05:30
KOLANICH 958f4ec432 Added `__repr__` for `Configuration`. 2020-03-03 13:36:50 +03:00
Christopher Hunt 1b4c0866ab
Remove untyped defs (#7382) 2019-11-19 11:46:26 +08:00
Maxim Kurnikov 3692097cca add per-file disallow_untyped_defs=False, and set it to True globally 2019-09-29 23:31:15 +02:00
Pradyun Gedam f377148f6d
Use mypy's inline configuration syntax for opt-outs 2019-07-30 12:39:51 +05:30
Pradyun Gedam 537b0fca12
Change isort multi_line_output to 3 2019-07-22 10:15:27 +05:30
Xavier Fernandez 645809944c
Move config files locations inside a function (#6736) 2019-07-20 22:29:24 +02:00
David Bordeynik 8f330a5959 fix-5963: fail elegantly on missing name or section in config set / unset 2019-05-09 20:33:30 +03:00
Pi Delport 5f3c56e188 Fix some typos 2019-03-12 21:54:18 +01:00
Steve Dower 293c91ee8a Configuration files may now also be stored under `sys.prefix` (#6268)
* Rename kinds.VENV to kinds.SITE and site_config_files to global_config_files
* Add tests for config file options
* Deprecate --venv in pip config
2019-03-07 11:14:56 +05:30
Jon Dufresne 5779f55bd4 Replace six.next() with builtin next()
The builtin has been available since Python 2.6. Makes the code slightly
more forward compatible by removing an unnecessary use of six.
2019-02-24 22:04:16 +01:00
Pradyun Gedam 04f1e70427
Merge pull request #6282 from mkurnikov/update-flake8-to-3.7.6
Update flake8 to 3.7.6
2019-02-22 21:56:28 +05:30