Skip to content

Commit d0df007

Browse files
committed
feat(config)!: rename experimental.system-git-client to system-git-client
1 parent 3e5e038 commit d0df007

File tree

6 files changed

+30
-32
lines changed

6 files changed

+30
-32
lines changed

docs/configuration.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,6 @@ Defaults to one of the following directories:
158158
- Windows: `C:\Users\<username>\AppData\Local\pypoetry\Cache`
159159
- Unix: `~/.cache/pypoetry`
160160

161-
### `experimental.system-git-client`
162-
163-
**Type**: `boolean`
164-
165-
**Default**: `false`
166-
167-
**Environment Variable**: `POETRY_EXPERIMENTAL_SYSTEM_GIT_CLIENT`
168-
169-
*Introduced in 1.2.0*
170-
171-
Use system git client backend for git related tasks.
172-
173-
Poetry uses `dulwich` by default for git related tasks to not rely on the availability of a git client.
174-
175-
If you encounter any problems with it, set to `true` to use the system git backend.
176-
177161
### `installer.max-workers`
178162

179163
**Type**: `int`
@@ -295,6 +279,24 @@ This setting has no effect if the server does not support HTTP range requests.
295279

296280
*Introduced in 1.8.0*
297281

282+
### `system-git-client`
283+
284+
**Type**: `boolean`
285+
286+
**Default**: `false`
287+
288+
**Environment Variable**: `POETRY_SYSTEM_GIT_CLIENT`
289+
290+
*Renamed to `system-git-client` in 2.0.0*
291+
292+
*Introduced in 1.2.0 as `experimental.system-git-client`*
293+
294+
Use system git client backend for git related tasks.
295+
296+
Poetry uses `dulwich` by default for git related tasks to not rely on the availability of a git client.
297+
298+
If you encounter any problems with it, set to `true` to use the system git backend.
299+
298300
Do not download entire wheels to extract metadata but use
299301
[HTTP range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests)
300302
to only download the METADATA files of wheels.

docs/dependency-specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ Poetry 1.2, you may wish to explicitly configure the use of the system git clien
294294
subprocess call.
295295

296296
```bash
297-
poetry config experimental.system-git-client true
297+
poetry config system-git-client true
298298
```
299299

300300
Keep in mind however, that doing so will surface bugs that existed in versions prior to 1.2 which

src/poetry/config/config.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@ class Config:
119119
"prefer-active-python": False,
120120
"prompt": "{project_name}-py{python_version}",
121121
},
122-
"experimental": {
123-
"system-git-client": False,
124-
},
125122
"requests": {
126123
"max-retries": 0,
127124
},
@@ -134,6 +131,7 @@ class Config:
134131
"solver": {
135132
"lazy-wheel": True,
136133
},
134+
"system-git-client": False,
137135
"keyring": {
138136
"enabled": True,
139137
},
@@ -299,9 +297,9 @@ def _get_normalizer(name: str) -> Callable[[str], Any]:
299297
"virtualenvs.options.no-pip",
300298
"virtualenvs.options.system-site-packages",
301299
"virtualenvs.options.prefer-active-python",
302-
"experimental.system-git-client",
303300
"installer.parallel",
304301
"solver.lazy-wheel",
302+
"system-git-client",
305303
"keyring.enabled",
306304
}:
307305
return boolean_normalizer

src/poetry/vcs/git/backend.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,7 @@ def _get_submodules(cls, repo: Repo) -> list[SubmoduleInfo]:
397397
def is_using_legacy_client() -> bool:
398398
from poetry.config.config import Config
399399

400-
legacy_client: bool = Config.create().get(
401-
"experimental.system-git-client", False
402-
)
400+
legacy_client: bool = Config.create().get("system-git-client", False)
403401
return legacy_client
404402

405403
@staticmethod

tests/console/commands/test_config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ def test_list_displays_default_value_if_not_set(
5454
cache_dir = json.dumps(str(config_cache_dir))
5555
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
5656
expected = f"""cache-dir = {cache_dir}
57-
experimental.system-git-client = false
5857
installer.max-workers = null
5958
installer.no-binary = null
6059
installer.only-binary = null
6160
installer.parallel = true
6261
keyring.enabled = true
6362
requests.max-retries = 0
6463
solver.lazy-wheel = true
64+
system-git-client = false
6565
virtualenvs.create = true
6666
virtualenvs.in-project = null
6767
virtualenvs.options.always-copy = false
@@ -85,14 +85,14 @@ def test_list_displays_set_get_setting(
8585
cache_dir = json.dumps(str(config_cache_dir))
8686
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
8787
expected = f"""cache-dir = {cache_dir}
88-
experimental.system-git-client = false
8988
installer.max-workers = null
9089
installer.no-binary = null
9190
installer.only-binary = null
9291
installer.parallel = true
9392
keyring.enabled = true
9493
requests.max-retries = 0
9594
solver.lazy-wheel = true
95+
system-git-client = false
9696
virtualenvs.create = false
9797
virtualenvs.in-project = null
9898
virtualenvs.options.always-copy = false
@@ -137,14 +137,14 @@ def test_unset_setting(
137137
cache_dir = json.dumps(str(config_cache_dir))
138138
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
139139
expected = f"""cache-dir = {cache_dir}
140-
experimental.system-git-client = false
141140
installer.max-workers = null
142141
installer.no-binary = null
143142
installer.only-binary = null
144143
installer.parallel = true
145144
keyring.enabled = true
146145
requests.max-retries = 0
147146
solver.lazy-wheel = true
147+
system-git-client = false
148148
virtualenvs.create = true
149149
virtualenvs.in-project = null
150150
virtualenvs.options.always-copy = false
@@ -167,14 +167,14 @@ def test_unset_repo_setting(
167167
cache_dir = json.dumps(str(config_cache_dir))
168168
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
169169
expected = f"""cache-dir = {cache_dir}
170-
experimental.system-git-client = false
171170
installer.max-workers = null
172171
installer.no-binary = null
173172
installer.only-binary = null
174173
installer.parallel = true
175174
keyring.enabled = true
176175
requests.max-retries = 0
177176
solver.lazy-wheel = true
177+
system-git-client = false
178178
virtualenvs.create = true
179179
virtualenvs.in-project = null
180180
virtualenvs.options.always-copy = false
@@ -295,14 +295,14 @@ def test_list_displays_set_get_local_setting(
295295
cache_dir = json.dumps(str(config_cache_dir))
296296
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
297297
expected = f"""cache-dir = {cache_dir}
298-
experimental.system-git-client = false
299298
installer.max-workers = null
300299
installer.no-binary = null
301300
installer.only-binary = null
302301
installer.parallel = true
303302
keyring.enabled = true
304303
requests.max-retries = 0
305304
solver.lazy-wheel = true
305+
system-git-client = false
306306
virtualenvs.create = false
307307
virtualenvs.in-project = null
308308
virtualenvs.options.always-copy = false
@@ -333,7 +333,6 @@ def test_list_must_not_display_sources_from_pyproject_toml(
333333
cache_dir = json.dumps(str(config_cache_dir))
334334
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
335335
expected = f"""cache-dir = {cache_dir}
336-
experimental.system-git-client = false
337336
installer.max-workers = null
338337
installer.no-binary = null
339338
installer.only-binary = null
@@ -342,6 +341,7 @@ def test_list_must_not_display_sources_from_pyproject_toml(
342341
repositories.foo.url = "https://foo.bar/simple/"
343342
requests.max-retries = 0
344343
solver.lazy-wheel = true
344+
system-git-client = false
345345
virtualenvs.create = true
346346
virtualenvs.in-project = null
347347
virtualenvs.options.always-copy = false

tests/integration/test_utils_vcs_git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def setup(config: Config) -> None:
7979

8080
@pytest.fixture
8181
def use_system_git_client(config: Config) -> None:
82-
config.merge({"experimental": {"system-git-client": True}})
82+
config.merge({"system-git-client": True})
8383

8484

8585
@pytest.fixture(scope="module")
@@ -130,7 +130,7 @@ def remote_default_branch(remote_default_ref: bytes) -> str:
130130

131131
# Regression test for https://github.com/python-poetry/poetry/issues/6722
132132
def test_use_system_git_client_from_environment_variables() -> None:
133-
os.environ["POETRY_EXPERIMENTAL_SYSTEM_GIT_CLIENT"] = "true"
133+
os.environ["POETRY_SYSTEM_GIT_CLIENT"] = "true"
134134

135135
assert Git.is_using_legacy_client()
136136

0 commit comments

Comments
 (0)