diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf522c6..32fc77b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,12 @@ jobs: build-test: runs-on: ${{ matrix.os }} strategy: - matrix: - # Python 3.8 is the last non-EOL version. Also adapt tox.ini - python-version: ['3.8', 'pypy3.10', '3.12'] - os: [ubuntu-latest, windows-latest] fail-fast: false + matrix: + # Python 3.8 is EOL. Also adapt tox.ini + python-version: ['3.8', 'pypy3.11', '3.x'] + # macOS on ARM, Ubuntu on x86, Windows on X86 + os: [macos-latest, ubuntu-latest, windows-latest] steps: - name: Checkout uses: actions/checkout@v4 @@ -32,13 +33,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: x64 cache: 'pip' - cache-dependency-path: '**/test-requirements' + cache-dependency-path: 'pyproject.toml' - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install -e .[dev] - python -m pip install 'tox-gh-actions<4.0.0' + python -m pip install --editable .[dev] - name: Test with tox - run: tox + run: tox -e py diff --git a/cpplint.py b/cpplint.py index 7a8b8ab..0e658d2 100755 --- a/cpplint.py +++ b/cpplint.py @@ -44,7 +44,7 @@ import codecs import collections import copy -import getopt +import getopt # pylint: disable=deprecated-module import glob import itertools import math # for log diff --git a/dev-requirements b/dev-requirements deleted file mode 100644 index 62a36ea..0000000 --- a/dev-requirements +++ /dev/null @@ -1,5 +0,0 @@ -# requirements to run development steps - -flake8>=4.0.1 -pylint>=2.11.0 -setuptools diff --git a/pyproject.toml b/pyproject.toml index e4bb940..91f944a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,77 @@ [build-system] -build-backend = "setuptools.build_meta:__legacy__" -requires = [ +build-backend = "setuptools.build_meta" +requires = [ "setuptools>=61.2" ] + +[project] +name = "cpplint" +version = "2.0.0" +description = "Automated checker to ensure C++ files follow Google's style guide" +readme = "README.rst" +keywords = [ "c++", "lint", "python" ] +license = { text = "BSD-3-Clause" } +maintainers = [ { name = "cpplint Developers" } ] +requires-python = ">=3.8" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: End Users/Desktop", + "License :: Freely Distributable", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Programming Language :: C++", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Software Development :: Quality Assurance", +] +dependencies = [ ] + +optional-dependencies.dev = [ + "flake8>=4.0.1", + "parameterized", + "pylint>=2.11", + "pytest", + "pytest-cov", + "pytest-timeout", "setuptools", - "wheel", + "testfixtures", + "tox<5", +] +optional-dependencies.test = [ + "parameterized", + "pytest", + "pytest-cov", + "pytest-timeout", + "testfixtures", + "tox<5", +] +optional-dependencies.testing = [ + "parameterized", + "pytest", + "pytest-cov", + "pytest-timeout", + "testfixtures", + "tox<5", ] +urls.Download = "https://github.com/cpplint/cpplint" +urls.Homepage = "https://github.com/cpplint/cpplint" +scripts.cpplint = "cpplint:main" + +[tool.setuptools] +py-modules = [ "cpplint" ] +include-package-data = false + +[tool.pytest.ini_options] +python_files = [ "*test.py" ] +testpaths = [ "." ] +required_plugins = [ "pytest-cov", "pytest-timeout" ] +timeout = 60 +# fail if coverage is under 90% +addopts = "--color=yes --cov-fail-under=90 --cov=cpplint" + +[tool.aliases] +test = "pytest" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index eebbf0a..0000000 --- a/setup.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[aliases] -test = pytest - -[tool:pytest] -python_files = *test.py -testpaths = . -required_plugins = pytest-cov pytest-timeout -timeout = 60 -# fail if coverage is under 90% -addopts = --color=yes --cov-fail-under=90 --cov=cpplint diff --git a/setup.py b/setup.py deleted file mode 100755 index 2325a71..0000000 --- a/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -#! /usr/bin/env python -from setuptools import setup -import cpplint - -# some pip versions bark on comments -def read_without_comments(filename): - with open(filename) as f: - return [line for line in f.read().splitlines() if not len(line) == 0 and not line.startswith('#')] - -test_required = read_without_comments('test-requirements') - -setup(name='cpplint', - version=cpplint.__VERSION__, - py_modules=['cpplint'], - # generate platform specific start script - entry_points={ - 'console_scripts': [ - 'cpplint = cpplint:main' - ] - }, - install_requires=[], - url='https://github.com/cpplint/cpplint', - download_url='https://github.com/cpplint/cpplint', - keywords=['lint', 'python', 'c++'], - maintainer='cpplint Developers', - classifiers=['Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Intended Audience :: End Users/Desktop', - 'License :: Freely Distributable', - 'License :: OSI Approved :: BSD License', - 'Natural Language :: English', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: C++', - 'Topic :: Software Development :: Quality Assurance'], - description='Automated checker to ensure C++ files follow Google\'s style guide', - long_description=open('README.rst').read(), - license='BSD-3-Clause', - tests_require=test_required, - # extras_require allow pip install .[dev] - extras_require={ - 'test': test_required, - 'dev': read_without_comments('dev-requirements') + test_required - }) diff --git a/test-requirements b/test-requirements deleted file mode 100644 index 9c9abb5..0000000 --- a/test-requirements +++ /dev/null @@ -1,8 +0,0 @@ -# requirements for testing steps -tox<5.0.0 - -pytest -pytest-cov -pytest-timeout -testfixtures -parameterized diff --git a/tox.ini b/tox.ini index d7e3e82..1fc6c00 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,7 @@ [tox] -envlist = py38, py39, py3.10, py311, py312, pypy3 +envlist = py38, py39, py3.10, py311, py312, py313, pypy3 skip_missing_interpreters = true -[gh-actions] -python = - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311 - 3.12: py312 - pypy3.10: pypy3 - [testenv] extras = dev