-
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
poc: python installation management commands (experimental) #10112
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request introduces experimental Python installation management commands to Poetry, leveraging Python Standalone Builds and pbs-installer. It allows users to install, list, and remove Python versions, making them available for project virtual environment creation. The implementation focuses on integrating these tools with Poetry's existing environment management capabilities. Sequence diagram for Python installation processsequenceDiagram
participant User
participant PythonInstallCmd
participant PBSInstaller
participant PoetryPythonPathProvider
User->>PythonInstallCmd: poetry python install <version>
PythonInstallCmd->>PBSInstaller: get_download_link(version)
PBSInstaller-->>PythonInstallCmd: download link
PythonInstallCmd->>PBSInstaller: install(version, path)
PBSInstaller-->>PythonInstallCmd: installation complete
PythonInstallCmd->>PoetryPythonPathProvider: test installation
PoetryPythonPathProvider-->>PythonInstallCmd: test results
PythonInstallCmd-->>User: installation status
Class diagram for Python management classesclassDiagram
class Python {
-_python: findpython.PythonVersion
+executable: Path
+version: Version
+patch_version: Version
+minor_version: Version
+find_all()
+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 PoetryPythonPathProvider {
+installation_dir(version, implementation)
+_make_bin_paths(base)
+installation_bin_paths(version, implementation)
+create()
}
class Config {
+virtualenvs_path: Path
+python_installation_dir: Path
+installer_max_workers: int
}
Python --* PoetryPythonPathProvider
note for Python "Refactored to use findpython"
note for PoetryPythonPathProvider "New provider for Python paths"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
37a8ea1
to
0856383
Compare
0856383
to
3d4aa3f
Compare
This is a highly experimental implementation of Python installation management features for Poetry. That said, more testers the merrier. Feedback around functionality and output ux are welcome. The intent of the PR, if made ready would be to introduce the feature as an experimental feature meeting the following basic requirements:
Depends-on: #10097 - While, this is not a hard dependency, having
findpython
in the mix definitely makes discovery easier. There will have to be changes once that PR is finalized.Resolves: #9905
Testing Changes
Using pipx
Using a container (podman | docker)
Summary by Sourcery
Add commands to manage Python installations using standalone builds. Install, list, and remove Python versions using
poetry python install
,poetry python list
, andpoetry python remove
.New Features:
pbs-installer
.Tests: