-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: allow eval on non existing namespace #29
Conversation
@@ -94,12 +114,27 @@ def remove_empty_keys(variant_dict: dict[str, Any]) -> dict[str, Any]: | |||
return filtered_dict | |||
|
|||
|
|||
def flatten_lists(variant_dict: dict[str, Any]) -> dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these methods considered to be used outside of this class? E.g. are they public? If not maybe we should prepend them with a _
. Otherwise, disregard this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved flatten_lists and remove_empty_keys in utils.py
so it could be reused in future.
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utils.py
is still a "public" module though. Personally I would either make utils
"non-public" by prepending a _
or prepending the functions.
The thing is that if we don't mark them as non-public they are public and people might start depending on these symbols.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry but why it's a bad idea to expose this utills functions for the public?
flattening a lists and remove empty keys seems like a generic problem that isn't a rattler/conda specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a preference but to me, the scope of this library is not providing utility functions to work with lists and dictionaries but rather to work with recipe.yaml
s. In my eyes, we should be really careful to increase the API of the library. People will start depending on anything we expose publicly which makes it harder for us to refactor things in the library later on. For instance, just moving a function from one module to another will then already be a breaking change.
WDYT @Hofer-Julian @tdejager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, let me make them private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @baszalmstra.
Regarding making all functions private vs making the module private, I think making the functions private is the way to go. It is more common in my experience.
This PR aims to add
allow_missing_selector
argument forRecipeLoader
which will be used by conda-smithy linter to suggest some lints for osx platform. To do this, we need to ignore other selectors ( treat them as true ) so the osx one will be evaluated.Also, I'm adding
flatten_lists
that will make just a list of values for this case:So instead of having python: [[3.8], [3.9]]
we will have python:[3.8, 3.9]