Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', 'pypy3.10', '3.11']
python-version: ['3.9', 'pypy3.10', '3.11', '3.12']
fail-fast: false

steps:
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ You can setup your local environment for developing patches for cpplint like thi
# run a single CLI integration test
pytest --no-cov cpplint_clitest.py -k testSillySample
# run all tests
./setup.py test
./setup.py lint
./setup.py ci # all the above
./flake8
tox # all of the above in all python environments
pytest
pylint cpplint.py
flake8
# all of the above in all python environments
tox

Releasing
---------
Expand Down
2 changes: 1 addition & 1 deletion cpplint_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ def testIncludeWhatYouUseNoImplementationFiles(self):
code = 'std::vector<int> foo;'
for extension in ['h', 'hpp', 'hxx', 'h++', 'cuh',
'c', 'cc', 'cpp', 'cxx', 'c++', 'cu']:
self.assertEquals('Add #include <vector> for vector<>'
self.assertEqual('Add #include <vector> for vector<>'
' [build/include_what_you_use] [4]',
self.PerformIncludeWhatYouUse(code, 'foo.' + extension))

Expand Down
38 changes: 1 addition & 37 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,7 @@
#! /usr/bin/env python

from setuptools import setup, Command
from subprocess import check_call
from distutils.spawn import find_executable
from setuptools import setup
import cpplint as cpplint

class Cmd(Command):
'''
Superclass for other commands to run via setup.py, declared in setup.cfg.
These commands will auto-install setup_requires in a temporary folder.
'''
user_options = [
('executable', 'e', 'The executable to use for the command')
]

def initialize_options(self):
self.executable = find_executable(self.executable)

def finalize_options(self):
pass

def execute(self, *k):
check_call((self.executable,) + k)


class Lint(Cmd):
'''run with python setup.py lint'''
description = 'Run linting of the code'
user_options = Cmd.user_options + [
('jobs', 'j', 'Use multiple processes to speed up the linting')
]
executable = 'pylint'

def run(self):
self.execute('cpplint.py')

# some pip versions bark on comments (e.g. on travis)
def read_without_comments(filename):
with open(filename) as f:
Expand Down Expand Up @@ -78,7 +45,4 @@ def read_without_comments(filename):
extras_require={
'test': test_required,
'dev': read_without_comments('dev-requirements') + test_required
},
cmdclass={
'lint': Lint
})
1 change: 0 additions & 1 deletion test-requirements
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
# 5.x requires python 3.5
pytest
pytest-cov
# freeze versions breaking python 2.7 on travis
testfixtures
9 changes: 5 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# also see gitlab ci.yml
[tox]
envlist = py39, py310, py312, pypy3

Expand All @@ -16,9 +15,11 @@ deps =
pylint>=2.11.0
flake8-polyfill
pytest
pytest-cov
testfixtures
setuptools==58.2.0

commands =
{envpython} setup.py test
{envpython} setup.py lint
{envpython} -m flake8
{envpython} -m pytest
{envpython} -m pylint cpplint.py
{envpython} -m flake8