Repository: astral-sh/uv
File: crates/uv/src/settings.rs (Rust)

Code before:
}

impl PipFreezeSettings {
    /// Resolve the [`PipFreezeSettings`] from the CLI and filesystem configuration.
    pub(crate) fn resolve(
        args: PipFreezeArgs,
        filesystem: Option<FilesystemOptions>,
        environment: EnvironmentOptions,
    ) -> Self {
        let PipFreezeArgs {
            exclude_editable,
            exclude,
            strict,
            no_strict,
            python,
            paths,
            system,
            no_system,
            target,
            prefix,
            compat_args: _,
        } = args;

        Self {
            exclude_editable,
            exclude,
            paths,
            settings: PipSettings::combine(
                PipOptions {
                    python: python.and_then(Maybe::into_option),
                    system: flag(system, no_system, "system"),
                    strict: flag(strict, no_strict, "strict"),
                    target,
                    prefix,
                    ..PipOptions::default()
                },
                filesystem,
                environment,
            ),
        }
    }
}

/// The resolved settings to use for a `pip list` invocation.
#[derive(Debug, Clone)]
pub(crate) struct PipListSettings {
    pub(crate) editable: Option<bool>,
    pub(crate) exclude: Vec<PackageName>,
    pub(crate) format: ListFormat,
    pub(crate) outdated: bool,
    pub(crate) settings: PipSettings,

Review comment (suggestion):
transform to hash set here seems to be how I can make it work? `exclude: exclude.into_iter().collect(),`

however, like pinning versions in pip_install test, I'm unsure if other similar cases should be changed, i.e. PipListSettings implements a similar exclude argument which is also currently a Vec.

@zanieb 

Code after:
                    require_hashes: flag(require_hashes, no_require_hashes, "require-hashes"),
                    verify_hashes: flag(verify_hashes, no_verify_hashes, "verify-hashes"),
                    no_build: flag(no_build, build, "build"),
                    no_binary,
                    only_binary,
                    allow_empty_requirements: flag(
                        allow_empty_requirements,
                        no_allow_empty_requirements,
                        "allow-empty-requirements",
                    ),
                    python_version,
                    python_platform,
                    strict: flag(strict, no_strict, "strict"),
                    extra,
                    all_extras: flag(all_extras, no_all_extras, "all-extras"),
                    group: Some(group),
                    torch_backend,
                    ..PipOptions::from(installer)
                },
                filesystem,
                environment,
            ),
        }
    }
}

/// The resolved settings to use for a `pip install` invocation.
#[derive(Debug, Clone)]
pub(crate) struct PipInstallSettings {
    pub(crate) package: Vec<String>,
    pub(crate) requirements: Vec<PathBuf>,
    pub(crate) editables: Vec<String>,
    pub(crate) constraints: Vec<PathBuf>,
    pub(crate) overrides: Vec<PathBuf>,
    pub(crate) excludes: Vec<PathBuf>,
    pub(crate) build_constraints: Vec<PathBuf>,
    pub(crate) dry_run: DryRun,
    pub(crate) constraints_from_workspace: Vec<Requirement>,
    pub(crate) overrides_from_workspace: Vec<Requirement>,
    pub(crate) excludes_from_workspace: Vec<PackageName>,
    pub(crate) build_constraints_from_workspace: Vec<Requirement>,
    pub(crate) modifications: Modifications,
    pub(crate) refresh: Refresh,
    pub(crate) settings: PipSettings,
}

impl PipInstallSettings {
    /// Resolve the [`PipInstallSettings`] from the CLI and filesystem configuration.
    pub(crate) fn resolve(
        args: PipInstallArgs,
        filesystem: Option<FilesystemOptions>,