pep508: un-export fields for MarkerEnvironment

We now use the getters and setters everywhere.

There were some places where we wanted to build a `MarkerEnvironment`
out of whole cloth, usually in tests. To facilitate those use cases, we
add a `MarkerEnvironmentBuilder` that provides a convenient constructor.
It's basically like a `MarkerEnvironment::new`, but with named
parameters. That's useful here because there are so many fields (and
they many have the same type).
This commit is contained in:
Andrew Gallant 2024-05-08 19:01:44 -04:00 committed by Andrew Gallant
parent be12cfb2b8
commit 7d67b7bb49
11 changed files with 198 additions and 169 deletions

View file

@ -235,12 +235,15 @@ pub fn create_bare_venv(
),
(
"implementation".to_string(),
interpreter.markers().platform_python_implementation.clone(),
interpreter
.markers()
.platform_python_implementation()
.to_string(),
),
("uv".to_string(), version().to_string()),
(
"version_info".to_string(),
interpreter.markers().python_full_version.string.clone(),
interpreter.markers().python_full_version().string.clone(),
),
(
"include-system-site-packages".to_string(),