-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix(console): self update didn't recognize Poetry's environment #9995
Conversation
Reviewer's Guide by SourceryThis pull request fixes an issue where the Sequence diagram for Poetry self update command flowsequenceDiagram
participant User as User
participant Update as UpdateCommand
participant Add as AddCommand
participant Env as Environment
User->>Update: poetry self update
Update->>Add: create add command
Update->>Add: set_env(env)
Update->>Add: set_poetry(poetry)
Note right of Add: New step added to fix environment recognition
Update->>Add: configure installer
Add->>Env: install poetry package
Class diagram showing UpdateCommand and AddCommand relationshipclassDiagram
class UpdateCommand {
-env: Environment
-poetry: Poetry
+_system_project_handle(): int
}
class AddCommand {
-env: Environment
-poetry: Poetry
+set_env(env: Environment)
+set_poetry(poetry: Poetry)
}
UpdateCommand ..> AddCommand : uses
note for AddCommand "Now properly configured with Poetry instance"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @finswimmer - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please add a test case to verify the self-update command works correctly with Poetry's environment to prevent future regressions.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
d0f4d18
to
9d84ee3
Compare
Verified that the changes work as follows. podman run --rm -i --entrypoint bash python:latest <<EOF
export PATH="\${HOME}/.local/bin:\${PATH}"
set -xe
curl -sSL https://install.python-poetry.org | python3 -
poetry self update || :
curl -sSL https://install.python-poetry.org | POETRY_UNINSTALL=1 python3 -
curl -sSL https://install.python-poetry.org | python3 - --git 'https://github.com/python-poetry/poetry.git@refs/pull/9995/head'
poetry self update
EOF console.output
+ curl -sSL https://install.python-poetry.org
+ python3 -
Retrieving Poetry metadata
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
/root/.local/bin
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
Installing Poetry (2.0.0)
Installing Poetry (2.0.0): Creating environment
Installing Poetry (2.0.0): Installing Poetry
Installing Poetry (2.0.0): Creating script
Installing Poetry (2.0.0): Done
Poetry (2.0.0) is installed now. Great!
You can test that everything is set up by executing:
`poetry --version`
+ poetry self update
Updating Poetry version ...
Poetry could not find a pyproject.toml file in / or its parents
+ :
+ curl -sSL https://install.python-poetry.org
+ POETRY_UNINSTALL=1
+ python3 -
Removing Poetry (2.0.0)
+ curl -sSL https://install.python-poetry.org
+ python3 - --git https://github.com/python-poetry/poetry.git@refs/pull/9995/head
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
/root/.local/bin
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
Installing Poetry (https://github.com/python-poetry/poetry.git@refs/pull/9995/head)
Installing Poetry (https://github.com/python-poetry/poetry.git@refs/pull/9995/head): Creating environment
Installing Poetry (https://github.com/python-poetry/poetry.git@refs/pull/9995/head): Installing Poetry
Installing Poetry (https://github.com/python-poetry/poetry.git@refs/pull/9995/head): Creating script
Installing Poetry (https://github.com/python-poetry/poetry.git@refs/pull/9995/head): Done
Poetry (https://github.com/python-poetry/poetry.git@refs/pull/9995/head) is installed now. Great!
You can test that everything is set up by executing:
`poetry --version`
+ poetry self update
Updating Poetry version ...
Using version ^2.0.0 for poetry
Updating dependencies
Resolving dependencies...
Package operations: 0 installs, 1 update, 0 removals
- Updating poetry (2.0.0 9d84ee3 -> 2.0.0)
Writing lock file |
Pull Request Check List
Resolves: #9964
Summary by Sourcery
Bug Fixes:
self update
would not recognize Poetry's environment, causing it to fail when adding a package.