Skip to content

Commit 9e11698

Browse files
committed
feat: Add pyproject.toml
1 parent 780ed02 commit 9e11698

File tree

3 files changed

+64
-28
lines changed

3 files changed

+64
-28
lines changed

.pre-commit-config.yaml

+1-8
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@ repos:
33
rev: v4.3.0
44
hooks:
55
- id: trailing-whitespace
6-
exclude: \.output
76
- id: end-of-file-fixer
8-
exclude: \.(cp?p?$|output)
97
- id: check-docstring-first
108
- id: check-added-large-files
119
- id: check-yaml
12-
- id: debug-statements
10+
- id: check-toml
1311
- id: requirements-txt-fixer
14-
- repo: https://github.com/asottile/reorder_python_imports
15-
rev: v3.7.0
16-
hooks:
17-
- id: reorder-python-imports
18-
language_version: python3
1912
- repo: https://github.com/asottile/pyupgrade
2013
rev: v2.36.0
2114
hooks:

pyproject.toml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "setuptools-scm", "clang-tools>=0.2.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "cpp_linter_hooks"
7+
description = "Automatically check c/c++ with clang-format and clang-tidy"
8+
readme = "README.md"
9+
keywords = ["clang", "clang-format", "clang-tidy", "pre-commit", "pre-commit-hooks"]
10+
license = {text = "MIT License"}
11+
authors = [
12+
{ name = "Peter Shen", email = "[email protected]" },
13+
]
14+
classifiers = [
15+
# https://pypi.org/pypi?%3Aaction=list_classifiers
16+
"Development Status :: 4 - Beta",
17+
"Intended Audience :: Developers",
18+
"Intended Audience :: System Administrators",
19+
"Intended Audience :: Information Technology",
20+
"Natural Language :: English",
21+
"Operating System :: Microsoft :: Windows",
22+
"Operating System :: POSIX :: Linux",
23+
"Operating System :: MacOS",
24+
"Programming Language :: Python :: 3",
25+
"Topic :: Software Development :: Build Tools",
26+
]
27+
dynamic = ["version"]
28+
29+
[project.scripts]
30+
clang-format-hook = "cpp_linter_hooks.clang_format:main"
31+
clang-tidy-hook = "cpp_linter_hooks.clang_tidy:main"
32+
33+
[project.urls]
34+
source = "https://github.com/cpp-linter/cpp-linter-hooks"
35+
tracker = "https://github.com/cpp-linter/cpp-linter-hooks/issues"
36+
37+
# ... other project metadata fields as specified in:
38+
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
39+
40+
[tool.setuptools]
41+
zip-safe = false
42+
packages = ["cpp_linter_hooks"]
43+
44+
[tool.setuptools_scm]
45+
# It would be nice to include the commit hash in the version, but that
46+
# can't be done in a PEP 440-compatible way.
47+
version_scheme= "no-guess-dev"
48+
# Test PyPI does not support local versions.
49+
local_scheme = "no-local-version"
50+
fallback_version = "0.0.0"
51+
52+
[tool.mypy]
53+
show_error_codes = true
54+
show_column_numbers = true

setup.py

+9-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
from setuptools import find_packages
2-
from setuptools import setup
1+
#!/usr/bin/env python
2+
"""Info used for installing the cpp-linter-hooks package.
3+
Since using setup.py is no longer std convention,
4+
all install information is located in pyproject.toml
5+
"""
36

4-
setup(
5-
name='cpp_linter_hooks',
6-
description='Automatically check c/c++ with clang-format and clang-tidy',
7-
url='https://github.com/cpp-linter/cpp-linter-hooks',
8-
version='0.2.1',
9-
author="Peter Shen",
10-
author_email="[email protected]",
11-
license="MIT",
12-
keywords="clang clang-tidy clang-format pre-commit pre-commit-hooks",
13-
packages=find_packages(),
14-
install_requires=['clang-tools>=0.2.2'],
15-
entry_points={
16-
"console_scripts": [
17-
"clang-format-hook=cpp_linter_hooks.clang_format:main",
18-
"clang-tidy-hook=cpp_linter_hooks.clang_tidy:main",
19-
]
20-
},
21-
)
7+
import setuptools
8+
9+
10+
setuptools.setup()

0 commit comments

Comments
 (0)