Skip to content
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

Drop support for legacy Python 2.7 #654

Merged
merged 3 commits into from Feb 24, 2019
Merged

Drop support for legacy Python 2.7 #654

merged 3 commits into from Feb 24, 2019

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Feb 23, 2019

Fixes #650.

Adds python_requires to help pip.

Also upgrade syntax with https://github.com/asottile/pyupgrade and unit tests to use more useful asserts.

@codecov-io
Copy link

Codecov Report

Merging #654 into master will decrease coverage by 0.06%.
The diff coverage is 73.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #654      +/-   ##
==========================================
- Coverage   71.84%   71.77%   -0.07%     
==========================================
  Files          49       49              
  Lines       15814    15804      -10     
==========================================
- Hits        11361    11343      -18     
- Misses       4453     4461       +8
Impacted Files Coverage Δ
androguard/decompiler/dad/util.py 64.36% <0%> (ø) ⬆️
androguard/decompiler/dad/dataflow.py 98.7% <100%> (ø) ⬆️
androguard/decompiler/dad/graph.py 91.11% <100%> (ø) ⬆️
tests/dataflow_test.py 93.93% <100%> (ø) ⬆️
tests/rpo_test.py 97.8% <100%> (ø) ⬆️
tests/test_arsc.py 98.85% <100%> (ø) ⬆️
androguard/decompiler/decompiler.py 27.25% <100%> (ø) ⬆️
tests/test_analysis.py 98.79% <100%> (ø) ⬆️
androguard/decompiler/dad/dast.py 13.69% <100%> (ø) ⬆️
androguard/decompiler/dad/opcode_ins.py 87.34% <100%> (ø) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 07428e3...85cc1b9. Read the comment docs.

@hugovk hugovk mentioned this pull request Feb 23, 2019
@@ -1084,12 +1084,12 @@ def _fix_value(self, value):
if not self.__charrange or not self.__replacement:
if sys.maxunicode == 0xFFFF:
Copy link
Member

Choose a reason for hiding this comment

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

Do you know if there are narrow 3.x builds? otherwise we can remove this too...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know.

@reox
Copy link
Member

reox commented Feb 24, 2019

Wow, this looks very nice!
To summarize what you did:

  • replace all super(Classname, self.)... with super()
  • remove all (object) from class definitions
  • replace C string fmt with propper .format
  • add regex type string if not present
  • remove all unicode string definitions
  • change set() to {}

There are also import from future and builtins which could be removed now, as they were primary for the py2/3 compatability.
Also the one comment: This was a fix for narrow 2.x builds, but I think there are no narrow py3 builds? At least according to SO (https://stackoverflow.com/questions/14790708/do-unicode-strings-in-python-3-still-depend-on-narrow-wide-builds) this only affects up to 3.2. But as our minimal version is 3.4 (due to other issues) we should be fine.

This PR sounds like, that the next version will be 4.0.0 ;)

@reox
Copy link
Member

reox commented Feb 24, 2019

@androguard/external-contributors please have a look!

@reox reox merged commit b3e5b4e into androguard:master Feb 24, 2019
@eighthave
Copy link
Contributor

Most of the changes look simple and good. Changing the formats could cause breakage, so I hope those cases are covered by tests.

@reox
Copy link
Member

reox commented Feb 25, 2019

so I hope those cases are covered by tests.

so far, the tests work for mutf8 parsing - which was one of the most annoying things to have both working for py2 and py3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants