-
Notifications
You must be signed in to change notification settings - Fork 54
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
2to3 1st attempt on independent commands #2286
Conversation
Possible refactoringThere are a number of places where the code from https://gist.github.com/wxtim/cc3f4e653d37616ff24714bfbc32444b might be useful/faster. This checks whether and object to write and object to be written are both expecting bytes of string types, converting the object to write to the appropriate type. |
6ac9dc0
to
3b981e1
Compare
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.
Haven't had the chance for an in-depth pass but these changes look sensible. Now just a matter of fixing tests one at a time 🤕 !
ec34c95
to
578d543
Compare
98ec1d0
to
6869a8c
Compare
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.
Great work so far! Overall this looks sound. For now I'll be diving in with some comments as I spot them whilst cross-referencing this for my own porting work.
a933e88
to
a82ee82
Compare
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.
Cheers @wxtim
-
rose is a project that I am not really familiar with (both code and features). Nor have a development environment with a working version of rose to test it. So my review is a bit superficial here, sorry.
-
Several files appear marked as "deleted" in GitHub. Is it an issue with GitHub UI, and these items were actually moved elsewhere? Or, for Python 3, we actually have to remove these files?
-
Touching tests while refactoring can be dangerous. Some tests appear as deleted too, while in others it looks like we are now skipping the tests. Wouldn't it be better to avoid touching those tests, and instead use them as the target? And then work to fix the tests and consider work done once everything works. Just in case we are running the risk of accidentally changing the test in such way that it will give the green flag for the new code, even though it was supposed to fail.
-
Ignored tests as I don't really know much about the test harness used
-
Ignored isodatetime as I believe these files were copied from the latest release in PYPI
-
Ignored files where the change was just the shebang
Great work! Hope that helps!
Bruno
Thanks Bruno - useful to have your thoughts on it. Questionable
|
4c4dc91
to
7e4b0d2
Compare
@wxtim I think 2to3 cannot guess whether we will modify the iterator or not, so it just plays safe and puts Happy with all your comments. I think there is one or two comments pending to be resolved. But both minor. Happy to approve once these two are resolved 👍 And once again, really detailed and nice work! Although it is a pull request with lots of changes, your work is well organised, so it helps reviewers. Cheers |
1847c34
to
955e699
Compare
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.
OK, I think this is my final pass. I think we are pretty much there with this one:
- A few bytes vs strings comments which require clarification
- A potential import issue
- One potentially suspect test which requires investigation
ae4082d
to
a9fc4e0
Compare
@oliver-sanders wrote RE:
I've reverted this change having hopefully dealt with the cause of the change in order by using a |
fix broken hyperlink squashlater: documetation squashlater: address OS concern RE: test output order
f83364b
to
701be1e
Compare
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 have given this PR a good 👀 with 👓 . I have added some comments. Hopefully should not take too long to fix. Thanks for the big effort!
d8523a6
to
3194371
Compare
e81a039
to
6e1b731
Compare
I have responded to all @matthewrmshin 's comments, either by fixing things or creating new tickets. 🎉 |
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.
Fantastic first attempt. Thank you very much.
I am done. @oliver-sanders @sadielbartholomew please review 2. |
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.
Happy now t/rose-app-upgrade/05-cwd.t
is sorted. Let's move onto follow up work.
Doubly approved. Merge! |
return self.handle.write(message.encode("utf-8")) | ||
except UnicodeDecodeError: | ||
return self.handle.buffer.write(message.encode("utf-8")) | ||
except TypeError: | ||
return self.handle.write(message) | ||
except AttributeError: | ||
return self.handle.write(message.encode('UTF-8')) |
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.
This could be why the stderr is coming at the end of all stdout in rosa db-create @dpmatthews
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.
Jamming in a self.handle.flush()
after the write might to the trick.
Work in progress for Rose Python3 upgrade.
(Deliberatly not fixed: waiting on @sadielbartholomew)
(removed from codebase - to be re-implemented later)
(waiting on rose-suite-run to be sorted)
❄️ Flakey Tests
rosa-svn-pre-commit/03-meta.t "test 02 password modify bad owner" fails when run in a sub shell.
Many tests that look at output fail when dictionary order changes and are therefore flaky.
rose-app-run/05-file.t:line82
contains scripts for dealing with this, but perhaps there should be** Consideration of Re-factoring this out into an addition to the test header.
** Consideration of where else output should be sorted to prevent changes in the code breaking tests incorrectly.
Tests Needed? 🔬
The following cases of non Python3 compatible code were found using grep, rather than the Tests:
cmp()
Unittests Needed
I have identified places where I have used cmp_to_key as a quick, hackky solution. These should probably be unit-tested in pyhton2 then upgraded again.
Automated testing issues
Codacy and codecov do not pass. 😢
The codacy failures are as follows:
sphinx/ext/auto_cli_doc.py:426
:This failure exists in master, and is only highlighted because it's been changed slightly. I could make it go away thus:
but feel this to be silly.
lib/python/isodatetime/tests/test_time_point.py:101&120
:Codacy says
"Standard pseudo-random generators are not suitable for security/cryptographic purposes."
which is good, becuase they aren't.
Python 3.6 to 3.7 conversions.
Most of these were to remove 3.8 deprecation warnings:
collections
imp
inspect.getargspec