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

Port to Python 3 #113

Merged
merged 17 commits into from
Mar 5, 2017
Merged

Port to Python 3 #113

merged 17 commits into from
Mar 5, 2017

Conversation

hawkowl
Copy link
Member

@hawkowl hawkowl commented Jun 13, 2016

Since this needs to run on Python 3, I've removed the Python 3 linter checks -- since it won't be able to run them, and the Twisted codebase is now free of the majority of them.

This also updates to the Py3 compatible version of pylint and newer PEP8.

@hawkowl
Copy link
Member Author

hawkowl commented Jun 13, 2016

cc @glyph :)

@@ -77,14 +82,13 @@ def test_findUselessCheckers(self):
Test for method findUselessCheckers
"""
runner = Runner()
registeredCheckers = sum(runner.linter._checkers.values(), [])
registeredCheckers = sum(list(runner.linter._checkers.values()), [])
Copy link
Contributor

@rodrigc rodrigc Jun 22, 2016

Choose a reason for hiding this comment

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

Do you really need to explicitly call list() in these changes,
or can you leave the calls to list() out? converters like 2to3 tend to put them in, but most times you don't need them.

Otherwise, this patch looks OK.

Copy link
Contributor

Choose a reason for hiding this comment

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

On second look, these explicit calls to list() all look needed.

@glyph
Copy link
Member

glyph commented Jun 29, 2016

Use of the word "also" is a killer :). Can you split this up? Particularly, the verbose pep8=>pycodestyle renaming detracts from trying to look at the rest of the code.

@glyph
Copy link
Member

glyph commented Jun 29, 2016

One other minor concern - I'd really like to be able to run twistedchecker locally using pypy to get faster lint times. Right now I can't, due to this unfortunate bug - pylint-dev/pylint#964 - but if we stop testing twistedchecker on 2.7 then this is even less likely to be possible.

@glyph
Copy link
Member

glyph commented Jun 29, 2016

D'oh. I suppose you can remove that last comment. I thought I had seen somewhere that this was removing the 2.7 support - but it looks like the tox envs just add 3.5.

setup.py Outdated
@@ -9,7 +9,7 @@
setup(
name='TwistedChecker',
description='A Twisted coding standard compliance checker.',
version='0.5.0',
version='16.0',
Copy link
Member

Choose a reason for hiding this comment

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

This seems pretty clearly unrelated…

@glyph
Copy link
Member

glyph commented Jun 29, 2016

Reviewed!

@hawkowl - Thank you for taking on the port here. But the change is way too big and does a bunch of unrelated things. Please split this into a series of smaller changes so that each can be reviewed more quickly and landed independently. Particularly, I'd like to see the version bumps taken care of first without the rest of the py3 port involved.

"logilab-common == 0.62.0",
"pep8 == 1.5.7"
"pylint == 1.5.6",
"logilab-common == 1.2.1",

Choose a reason for hiding this comment

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

logilab-common is not needed anymore by pylint ;-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Except we use it somewhere, yaaaaaay :P

Copy link
Member

Choose a reason for hiding this comment

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

This is extra-confusing then. Aren't we using it to import the exception types and such required by pylint? If pylint doesn't use them any more, can we just delete that code?

@codecov-io
Copy link

codecov-io commented Mar 4, 2017

Codecov Report

Merging #113 into master will increase coverage by 0.58%.
The diff coverage is 89.62%.

@@            Coverage Diff            @@
##           master    #113      +/-   ##
=========================================
+ Coverage   92.21%   92.8%   +0.58%     
=========================================
  Files          27      26       -1     
  Lines        1169    1098      -71     
  Branches      193     187       -6     
=========================================
- Hits         1078    1019      -59     
+ Misses         54      48       -6     
+ Partials       37      31       -6
Impacted Files Coverage Δ
twistedchecker/core/runner.py 89% <ø> (+0.33%)
twistedchecker/checkers/header.py 88.46% <100%> (ø)
twistedchecker/checkers/comment.py 90.9% <100%> (+0.28%)
twistedchecker/test/test_runner.py 100% <100%> (ø)
twistedchecker/reporters/limited.py 100% <100%> (ø)
twistedchecker/checkers/testclassname.py 100% <100%> (ø)
twistedchecker/checkers/names.py 87.65% <100%> (ø)
twistedchecker/test/test_functionaltests.py 87.5% <100%> (+2.23%)
twistedchecker/checkers/formattingoperation.py 100% <100%> (ø)
twistedchecker/init.py 50% <42.85%> (-50%)
... and 2 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 e2481ed...999e2b5. Read the comment docs.

@rodrigc rodrigc force-pushed the py3 branch 2 times, most recently from cf38d69 to 922a469 Compare March 5, 2017 01:45
Copy link
Contributor

@rodrigc rodrigc left a comment

Choose a reason for hiding this comment

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

I took this patch and updated it.
I've been testing it and it seems to work OK.

@rodrigc rodrigc merged commit eeeba97 into master Mar 5, 2017
@rodrigc rodrigc deleted the py3 branch March 5, 2017 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants