Skip to content

Commit 755497f

Browse files
authored
PEP 621: Migrate from setup.{py, cfg} to pyproject.toml (#315)
https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html * https://peps.python.org/pep-0621 Migrate `setup.py` to `setup.cfg` using [setuptools-py2cfg](https://pypi.org/project/setuptools-py2cfg) plus manual modifications. Then migrate `setup.cfg` to `pyproject.toml` using [ini2toml](https://pypi.org/project/ini2toml) to do the file conversion and running [pyproject-fmt](https://pypi.org/project/pyproject-fmt) and then [validate-pyproject](https://github.com/abravalheri/validate-pyproject) to validate the results. ```yaml strategy: matrix: fail-fast: false # Python 3.8 is EOL. Also adapt tox.ini python-version: ['3.8', 'pypy3.11', '3.13'] # macOS on ARM, Ubuntu on x86, Windows on X86 os: [macos-latest, ubuntu-latest, windows-latest] ```
1 parent 181d47f commit 755497f

File tree

8 files changed

+84
-94
lines changed

8 files changed

+84
-94
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ jobs:
1818
build-test:
1919
runs-on: ${{ matrix.os }}
2020
strategy:
21-
matrix:
22-
# Python 3.8 is the last non-EOL version. Also adapt tox.ini
23-
python-version: ['3.8', 'pypy3.10', '3.12']
24-
os: [ubuntu-latest, windows-latest]
2521
fail-fast: false
22+
matrix:
23+
# Python 3.8 is EOL. Also adapt tox.ini
24+
python-version: ['3.8', 'pypy3.11', '3.x']
25+
# macOS on ARM, Ubuntu on x86, Windows on X86
26+
os: [macos-latest, ubuntu-latest, windows-latest]
2627
steps:
2728
- name: Checkout
2829
uses: actions/checkout@v4
@@ -32,13 +33,11 @@ jobs:
3233
uses: actions/setup-python@v5
3334
with:
3435
python-version: ${{ matrix.python-version }}
35-
architecture: x64
3636
cache: 'pip'
37-
cache-dependency-path: '**/test-requirements'
37+
cache-dependency-path: 'pyproject.toml'
3838
- name: Install dependencies
3939
run: |
4040
python -m pip install --upgrade pip
41-
python -m pip install -e .[dev]
42-
python -m pip install 'tox-gh-actions<4.0.0'
41+
python -m pip install --editable .[dev]
4342
- name: Test with tox
44-
run: tox
43+
run: tox -e py

cpplint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import codecs
4545
import collections
4646
import copy
47-
import getopt
47+
import getopt # pylint: disable=deprecated-module
4848
import glob
4949
import itertools
5050
import math # for log

dev-requirements

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,77 @@
11
[build-system]
2-
build-backend = "setuptools.build_meta:__legacy__"
3-
requires = [
2+
build-backend = "setuptools.build_meta"
3+
requires = [ "setuptools>=61.2" ]
4+
5+
[project]
6+
name = "cpplint"
7+
version = "2.0.0"
8+
description = "Automated checker to ensure C++ files follow Google's style guide"
9+
readme = "README.rst"
10+
keywords = [ "c++", "lint", "python" ]
11+
license = { text = "BSD-3-Clause" }
12+
maintainers = [ { name = "cpplint Developers" } ]
13+
requires-python = ">=3.8"
14+
classifiers = [
15+
"Development Status :: 5 - Production/Stable",
16+
"Environment :: Console",
17+
"Intended Audience :: End Users/Desktop",
18+
"License :: Freely Distributable",
19+
"License :: OSI Approved :: BSD License",
20+
"Natural Language :: English",
21+
"Programming Language :: C++",
22+
"Programming Language :: Python :: 3 :: Only",
23+
"Programming Language :: Python :: 3.8",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
28+
"Programming Language :: Python :: 3.13",
29+
"Topic :: Software Development :: Quality Assurance",
30+
]
31+
dependencies = [ ]
32+
33+
optional-dependencies.dev = [
34+
"flake8>=4.0.1",
35+
"parameterized",
36+
"pylint>=2.11",
37+
"pytest",
38+
"pytest-cov",
39+
"pytest-timeout",
440
"setuptools",
5-
"wheel",
41+
"testfixtures",
42+
"tox<5",
43+
]
44+
optional-dependencies.test = [
45+
"parameterized",
46+
"pytest",
47+
"pytest-cov",
48+
"pytest-timeout",
49+
"testfixtures",
50+
"tox<5",
51+
]
52+
optional-dependencies.testing = [
53+
"parameterized",
54+
"pytest",
55+
"pytest-cov",
56+
"pytest-timeout",
57+
"testfixtures",
58+
"tox<5",
659
]
60+
urls.Download = "https://github.com/cpplint/cpplint"
61+
urls.Homepage = "https://github.com/cpplint/cpplint"
62+
scripts.cpplint = "cpplint:main"
63+
64+
[tool.setuptools]
65+
py-modules = [ "cpplint" ]
66+
include-package-data = false
67+
68+
[tool.pytest.ini_options]
69+
python_files = [ "*test.py" ]
70+
testpaths = [ "." ]
71+
required_plugins = [ "pytest-cov", "pytest-timeout" ]
72+
timeout = 60
73+
# fail if coverage is under 90%
74+
addopts = "--color=yes --cov-fail-under=90 --cov=cpplint"
75+
76+
[tool.aliases]
77+
test = "pytest"

setup.cfg

Lines changed: 0 additions & 10 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

test-requirements

Lines changed: 0 additions & 8 deletions
This file was deleted.

tox.ini

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
[tox]
2-
envlist = py38, py39, py3.10, py311, py312, pypy3
2+
envlist = py38, py39, py3.10, py311, py312, py313, pypy3
33
skip_missing_interpreters = true
44

5-
[gh-actions]
6-
python =
7-
3.8: py38
8-
3.9: py39
9-
3.10: py310
10-
3.11: py311
11-
3.12: py312
12-
pypy3.10: pypy3
13-
145
[testenv]
156
extras = dev
167

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy