Skip to content

Commit

Permalink
Remove Channel::name
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Nov 6, 2023
1 parent e47f8c2 commit 4898396
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
3 changes: 0 additions & 3 deletions libmamba/include/mamba/core/channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace mamba
~Channel();

const std::string& location() const;
const std::string& name() const;
const std::string& canonical_name() const;
const util::flat_set<std::string>& platforms() const;
const specs::CondaURL& url() const;
Expand All @@ -60,14 +59,12 @@ namespace mamba
Channel(
specs::CondaURL url,
std::string location,
std::string name,
std::string canonical_name,
util::flat_set<std::string> platforms = {}
);

specs::CondaURL m_url;
std::string m_location;
std::string m_name;
std::string m_canonical_name;
util::flat_set<std::string> m_platforms;

Expand Down
21 changes: 1 addition & 20 deletions libmamba/src/core/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "mamba/core/channel.hpp"
#include "mamba/core/context.hpp"
#include "mamba/core/environment.hpp"
#include "mamba/specs/channel_spec.hpp"
#include "mamba/specs/conda_url.hpp"
#include "mamba/util/path_manip.hpp"
Expand All @@ -30,8 +29,6 @@ namespace mamba
"None",
"",
":///<unknown>" };

const char LOCAL_CHANNELS_NAME[] = "local";
}

std::vector<std::string> get_known_platforms()
Expand All @@ -47,13 +44,11 @@ namespace mamba
Channel::Channel(
specs::CondaURL url,
std::string location,
std::string name,
std::string canonical_name,
util::flat_set<std::string> platforms
)
: m_url(std::move(url))
, m_location(std::move(location))
, m_name(std::move(name))
, m_canonical_name(std::move(canonical_name))
, m_platforms(std::move(platforms))
{
Expand All @@ -71,11 +66,6 @@ namespace mamba
return m_location;
}

const std::string& Channel::name() const
{
return m_name;
}

const util::flat_set<std::string>& Channel::platforms() const
{
return m_platforms;
Expand Down Expand Up @@ -233,7 +223,6 @@ namespace mamba
return Channel(
/* url= */ std::move(uri),
/* location= */ chan.url().pretty_str(specs::CondaURL::StripScheme::yes),
/* name= */ std::string(util::rstrip(parent.value_or(""), '/')),
/* canonical_name= */ std::string(canonical_name)
);
}
Expand All @@ -245,7 +234,6 @@ namespace mamba
return Channel(
/* url= */ std::move(uri),
/* location= */ ca.pretty_str(specs::CondaURL::StripScheme::yes),
/* name= */ std::string(name),
/* canonical_name= */ std::string(name)
);
}
Expand All @@ -254,7 +242,6 @@ namespace mamba
return Channel(
/* url= */ std::move(uri),
/* location= */ std::string(util::rstrip(parent.value_or(""), '/')),
/* name= */ std::string(util::rstrip(current, '/')),
/* canonical_name= */ std::move(canonical_name)
);
}
Expand Down Expand Up @@ -299,7 +286,6 @@ namespace mamba
return Channel(
/* url= */ std::move(url),
/* location= */ std::move(location),
/* name= */ std::move(name),
/* canonical_name= */ std::string(canonical_name)
);
}
Expand All @@ -311,9 +297,8 @@ namespace mamba
// Overridding url scheme since chan_url could have been defaulted
auto name = std::string(util::strip(util::remove_prefix(default_location, location), '/'));
return Channel(
/*..url= */ std::move(url),
/* url= */ std::move(url),
/* location= */ std::move(location),
/* name= */ name,
/* canonical_name= */ name
);
}
Expand All @@ -324,7 +309,6 @@ namespace mamba
return Channel(
/* url= */ std::move(url),
/* location= */ std::move(location),
/* name= */ std::move(name),
/* canonical_name= */ std::move(canonical_name)
);
}
Expand Down Expand Up @@ -383,7 +367,6 @@ namespace mamba
return Channel(
/* url= */ std::move(url),
/* location= */ it->second.location(),
/* name= */ std::move(combined_name),
/* canonical_name= */ std::move(name),
/* platforms= */ make_platforms(spec.clear_platform_filters(), m_context.platforms())
);
Expand All @@ -396,7 +379,6 @@ namespace mamba
return Channel(
/* url= */ std::move(url),
/* location= */ alias.pretty_str(specs::CondaURL::StripScheme::yes, '/', specs::CondaURL::Credentials::Remove),
/* name= */ name,
/* canonical_name= */ name,
/* platforms= */ make_platforms(spec.clear_platform_filters(), m_context.platforms())
);
Expand All @@ -409,7 +391,6 @@ namespace mamba
return Channel(
/* url= */ specs::CondaURL{},
/* location= */ "",
/* name= */ UNKNOWN_CHANNEL,
/* canonical_name= */ UNKNOWN_CHANNEL
);
}
Expand Down
1 change: 0 additions & 1 deletion libmambapy/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,6 @@ PYBIND11_MODULE(bindings, m)
}
))
.def_property_readonly("location", &Channel::location)
.def_property_readonly("name", &Channel::name)
.def_property_readonly("platforms", &Channel::platforms)
.def_property_readonly("canonical_name", &Channel::canonical_name)
.def("urls", &Channel::urls, py::arg("with_credentials") = true)
Expand Down

0 comments on commit 4898396

Please sign in to comment.