Repository: astral-sh/uv
File: crates/uv-build-backend/src/metadata.rs (Rust)

Code before:
                let mut license_files = Vec::new();
                let mut license_glob_patterns = Vec::new();
                let mut license_globs_parsed = Vec::new();

                for license_glob in license_globs {
                    let pep639_glob =
                        PortableGlobParser::Pep639
                            .parse(license_glob)
                            .map_err(|err| Error::PortableGlob {
                                field: license_glob.to_owned(),
                                source: err,
                            })?;
                    license_globs_parsed.push(pep639_glob);
                    license_glob_patterns.push(license_glob.clone());
                }

                let mut license_globs_matched = vec![false; license_glob_patterns.len()];

                let license_glob_matchers = license_globs_parsed
                    .iter()
                    .map(Glob::compile_matcher)
                    .collect::<Vec<_>>();

                let license_glob_filter = GlobDirFilter::from_globs(&license_globs_parsed)
                    .map_err(|err| Error::GlobSetTooLarge {
                        field: "tool.uv.build-backend.source-include".to_string(),
                        source: err,
                    })?;

                for entry in WalkDir::new(root)
                    .sort_by_file_name()
                    .into_iter()
                    .filter_entry(|entry| {
                        license_glob_filter.match_directory(
                            entry
                                .path()
                                .strip_prefix(root)
                                .expect("walkdir starts with root"),
                        )
                    })
                {
                    let entry = entry.map_err(|err| Error::WalkDir {
                        root: root.to_path_buf(),
                        err,
                    })?;

                    let relative = entry
                        .path()
                        .strip_prefix(root)
                        .expect("walkdir starts with root");


Review comment (bug):
(This was already wrong before)

```suggestion
                        field: "project.license-files".to_string(),
```

Code after:

        let extras = self
            .project
            .optional_dependencies
            .iter()
            .flat_map(|optional_dependencies| optional_dependencies.keys())
            .collect::<Vec<_>>();

        let requires_dist =
            self.project
                .dependencies
                .iter()
                .flatten()
                .cloned()
                .chain(self.project.optional_dependencies.iter().flat_map(
                    |optional_dependencies| {
                        optional_dependencies
                            .iter()
                            .flat_map(|(extra, requirements)| {
                                requirements.iter().cloned().map(|mut requirement| {
                                    requirement.marker.and(MarkerTree::expression(
                                        MarkerExpression::Extra {
                                            operator: ExtraOperator::Equal,
                                            name: MarkerValueExtra::Extra(extra.clone()),
                                        },
                                    ));
                                    requirement
                                })
                            })
                    },
                ))
                .collect::<Vec<_>>();

        Ok(Metadata23 {
            metadata_version: metadata_version.to_string(),
            name: self.project.name.given.clone(),
            version: self.project.version.to_string(),
            // Not supported.
            platforms: vec![],
            // Not supported.
            supported_platforms: vec![],
            summary,
            description,
            description_content_type,
            keywords: self
                .project
                .keywords
                .as_ref()
                .map(|keywords| keywords.join(",")),
            home_page: None,
            download_url: None,