Skip to content

Commit

Permalink
Complete the removal of poetry-export
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed May 25, 2024
1 parent 4fee994 commit 0e974c9
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 82 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/.tests-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ jobs:
echo version=${PLUGIN_VERSION} >> $GITHUB_OUTPUT
id: poetry-plugin-export-version

- run: poetry run pip list --format json | jq -r '.[] | "\(.name)=\(.version)"' >> $GITHUB_OUTPUT
id: package-versions

- name: Check out poetry-plugin-export
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
Expand Down
12 changes: 2 additions & 10 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -780,17 +780,9 @@ This command exports the lock file to other formats.
poetry export -f requirements.txt --output requirements.txt
```

{{% warning %}}
This command is provided by the [Export Poetry Plugin](https://github.com/python-poetry/poetry-plugin-export).
In a future version of Poetry this plugin will not be installed by default anymore.
In order to avoid a breaking change and make your automation forward-compatible,
please install poetry-plugin-export explicitly.
See [Using plugins]({{< relref "plugins#using-plugins" >}}) for details on how to install a plugin.
{{% /warning %}}

{{% note %}}
This command is also available as a pre-commit hook.
See [pre-commit hooks]({{< relref "pre-commit-hooks#poetry-export" >}}) for more information.
This command is provided by the [Export Poetry Plugin](https://github.com/python-poetry/poetry-plugin-export)
and is also available as a pre-commit hook. See [pre-commit hooks]({{< relref "pre-commit-hooks#poetry-export" >}}) for more information.
{{% /note %}}

{{% note %}}
Expand Down
4 changes: 0 additions & 4 deletions src/poetry/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ class Config:
"solver": {
"lazy-wheel": True,
},
"warnings": {
"export": True,
},
"keyring": {
"enabled": True,
},
Expand Down Expand Up @@ -310,7 +307,6 @@ def _get_normalizer(name: str) -> Callable[[str], Any]:
"installer.modern-installation",
"installer.parallel",
"solver.lazy-wheel",
"warnings.export",
"keyring.enabled",
}:
return boolean_normalizer
Expand Down
6 changes: 0 additions & 6 deletions src/poetry/console/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,6 @@ def _load_plugins(self, io: IO | None = None) -> None:
manager.load_plugins()
manager.activate(self)

# We have to override the command from poetry-plugin-export
# with the wrapper.
if self.command_loader.has("export"):
del self.command_loader._factories["export"]
self.command_loader._factories["export"] = load_command("export")

self._plugins_loaded = True

@property
Expand Down
1 change: 0 additions & 1 deletion src/poetry/console/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def unique_config_values(self) -> dict[str, tuple[Any, Any]]:
PackageFilterPolicy.normalize,
),
"solver.lazy-wheel": (boolean_validator, boolean_normalizer),
"warnings.export": (boolean_validator, boolean_normalizer),
"keyring.enabled": (boolean_validator, boolean_normalizer),
}

Expand Down
21 changes: 0 additions & 21 deletions src/poetry/console/commands/export.py

This file was deleted.

6 changes: 0 additions & 6 deletions tests/console/commands/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def test_list_displays_default_value_if_not_set(
virtualenvs.path = {venv_path} # {config_cache_dir / 'virtualenvs'}
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
warnings.export = true
"""

assert tester.io.fetch_output() == expected
Expand Down Expand Up @@ -104,7 +103,6 @@ def test_list_displays_set_get_setting(
virtualenvs.path = {venv_path} # {config_cache_dir / 'virtualenvs'}
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
warnings.export = true
"""

assert config.set_config_source.call_count == 0 # type: ignore[attr-defined]
Expand Down Expand Up @@ -158,7 +156,6 @@ def test_unset_setting(
virtualenvs.path = {venv_path} # {config_cache_dir / 'virtualenvs'}
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
warnings.export = true
"""
assert config.set_config_source.call_count == 0 # type: ignore[attr-defined]
assert tester.io.fetch_output() == expected
Expand Down Expand Up @@ -190,7 +187,6 @@ def test_unset_repo_setting(
virtualenvs.path = {venv_path} # {config_cache_dir / 'virtualenvs'}
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
warnings.export = true
"""
assert config.set_config_source.call_count == 0 # type: ignore[attr-defined]
assert tester.io.fetch_output() == expected
Expand Down Expand Up @@ -320,7 +316,6 @@ def test_list_displays_set_get_local_setting(
virtualenvs.path = {venv_path} # {config_cache_dir / 'virtualenvs'}
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
warnings.export = true
"""

assert config.set_config_source.call_count == 1 # type: ignore[attr-defined]
Expand Down Expand Up @@ -361,7 +356,6 @@ def test_list_must_not_display_sources_from_pyproject_toml(
virtualenvs.path = {venv_path} # {config_cache_dir / 'virtualenvs'}
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
warnings.export = true
"""

assert tester.io.fetch_output() == expected
Expand Down
31 changes: 0 additions & 31 deletions tests/console/commands/test_export.py

This file was deleted.

0 comments on commit 0e974c9

Please sign in to comment.