Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate "installer.modern-installation false" #8988

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ def __init__(
self._use_modern_installation = config.get(
"installer.modern-installation", True
)
if not self._use_modern_installation:
self._io.write_line(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing: Shouldn't we use write_error_line() for warnings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some do, some don't: if there is a rule then it is not consistently followed. The stdout from these commands is not really suitable for parsing anyway so I don't suppose it much matters.

I'm not at the right computer to do anything about this now, feel free do any of tweak it yourself / ask me to do it later / not bother.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are probably right that it is inconsistent and does not matter.

Interestingly enough, I see random test failures on Windows if I write the warning to error out. It's always a PermissionError in

shutil.rmtree(venv.path)

but in different tests, for example one or two of

tests/console/commands/self/test_add_plugins.py::test_add_with_constraint
tests/console/commands/self/test_add_plugins.py::test_add_with_git_constraint_with_extras
tests/console/commands/self/test_remove_plugins.py::test_remove_installed_package
tests/console/commands/self/test_remove_plugins.py::test_remove_installed_package_dry_run
tests/installation/test_executor.py::test_executor_should_write_pep610_url_references_for_editable_git

Maybe, a reason to just keep it as is, even if this is a bit unsettling...

"<warning>Warning: Setting `installer.modern-installation` to `false` "
"is deprecated.</>"
)
self._io.write_line(
"<warning>The pip-based installer will be removed in a future release.</>"
)
self._io.write_line(
"<warning>See https://github.com/python-poetry/poetry/issues/8987.</>"
)

if parallel is None:
parallel = config.get("installer.parallel", True)
Expand Down
6 changes: 6 additions & 0 deletions tests/installation/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,12 @@ def test_executor_fallback_on_poetry_create_error_without_wheel_installer(
})

executor = Executor(env, pool, config, io)
warning_lines = io.fetch_output().splitlines()
assert warning_lines == [
"Warning: Setting `installer.modern-installation` to `false` is deprecated.",
"The pip-based installer will be removed in a future release.",
"See https://github.com/python-poetry/poetry/issues/8987.",
]

directory_package = Package(
"simple-project",
Expand Down
Loading