Skip to content

avoid relying on order in which keys are processed in to_dependency#2804

Merged
migueldiascosta merged 1 commit intoeasybuilders:developfrom
boegel:to_dependency_no_key_order
Mar 8, 2019
Merged

avoid relying on order in which keys are processed in to_dependency#2804
migueldiascosta merged 1 commit intoeasybuilders:developfrom
boegel:to_dependency_no_key_order

Conversation

@boegel
Copy link
Member

@boegel boegel commented Mar 8, 2019

When looking into extending the support in the 4.x to other Python 3.x versions beyond 3.6, I ran into a failing test for to_dependency because of the order in which the keys were being iterated over.

If a bogus key-pair value is included in the dict passed to to_dependency (which is supposed to trigger an exception Found unexpected (key, value) pair), and it gets processed before name or version are, then it is accepted as a valid key, which is incorrect.

This patch fixes it by first considering name/version before the other keys, so the order in which the remaining keys are processed doesn't matter...

@boegel boegel added the bug fix label Mar 8, 2019
@boegel boegel added this to the next release (3.8.2) milestone Mar 8, 2019
Copy link
Member

@migueldiascosta migueldiascosta left a comment

Choose a reason for hiding this comment

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

lgtm

@migueldiascosta
Copy link
Member

Going in, thanks @boegel!

@migueldiascosta migueldiascosta merged commit 0683668 into easybuilders:develop Mar 8, 2019
@boegel boegel deleted the to_dependency_no_key_order branch March 8, 2019 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants