-
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
feat(python): use findpython #10097
feat(python): use findpython #10097
Conversation
Reviewer's Guide by SourceryThis pull request introduces the usage of the Sequence diagram for Python version discovery processsequenceDiagram
participant Client
participant Python
participant FindPython
participant ShutilWhichProvider
Client->>Python: get_preferred_python(config, io)
alt use-poetry-python is false
Python->>Python: get_active_python()
Python->>ShutilWhichProvider: find_pythons()
ShutilWhichProvider-->>Python: python_list
alt python found
Python-->>Client: active_python
else no python found
Python->>FindPython: find('python')
FindPython-->>Python: python_version
Python-->>Client: python_instance
end
else use poetry python
Python->>Python: get_system_python()
Python-->>Client: system_python
end
Class diagram for Python version management changesclassDiagram
class Python {
-_python: PythonVersion
+executable: Path
+version: Version
+patch_version: Version
+minor_version: Version
+get_active_python()
+from_executable(path)
+get_system_python()
+get_by_name(python_name)
+get_preferred_python(config, io)
+get_compatible_python(poetry, io)
}
class ShutilWhichPythonProvider {
+create()
+find_pythons()
}
class PythonVersionError {
}
class PythonVersionNotFoundError {
+__init__(expected: str)
}
class NoCompatiblePythonVersionError {
+__init__(expected: str, given: str)
}
class InvalidCurrentPythonVersionError {
+__init__(expected: str, given: str)
}
PythonVersionNotFoundError --|> PythonVersionError
NoCompatiblePythonVersionError --|> PythonVersionError
InvalidCurrentPythonVersionError --|> PythonVersionError
ShutilWhichPythonProvider --|> BaseProvider
note for Python "Uses findpython library for version discovery"
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 @abn - I've reviewed your changes and they look great!
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.
1a92276
to
c5081fc
Compare
@sourcery-ai review |
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 @abn - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 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.
e4fe342
to
28828ae
Compare
28828ae
to
bb2665b
Compare
651c337
to
5e2e702
Compare
@sourcery-ai review |
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 @abn - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 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.
5e2e702
to
44fd55f
Compare
c9d82b1
to
efb8bbf
Compare
deb59d9
to
7799411
Compare
@sourcery-ai review |
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 @abn - I've reviewed your changes and they look great!
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.
7799411
to
2bd160c
Compare
2bd160c
to
54a0a13
Compare
With this change Poetry will use findpython for Python version discovery. This helps remove Poetry's own custom "best effort" Python version discovery and hopefully also resolve a lot of issues related to the discovery of available Python versions in a given environment.
This change largely focuses on the Python Manager and not the Environment Manager. The latter could also be improved once this has landed.
Testing
Using pipx
Using a container (podman | docker)
Summary by Sourcery
Tests:
Summary by Sourcery
Tests: