-
Notifications
You must be signed in to change notification settings - Fork 12
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
dicts aren't ordered... so converge doesn't happen in order #41
Comments
Hm, does something actually rely on them being run in order?
…On Mon, Jun 4, 2018, 22:23 Kyle Altendorf ***@***.***> wrote:
https://travis-ci.org/Julian/mkenv/jobs/388018638#L534
So the virtualenvs.toml is being loaded into a dict so we can't trust the
order on less than Python 3.7 (or 3.6 of course as an implementation
detail). Locally for me everything passed fairly consistently. I brought up
a local Travis container and mostly got both py27 and py34 failing, but not
totally consistently.
The result of one tox run of py27/34 with an added print yielded the dict
you might expect to see for a failure.
diff --git a/mkenv/converge.py b/mkenv/converge.py
index bdb9bf2..b50c4fd 100644--- a/mkenv/converge.py+++ b/mkenv/converge.py@@ -39,6 +39,9 @@ def main(filesystem, locator, link_dir, handle_error):
with filesystem.open(locator.root.descendant("virtualenvs.toml")) as venvs:
contents = pytoml.load(venvs)
+ with open('/home/travis/mkenv/blah', 'a') as f:+ f.write(str(contents) + '\n')+
for name, config in contents["virtualenv"].items():
config.setdefault("sys.version", sys.version)
{u'virtualenv': {u'a': {}, u'c': {}, u'b': {}, u'magicExplodingVirtualenv': {}}}
{u'virtualenv': {u'a': {u'requirements': [u'requirements.txt'], u'install': [u'foo', u'bar']}}}
{u'virtualenv': {u'a': {u'requirements': [u'requirements.txt', u'other.txt'], u'install': [u'baz', u'quux']}}}
{u'virtualenv': {u'a': {}, u'c': {u'link': [u'bar', u'baz'], u'install': [u'foo', u'$HOME', u'~/a']}, u'b': {u'requirements': [u'requirements.txt'], u'install': [u'foo', u'bar', u'bla']}}}
{u'virtualenv': {u'a': {}, u'c': {}, u'b': {}, u'magicExplodingVirtualenv': {}}}
{'virtualenv': {'magicExplodingVirtualenv': {}, 'a': {}, 'b': {}, 'c': {}}}
{'virtualenv': {'a': {'requirements': ['requirements.txt'], 'install': ['foo', 'bar']}}}
{'virtualenv': {'a': {'requirements': ['requirements.txt', 'other.txt'], 'install': ['baz', 'quux']}}}
{'virtualenv': {'a': {}, 'b': {'requirements': ['requirements.txt'], 'install': ['foo', 'bar', 'bla']}, 'c': {'link': ['bar', 'baz'], 'install': ['foo', '$HOME', '~/a']}}}
{'virtualenv': {'magicExplodingVirtualenv': {}, 'a': {}, 'b': {}, 'c': {}}}
There's a ticket (avakar/pytoml#6
<avakar/pytoml#6>) for pytoml to get
object_pairs_hook like json. Maybe it's time for me to head over there.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#41>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUIXoixjtPSKsrtYi4wmYpsd7CbikHBks5t5eukgaJpZM4UaDfa>
.
|
The linked test that's failing. It presumes that the magic one failing should keep 'c' from being created while still allowing 'a' and 'b' to be created. At least that was my cursory analysis of the assertion. https://github.com/Julian/mkenv/blob/py3/mkenv/tests/test_converge.py#L134 |
Ahh got it, test bug.
Yeah makes sense.
…On Mon, Jun 4, 2018, 22:42 Kyle Altendorf ***@***.***> wrote:
The linked test that's failing. It presumes that the magic one failing
should keep 'c' from being created while still allowing 'a' and 'b' to be
created. At least that was my cursory analysis of the assertion.
https://github.com/Julian/mkenv/blob/py3/mkenv/tests/test_converge.py#L134
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#41 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAUIXgqT6NzCOoC5LRzA1EWKBixrp9TWks5t5e_4gaJpZM4UaDfa>
.
|
It seemed like that was a significant point of the test. Should it be truncated to only assert the exception and not the existence or lack thereof of the other environments? It seems that removing |
So the point of the test is to handle the case where an exception is handled in an environment before some other environments are to-be-installed. (And means to say "it short circuits with that option after the exception") So, the way it's written is wrong because it depends on hash order (which by the way is in-order on PyPy too which is why I didn't notice), but we need some other way of exercising that same scenario. Probably by just forcing the returned dict into a particular order (by say passing in a modified |
Other than just hacking in a tweak for the test...
Or? I'm fine with # 1. I guess now that I went and pulled a py3 branch, there wasn't really that much left to fix on py3 (at least as per reported by the tests). I should start actually using mkenv I suppose and figure out what py3 tests are missing. That and check it out on Windows. |
Fixed in 338cbf7 by updating to latest pytoml with the object_pairs_hooks. |
https://travis-ci.org/Julian/mkenv/jobs/388018638#L534
So the
virtualenvs.toml
is being loaded into a dict so we can't trust the order on less than Python 3.7 (or 3.6 of course as an implementation detail). Locally for me everything passed fairly consistently. I brought up a local Travis container and mostly got both py27 and py34 failing, but not totally consistently.The result of one tox run of py27/34 with an added print yielded the dict you might expect to see for a failure.
There's a ticket (avakar/pytoml#6) for pytoml to get
object_pairs_hook
likejson
. Maybe it's time for me to head over there.The text was updated successfully, but these errors were encountered: