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

poetry run: deprecate uninstalled entry points #7606

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
simplify code with multi-line strings
  • Loading branch information
wagnerluis1982 authored and radoering committed Apr 5, 2023
commit 82e3a8046812481228774360bdd4e753b26a7a3f
31 changes: 9 additions & 22 deletions src/poetry/console/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,12 @@ def run_script(self, script: str | dict[str, str], args: list[str]) -> int:
return self.env.execute(*cmd)

def _warning_not_installed_script(self, script: str) -> None:
self.line_error(
(
f"Warning: '{script}' is an entry point defined in pyproject.toml,"
" but it's not installed as a script."
" You may get improper `sys.argv[0]`."
),
style="warning",
)
self.line_error("")
self.line_error(
(
"The support to run uninstalled scripts "
"will be removed in a future release."
),
style="warning",
)
self.line_error("")
self.line_error(
"Run `poetry install` to resolve and get rid of this message.",
style="warning",
)
self.line_error("")
message = f"""\
Warning: '{script}' is an entry point defined in pyproject.toml, but it's not \
installed as a script. You may get improper `sys.argv[0]`.

The support to run uninstalled scripts will be removed in a future release.

Run `poetry install` to resolve and get rid of this message.
"""
self.line_error(message, style="warning")