Skip to content
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

feat: move uv options into context #911

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/install_pypi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use uv_installer::{Downloader, SitePackages};
use uv_interpreter::{Interpreter, PythonEnvironment};
use uv_normalize::PackageName;

use uv_traits::{ConfigSettings, NoBinary, NoBuild, SetupPyStrategy};
use uv_traits::{ConfigSettings, SetupPyStrategy};

type CombinedPypiPackageData = (PypiPackageData, PypiPackageEnvironmentData);

Expand Down Expand Up @@ -351,10 +351,6 @@ pub async fn update_python_distributions(
FlatIndex::from_entries(entries, &tags)
};

// Track in-flight downloads, builds, etc., across resolutions.
let no_build = NoBuild::None;
let no_binary = NoBinary::None;

let in_memory_index = InMemoryIndex::default();
let config_settings = ConfigSettings::default();

Expand All @@ -376,8 +372,8 @@ pub async fn update_python_distributions(
&uv_context.in_flight,
SetupPyStrategy::default(),
&config_settings,
&no_build,
&no_binary,
&uv_context.no_build,
&uv_context.no_binary,
)
.with_build_extra_env_vars(environment_variables.iter());

Expand Down
8 changes: 6 additions & 2 deletions src/lock_file/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ pub struct UvResolutionContext {
pub registry_client: Arc<RegistryClient>,
pub in_flight: Arc<InFlight>,
pub index_locations: Arc<IndexLocations>,
pub no_build: NoBuild,
pub no_binary: NoBinary,
}

impl UvResolutionContext {
Expand All @@ -83,6 +85,8 @@ impl UvResolutionContext {
registry_client,
in_flight,
index_locations,
no_build: NoBuild::None,
no_binary: NoBinary::None,
})
}
}
Expand Down Expand Up @@ -304,8 +308,8 @@ pub async fn resolve_pypi(
&context.in_flight,
SetupPyStrategy::default(),
&config_settings,
&NoBuild::None,
&NoBinary::None,
&context.no_build,
&context.no_binary,
)
.with_options(options)
.with_build_extra_env_vars(env_variables.iter());
Expand Down
Loading