-
Notifications
You must be signed in to change notification settings - Fork 73
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
[#480] Remove Python2 compatibility from code base #640
base: main
Are you sure you want to change the base?
Conversation
looking good so far. please assert here how testing goes. |
41b4824
to
6b0d13d
Compare
have already done some piecemeal testing with good results. will run a full test later. |
Excellent! Keep pushing. |
d478f99
to
fac1329
Compare
There may still be a few points I haven't thought of, but presently the code is exclusively Python3-compatible ( |
.... now with minimal squashing |
Amazing work! We'll start the review process. |
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.
Looks good to me.
Let's get another set of eyes on this before squashing/merging.
Good stuff!
How much does I'm just curious. |
rename message.property module to avoid naming conflict introduce attribute irods.message.property at module EOF. this avoids corrupting the @Property facility used earlier in the module source file, and prevents possibility of breaking changes.
All Python3 classes are of the so called new style, ie directly subclassing "object". Old-style classes are a Python2 relic.
Here's what happens if you try importing the PRC at tip of this branch currently:
As a result of the errors evoked, not the |
Great!... |
Can we... be kinder to anyone who might stumble into this by accident... like... import sys
if sys.version_info[0] < 3:
raise RuntimeError("This library is only supported on Python 3 and above.") But also check the minor version while we're there... |
Good point. We'll put that into |
nice and clean. |
irods/__init__.py
Outdated
@@ -1,3 +1,8 @@ | |||
import sys | |||
if sys.version_info[0] < 3: |
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.
let's also check minor version... aka that we're 3.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.
Have we settled on 3.8 as a minimum, then? Sounds good to me.
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.
Doesn’t have to be 3.8. But that feels about right for a new floor. Discush.
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.
Seems pretty complete to me. Couldn't find anything wrong, so I think it looks good!
setup.py
Outdated
@@ -43,7 +43,6 @@ | |||
packages=find_packages(), | |||
include_package_data=True, | |||
install_requires=[ | |||
'six>=1.10.0', | |||
'PrettyTable>=0.7.2', | |||
'defusedxml', | |||
# - the new syntax: |
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.
The lines following this one read...
# - the new syntax:
#'futures; python_version == "2.7"'
],
# - the old syntax:
extras_require={ ':python_version == "2.7"': ['futures'],
'tests': ['unittest-xml-reporting'] # for xmlrunner
}
Can we remove all of this now?
With this change, we remove all code meant explicitly to deal with the possibility of the PRC's running under Python 2. Especially the awkward (and sometimes voluminous) parts that interfere with a ready understanding of the code base as a whole.