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

fix: using file url as mapping #1930

Merged
merged 10 commits into from
Sep 2, 2024

Conversation

nichmor
Copy link
Contributor

@nichmor nichmor commented Aug 27, 2024

This fixes the issue reported by our user : https://discord.com/channels/1082332781146800168/1276948298330275922/1276948298330275922

when using this mapping setup :

[tool.pixi.project.conda-pypi-map]
conda-forge = "file:///path/to/parselmouth/conda-forge.json"

pixi will error out because we don't understand file url scheme.

  × failed to download pypi mapping from file:///path/to/parselmouth/conda-forge.json location
  ├─▶ builder error for url (file:///path/to/parselmouth/conda-forge.json)
  ╰─▶ URL scheme is not allowed

This PR aims to fix it.

@@ -45,6 +47,21 @@ where
Ok(mapping_by_name)
}

pub fn fetch_mapping_from_path<T: DeserializeOwned, P: AsRef<Path>>(path: &P) -> miette::Result<T> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the name of the function I would expect this to return a mapping but instead it returns anything that is deserializable. Imo we can just remove the generics.

@ruben-arts ruben-arts enabled auto-merge (squash) August 28, 2024 07:36
@ruben-arts
Copy link
Contributor

@nichmor Can you fix the test

@ruben-arts ruben-arts merged commit 6fbb610 into prefix-dev:main Sep 2, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants