mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Unify python interpreter abstractions (#178)
Previously, we had two python interpreter metadata structs, one in gourgeist and one in puffin. Both would spawn a subprocess to query overlapping metadata and both would appear in the cli crate, if you weren't careful you could even have to different base interpreters at once. This change unifies this to one set of metadata, queried and cached once. Another effect of this crate is proper separation of python interpreter and venv. A base interpreter (such as `/usr/bin/python/`, but also pyenv and conda installed python) has a set of metadata. A venv has a root and inherits the base python metadata except for `sys.prefix`, which unlike `sys.base_prefix`, gets set to the venv root. From the root and the interpreter info we can compute the paths inside the venv. We can reuse the interpreter info of the base interpreter when creating a venv without having to query the newly created `python`.
This commit is contained in:
parent
1fbe328257
commit
889f6173cc
37 changed files with 515 additions and 584 deletions
|
@ -1,7 +1,6 @@
|
|||
# Generated by `stubgen -p pep440_rs`
|
||||
from typing import Any, ClassVar
|
||||
|
||||
|
||||
class Version:
|
||||
dev: Any
|
||||
epoch: Any
|
||||
|
@ -24,7 +23,6 @@ class Version:
|
|||
def __lt__(self, other) -> Any: ...
|
||||
def __ne__(self, other) -> Any: ...
|
||||
|
||||
|
||||
class VersionSpecifier:
|
||||
__hash__: ClassVar[None] = ...
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue