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 API method for getting all build_types regardless of conditions. #337

Merged
merged 3 commits into from
May 25, 2022

Conversation

nuclearsandwich
Copy link
Contributor

This is more of a spike than anything. I'm not convinced this is the
best way to go for this particular issue but it was the first thought
that came to my head.

Of possibly more concern is that this gets us past the "first hurdle"
but I'm unclear why the simple version bump doesn't crash also.

This is more of a spike than anything. I'm not convinced this is the
best way to go for this particular issue but it was the first thought
that came to my head.

Of possibly more concern is that this gets us past the "first hurdle"
but I'm unclear why the simple version bump doesn't crash also.
@@ -166,6 +166,18 @@ def get_build_type(self):
return build_type_exports[0]
raise InvalidPackage('Only one <build_type> element is permitted.', self.filename)

def get_build_types(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cottsay should we rename this to something like get_unconditional_build_types() or somesuch to make it more obvious that this is an "advanced" method?

Should we also or alternatively prefix it with _?

Suggested change
def get_build_types(self):
def _get_unconditional_build_types(self):

Copy link
Member

@cottsay cottsay May 25, 2022

Choose a reason for hiding this comment

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

I don't think it would hurt, but I also think that adding docs to the function would be is sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did decide to rename it without the _ prefix. Documentation for the method also indicates that conditions are not considered.

@nuclearsandwich nuclearsandwich merged commit 7062296 into master May 25, 2022
@nuclearsandwich nuclearsandwich deleted the 336/conditional-build-type branch May 25, 2022 23:42
nuclearsandwich added a commit that referenced this pull request May 27, 2022
These patches were interleaved and #340 was not updated before being
merged.
nuclearsandwich added a commit that referenced this pull request May 27, 2022
These patches were interleaved and #340 was not updated before being
merged.
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