Use the right marker for the implementation field of pyvenv.cfg (#1785)

## Summary

The generated `pyvenv.cfg` file hardcodes `implementation = CPython`
even for PyPy venvs, created with `uv venv venv --python pypy3.10`, for
example.

```ini
home = /path/to/.pyenv/versions/pypy3.10-7.3.15/bin
implementation = CPython
version_info = 3.10
gourgeist = 0.0.4
include-system-site-packages = false
base-prefix = /path/to/.pyenv/versions/pypy3.10-7.3.15
base-exec-prefix = /path/to/.pyenv/versions/pypy3.10-7.3.15
base-executable = /path/to/.pyenv/versions/pypy3.10-7.3.15/bin/pypy3.10
```

## Test Plan

Manually verified that `pyvenv.cfg` now contains `implementation =
PyPy`. I can try refactoring `create_bare_venv` to make it more easily
testable, though.
This commit is contained in:
Edgar Ramírez Mondragón 2024-02-20 18:09:53 -06:00 committed by GitHub
parent f13d0adbcd
commit 2e60c1d734
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -220,7 +220,10 @@ pub fn create_bare_venv(
};
let pyvenv_cfg_data = &[
("home", python_home),
("implementation", "CPython".to_string()),
(
"implementation",
interpreter.markers().platform_python_implementation.clone(),
),
(
"version_info",
interpreter.markers().python_version.string.clone(),