Skip to content

Commit acc2d97

Browse files
committed
modernize testing a bit
shy away from using dperecated setup.py subcommands update dependencies and remove unneeded legacy stuff make pytest have color outputs and do deprecation warnings
1 parent f870a11 commit acc2d97

8 files changed

Lines changed: 14 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ jobs:
2323
python-version: ${{ matrix.python-version }}
2424
architecture: x64
2525
cache: 'pip'
26-
cache-dependency-path: '**/dev-requirements'
26+
cache-dependency-path: '**/test-requirements'
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
3030
python -m pip install -e .[dev]
31+
python -m pip install 'tox-gh-actions<4.0.0'
3132
- name: Test with tox
3233
run: tox

CONTRIBUTING.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ The release process first prepares the documentation, then publishes to testpypi
7676
vi changelog.rst # log changes
7777
git add cpplint.py changelog.rst
7878
git commit -m "Releasing x.y.z"
79-
# test-release (on env by mkvirtualenv -p /usr/bin/python3)
80-
pip install --upgrade wheel twine
79+
# Build
80+
pip install --upgrade build wheel twine
8181
rm -rf dist
82+
python -m build --sdist --wheel
8283
# Test release, requires account on testpypi
83-
python3 setup.py sdist bdist_wheel
8484
twine upload --repository testpypi dist/*
8585
# ... Check website and downloads from https://test.pypi.org/project/cpplint/
8686
# Actual release

changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Changelog
77
A bunch of long-overdue modernizations of the codebase!
88

99
* Python 2 is no longer supported. Python 3.7 and 3.12 support was added, courtesy of @jayvdb
10-
* We still have yet to switch from the old setup.py distribution mechanism, so we're staying on an old version of setuptools for now. As a result of all this, setup.py's lint subcommand was removed
10+
* As a result of all this, setup.py's lint subcommand was removed. Please run the commands directly instead.
1111
* NOLINT and NOLINTNEXTLINE comments now support a comma-separated list of categories, courtesy of @n3world (https://github.com/cpplint/cpplint/pull/220)
1212
* The `--filter` option can now be only applied to a specific file or even a specific line through utilizing colons, e.g. `-filter=-whitespace:foo.h,+whitespace/braces:foo.h:418`. Courtesy of @PhilLab (https://github.com/cpplint/cpplint/pull/171)
1313
* NOLINT and NOLINTNEXTLINE will now ignore categories known to be from clang-tidy thanks to @xatier (https://github.com/cpplint/cpplint/pull/231)

dev-requirements

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
# also change in tox.ini
44
flake8>=4.0.1
5-
flake8-polyfill
65
pylint>=2.11.0
7-
tox<5.0.0
8-
tox-gh-actions<4.0.0
96
importlib-metadata>=0.12
10-
setuptools==58.2.0
7+
setuptools

setup.cfg

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ test = pytest
55
python_files = *test.py
66
testpaths = .
77
# running with tox reports only 75%
8-
addopts = --cov-fail-under=75 --cov=cpplint
9-
filterwarnings =
10-
ignore:.*:DeprecationWarning
8+
addopts = --cov-fail-under=75 --cov=cpplint --color=yes

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env python
22
from setuptools import setup
3-
import cpplint as cpplint
3+
import cpplint
44

55
# some pip versions bark on comments (e.g. on travis)
66
def read_without_comments(filename):

test-requirements

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# minimal requirements to run python setup.py test
2-
# 5.x requires python 3.5
1+
# requirements for testing steps
2+
tox<5.0.0
3+
4+
# also change in tox.ini
35
pytest
46
pytest-cov
57
testfixtures

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ deps =
1919
pytest
2020
pytest-cov
2121
testfixtures
22-
setuptools==58.2.0
22+
setuptools
2323

2424
commands =
2525
{envpython} -m pytest

0 commit comments

Comments
 (0)