Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-lacroix committed Mar 17, 2024
1 parent e30d6de commit 1cf93e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/flask-hello-world-pyproject/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ channels = ["conda-forge"]
platforms = ["linux-64"]

[tool.pixi.tasks]
start = "python -m flask run --port=5050"
start = "python -m flask run --port=5050"
13 changes: 5 additions & 8 deletions src/project/manifest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,14 +933,11 @@ fn req_to_conda_name(requirement: &Requirement) -> Result<PackageName, Requireme
let _guard = handle.enter();
let map = futures::executor::block_on(conda_pypi_name_mapping())
.map_err(|_| RequirementConversionError::MappingError)?;
let pypi_to_conda: HashMap<String, String> = map
.into_iter()
.map(|(k, v)| (v.clone(), k.clone()))
.collect();
let pypi_to_conda: HashMap<String, String> =
map.iter().map(|(k, v)| (v.clone(), k.clone())).collect();
let name: PackageName = pypi_to_conda
.get(&pypi_name)
.or(Some(&pypi_name))
.unwrap()
.unwrap_or(&pypi_name)
.try_into()?;
Ok(name)
}
Expand Down Expand Up @@ -997,7 +994,7 @@ impl From<PyProjectManifest> for ProjectManifest {
.project
.as_ref()
.and_then(|p| p.requires_python.as_ref())
.and_then(|v| Some(VersionOrUrl::VersionSpecifier(v.clone())));
.map(|v| VersionOrUrl::VersionSpecifier(v.clone()));
let python_req = Requirement {
name: pep508_rs::PackageName::from_str("python").unwrap(),
version_or_url: pythonspec,
Expand All @@ -1015,7 +1012,7 @@ impl From<PyProjectManifest> for ProjectManifest {
.for_opt_target_or_default_mut(None);
for requirement in requirements {
// Skip requirement if it is already a Pypi Dependency of the default feature of the default target
match PyPiPackageName::from_str(&requirement.name.to_string().as_str()) {
match PyPiPackageName::from_str(requirement.name.to_string().as_str()) {
Ok(pypi_name) => {
if target
.pypi_dependencies
Expand Down

0 comments on commit 1cf93e6

Please sign in to comment.