Skip to content

Commit

Permalink
feat(config)!: rename experimental.system-git-client to system-git-cl…
Browse files Browse the repository at this point in the history
…ient
  • Loading branch information
finswimmer committed Oct 21, 2024
1 parent 3e5e038 commit 2917d4c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 32 deletions.
34 changes: 18 additions & 16 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,6 @@ Defaults to one of the following directories:
- Windows: `C:\Users\<username>\AppData\Local\pypoetry\Cache`
- Unix: `~/.cache/pypoetry`

### `experimental.system-git-client`

**Type**: `boolean`

**Default**: `false`

**Environment Variable**: `POETRY_EXPERIMENTAL_SYSTEM_GIT_CLIENT`

*Introduced in 1.2.0*

Use system git client backend for git related tasks.

Poetry uses `dulwich` by default for git related tasks to not rely on the availability of a git client.

If you encounter any problems with it, set to `true` to use the system git backend.

### `installer.max-workers`

**Type**: `int`
Expand Down Expand Up @@ -302,6 +286,24 @@ Especially with slow network connections this setting can speed up dependency re
If the cache has already been filled or the server does not support HTTP range requests,
this setting makes no difference.

### `system-git-client`

**Type**: `boolean`

**Default**: `false`

**Environment Variable**: `POETRY_SYSTEM_GIT_CLIENT`

*Renamed to `system-git-client` in 2.0.0*

*Introduced in 1.2.0 as `experimental.system-git-client`*

Use system git client backend for git related tasks.

Poetry uses `dulwich` by default for git related tasks to not rely on the availability of a git client.

If you encounter any problems with it, set to `true` to use the system git backend.

### `virtualenvs.create`

**Type**: `boolean`
Expand Down
2 changes: 1 addition & 1 deletion docs/dependency-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ Poetry 1.2, you may wish to explicitly configure the use of the system git clien
subprocess call.

```bash
poetry config experimental.system-git-client true
poetry config system-git-client true
```

Keep in mind however, that doing so will surface bugs that existed in versions prior to 1.2 which
Expand Down
6 changes: 2 additions & 4 deletions src/poetry/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ class Config:
"prefer-active-python": False,
"prompt": "{project_name}-py{python_version}",
},
"experimental": {
"system-git-client": False,
},
"requests": {
"max-retries": 0,
},
Expand All @@ -134,6 +131,7 @@ class Config:
"solver": {
"lazy-wheel": True,
},
"system-git-client": False,
"keyring": {
"enabled": True,
},
Expand Down Expand Up @@ -299,9 +297,9 @@ def _get_normalizer(name: str) -> Callable[[str], Any]:
"virtualenvs.options.no-pip",
"virtualenvs.options.system-site-packages",
"virtualenvs.options.prefer-active-python",
"experimental.system-git-client",
"installer.parallel",
"solver.lazy-wheel",
"system-git-client",
"keyring.enabled",
}:
return boolean_normalizer
Expand Down
4 changes: 1 addition & 3 deletions src/poetry/vcs/git/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,7 @@ def _get_submodules(cls, repo: Repo) -> list[SubmoduleInfo]:
def is_using_legacy_client() -> bool:
from poetry.config.config import Config

legacy_client: bool = Config.create().get(
"experimental.system-git-client", False
)
legacy_client: bool = Config.create().get("system-git-client", False)
return legacy_client

@staticmethod
Expand Down
12 changes: 6 additions & 6 deletions tests/console/commands/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def test_list_displays_default_value_if_not_set(
cache_dir = json.dumps(str(config_cache_dir))
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
expected = f"""cache-dir = {cache_dir}
experimental.system-git-client = false
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
keyring.enabled = true
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
Expand All @@ -85,14 +85,14 @@ def test_list_displays_set_get_setting(
cache_dir = json.dumps(str(config_cache_dir))
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
expected = f"""cache-dir = {cache_dir}
experimental.system-git-client = false
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
keyring.enabled = true
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = false
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
Expand Down Expand Up @@ -137,14 +137,14 @@ def test_unset_setting(
cache_dir = json.dumps(str(config_cache_dir))
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
expected = f"""cache-dir = {cache_dir}
experimental.system-git-client = false
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
keyring.enabled = true
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
Expand All @@ -167,14 +167,14 @@ def test_unset_repo_setting(
cache_dir = json.dumps(str(config_cache_dir))
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
expected = f"""cache-dir = {cache_dir}
experimental.system-git-client = false
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
keyring.enabled = true
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
Expand Down Expand Up @@ -295,14 +295,14 @@ def test_list_displays_set_get_local_setting(
cache_dir = json.dumps(str(config_cache_dir))
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
expected = f"""cache-dir = {cache_dir}
experimental.system-git-client = false
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
keyring.enabled = true
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = false
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
Expand Down Expand Up @@ -333,7 +333,6 @@ def test_list_must_not_display_sources_from_pyproject_toml(
cache_dir = json.dumps(str(config_cache_dir))
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
expected = f"""cache-dir = {cache_dir}
experimental.system-git-client = false
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
Expand All @@ -342,6 +341,7 @@ def test_list_must_not_display_sources_from_pyproject_toml(
repositories.foo.url = "https://foo.bar/simple/"
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_utils_vcs_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def setup(config: Config) -> None:

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


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

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

assert Git.is_using_legacy_client()

Expand Down

0 comments on commit 2917d4c

Please sign in to comment.