styleguide icon indicating copy to clipboard operation
styleguide copied to clipboard

Python3000

Open mattyclarkson opened this issue 9 years ago • 5 comments

Adds support for Python 3 by shimming changes in functionality between Python 2 and 3.

It also stops the compiled python files showing up in the git status list. This can be tested with:

[cpplint|python3000|✔] python2 cpplint/cpplint_unittest.py 
...........................................................................................................................................................................
----------------------------------------------------------------------
Ran 171 tests in 0.571s

OK
[cpplint|python3000|✔] python3 cpplint/cpplint_unittest.py 
cpplint/cpplint_unittest.py:4713: DeprecationWarning: Please use assertEqual instead.
  self.PerformFunctionLengthsCheck(code))
.cpplint/cpplint_unittest.py:83: DeprecationWarning: Please use assertTrue instead.
  ' which is not in _ERROR_CATEGORIES' % (message, category))
..........................................................................................................................................................................
----------------------------------------------------------------------
Ran 171 tests in 0.641s

OK
[cpplint|python3000|✔] python2 --version
Python 2.7.10
[cpplint|python3000|✔] python3 --version
Python 3.4.3

mattyclarkson avatar Jun 08 '15 14:06 mattyclarkson

I have a patch for the Python 3 unit test deprecation warnings but it is a huge patch because it requires that a lot of the assertEquals to be changed to assertEqual. I'll submit it if there is interest if this branch gets merged.

mattyclarkson avatar Jun 08 '15 14:06 mattyclarkson

Is this PR being considered for merging? Or does it need any updates? Python 3 support would be really valuable and should be difficult to reach. I would be more then happy to help.

dirk-thomas avatar Oct 14 '15 17:10 dirk-thomas

@dirk-thomas it's read to go. We use it everyday in production on Arch Linux Python 3.5 and have done since python 3.2.

mattyclarkson avatar Dec 04 '15 17:12 mattyclarkson

We are also using the patched version of it for over a month now: https://github.com/ament/ament_lint/commit/7f2af60114d1aad63445eb52032fca0db380e042#diff-b5c57d8cc3ce83e990089f94f5ab6e15

Hopefully somebody will merge this as well as some of the other pending PRs at some point...

dirk-thomas avatar Dec 04 '15 17:12 dirk-thomas

Hi, I had extracted cpplint into an own github repo back when the google styleguide was in googlecode svn. Here: https://github.com/cpplint/cpplint I have additionally made it available at pypi: https://pypi.python.org/pypi/cpplint

tkruse avatar Apr 23 '16 12:04 tkruse