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

Add CondaURL #2805

Merged
merged 17 commits into from
Sep 7, 2023
Merged

Add CondaURL #2805

merged 17 commits into from
Sep 7, 2023

Conversation

AntoinePrv
Copy link
Member

No description provided.

@AntoinePrv AntoinePrv force-pushed the conda-url branch 7 times, most recently from 663f2ba to 6e3ff05 Compare September 6, 2023 12:21
@AntoinePrv AntoinePrv marked this pull request as ready for review September 7, 2023 12:35
return static_cast<std::size_t>(Platform::count_);
}

constexpr auto known_platforms() -> std::array<Platform, known_platforms_count()>;
Copy link
Member

Choose a reason for hiding this comment

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

There is already the notion of known_platforms in channel.hpp, it would make sense to rebind it to your changes (or replace its usage with your), to avoid duplication.

Copy link
Member Author

Choose a reason for hiding this comment

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

The point is to use the known_platform from this file from now, on. It's tested , modular, backed by an enum, and constexpr.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I meant to use the code from this PR in the channel file; but this can be done in a dedicated PR.

libmamba/include/mamba/specs/url.hpp Outdated Show resolved Hide resolved
@@ -57,99 +61,156 @@ namespace mamba::util
[[nodiscard]] auto scheme() const -> const std::string&;

/** Set a non-empty scheme. */
auto set_scheme(std::string_view scheme) -> URL&;
void set_scheme(std::string_view scheme);
Copy link
Member

Choose a reason for hiding this comment

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

It's annoying to lose the chained construction of the URL. I wonder if it could make sense to use a CRTP here, or even to merge the CondaURL and the URL classes? (do we have usages of URL where we don't want to have access to the additiona methods form CondaURL?

Copy link
Member

Choose a reason for hiding this comment

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

After discussion in person:

  • having two distinct abstractions for URL and CondaURL is better thatn a single class; it helps to keep isolation of the dependency on CURL
  • CRTP is a bit of overkill just for keeping the chained construction syntax.

@AntoinePrv AntoinePrv merged commit a527511 into mamba-org:main Sep 7, 2023
23 checks passed
@AntoinePrv AntoinePrv deleted the conda-url branch September 7, 2023 14:59
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.

None yet

2 participants