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
Upgrade to Python3 #1214
Upgrade to Python3 #1214
Conversation
This test assumes peculiar ordering guarantees which have changed from python2. This switches it to be the output from python3, but a proper fix would either to test equality only up to permutation, or to fix and guarantee an actual ordering.
The CI failure seems to be unrelated to my PR, it looks like the nix Travis config now creates |
Did you use 2to3 for the syntactic/trivial changes? Why are they split into two commits? As for the unit test target, I think it would be better to change |
@lheckemann I did not use 2to3, the changes were manual. I agree with the solution to the test issue. |
I'm seeing a lot of failures around |
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'm +1 in principle, and excited to see this work -- and willing to use it!
I'm getting a lot of iteritems:
[nix-shell:~/projects/grahamc/packet-spot-community]$ nixops info
Traceback (most recent call last):
File "/nix/store/piraap1wq1sbgyibyzf3hjy034264n44-nixops-1.8pre0_abcdef/bin/.nixops-wrapped", line 251, in <module>
args.op(args)
File "/nix/store/piraap1wq1sbgyibyzf3hjy034264n44-nixops-1.8pre0_abcdef/lib/python3.7/site-packages/nixops/script_defs.py", line 224, in op_info
do_eval(depl)
File "/nix/store/piraap1wq1sbgyibyzf3hjy034264n44-nixops-1.8pre0_abcdef/lib/python3.7/site-packages/nixops/script_defs.py", line 166, in do_eval
depl.evaluate()
File "/nix/store/piraap1wq1sbgyibyzf3hjy034264n44-nixops-1.8pre0_abcdef/lib/python3.7/site-packages/nixops/deployment.py", line 360, in evaluate
self.evaluate_network()
File "/nix/store/piraap1wq1sbgyibyzf3hjy034264n44-nixops-1.8pre0_abcdef/lib/python3.7/site-packages/nixops/deployment.py", line 352, in evaluate_network
self.description = config.get("description", self.default_description)
File "/nix/store/piraap1wq1sbgyibyzf3hjy034264n44-nixops-1.8pre0_abcdef/lib/python3.7/site-packages/nixops/util.py", line 260, in set
else: self._set_attr(name, x)
File "/nix/store/piraap1wq1sbgyibyzf3hjy034264n44-nixops-1.8pre0_abcdef/lib/python3.7/site-packages/nixops/deployment.py", line 142, in _set_attr
self._set_attrs({name: value})
File "/nix/store/piraap1wq1sbgyibyzf3hjy034264n44-nixops-1.8pre0_abcdef/lib/python3.7/site-packages/nixops/deployment.py", line 132, in _set_attrs
for n, v in attrs.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
It looks like the by-hand / partial conversion of deployment.py breaks 2to3. |
I did some more work on it here master...grahamc:python3 and make nixops info work, and nixops ssh-for-each work, but nixops deploy hangs forever with defunct ssh processes. Update now it can do For example:
Update now it can make new systems with the nixops-packet backend but the "Waiting for SSH ......" periods don't print one at a time
Update: the logger correctly handles the "waiting for SSH ...." printing. Update: this works correctly:
|
I haven't tested this executes properly but it passes all the tests on Linux.
There's a note in
nixops/diff.py
suggesting some improvements to the type declarations possible in python3 which I haven't dealt with.