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: return correct channel urls from MatchSpec.channel.base_url #885

Merged
merged 6 commits into from
Oct 4, 2024

Conversation

cisaacstern
Copy link
Contributor

Description

This PR adds the tests described in #884.

It also provides a (reference) fix in MatchSpec.channel. I say "reference" because I imagine the maintainers may prefer to handle this in some other way (perhaps by pushing the url parsing I've done in Python here to the Rust layer?), in which case I will certainly have no objection to my "fix" being discarded. But I provide it nonetheless to indicate the general shape of a possible solution.

Thanks all! Happy to contribute to this further if I am able.

@wolfv
Copy link
Contributor

wolfv commented Oct 2, 2024

Thanks for the fix! It looks pretty good to me, but I am wondering if there might be an easier way. @baszalmstra recently refactored some parts of this so on the Rust side we have distinct types for channels from (relative) Path, URL, or file URL. Maybe we can expose that in a clean way and have a function on the Rust side that returns the right thing.

But you have clearly identified a nice bug!

I'll wait with merging until we hear from Bas.

@baszalmstra
Copy link
Collaborator

Hey! Thanks for this fix! I think we should definitely fix this completely on the rust side. Ill give that a try, do you mind if I amend your PR?

@cisaacstern
Copy link
Contributor Author

do you mind if I amend your PR?

Yes of course please do, however you see fit!

@baszalmstra
Copy link
Collaborator

I modified you code slighty, the rust side already returned everything you needed we just had to convert it properly to python. Your tests seem to succeed with these changes. Thanks for adding those!

@baszalmstra baszalmstra changed the title test: return correct channel urls from MatchSpec.channel.base_url fix: return correct channel urls from MatchSpec.channel.base_url Oct 4, 2024
@baszalmstra baszalmstra merged commit ba30fa9 into conda:main Oct 4, 2024
3 checks passed
@cisaacstern
Copy link
Contributor Author

Amazing, tysm!

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.

MatchSpec.channel.base_url always returns conda forge URL (even if ._match_spec.channel has another url)
3 participants