mirror of https://github.com/astral-sh/uv
## Summary
For a venv created by `virtualenv`, the `pyvenv.cfg` file specifies the
full version string in the `version_info` field:
```
home = /Users/x/.rye/py/cpython@3.12.1/install/bin
implementation = CPython
version_info = 3.12.1.final.0
virtualenv = 20.25.0
include-system-site-packages = false
base-prefix = /Users/x/.rye/py/cpython@3.12.1/install
base-exec-prefix = /Users/x/.rye/py/cpython@3.12.1/install
base-executable = /Users/x/.rye/py/cpython@3.12.1/install/bin/python3
```
The relevant code can be found here:
|
||
|---|---|---|
| .. | ||
| src | ||
| static | ||
| Cargo.toml | ||
| README.md | ||
| benchmark.sh | ||
| compare_in_git.sh | ||
| imasnake.py | ||
| oranda.json | ||
| venv_checker.py | ||
README.md
Gourgeist
Gourgeist is a rust library to create python virtual environments. It also has a CLI.
It currently supports only unix (linux/mac), windows support is missing.
Rust
use camino::Utf8PathBuf;
use gourgeist::{create_venv, get_interpreter_info, parse_python_cli};
let location = cli.path.unwrap_or(Utf8PathBuf::from(".venv"));
let python = parse_python_cli(cli.python)?;
let data = get_interpreter_info(&python)?;
create_venv(&location, &python, &data, cli.bare)?;
CLI
Use python as base for a virtualenv .venv:
gourgeist
Or use custom defaults:
gourgeist -p 3.11 my_env
