Skip to content

feat: Add pyproject.toml #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2022
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
9 changes: 1 addition & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@ repos:
rev: v4.3.0
hooks:
- id: trailing-whitespace
exclude: \.output
- id: end-of-file-fixer
exclude: \.(cp?p?$|output)
- id: check-docstring-first
- id: check-added-large-files
- id: check-yaml
- id: debug-statements
- id: check-toml
- id: requirements-txt-fixer
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.7.0
hooks:
- id: reorder-python-imports
language_version: python3
- repo: https://github.com/asottile/pyupgrade
rev: v2.36.0
hooks:
Expand Down
54 changes: 54 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[build-system]
requires = ["setuptools>=45", "setuptools-scm", "clang-tools>=0.2.2"]
build-backend = "setuptools.build_meta"

[project]
name = "cpp_linter_hooks"
description = "Automatically check c/c++ with clang-format and clang-tidy"
readme = "README.md"
keywords = ["clang", "clang-format", "clang-tidy", "pre-commit", "pre-commit-hooks"]
license = {text = "MIT License"}
authors = [
{ name = "Peter Shen", email = "[email protected]" },
]
classifiers = [
# https://pypi.org/pypi?%3Aaction=list_classifiers
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Intended Audience :: Information Technology",
"Natural Language :: English",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Build Tools",
]
dynamic = ["version"]

[project.scripts]
clang-format-hook = "cpp_linter_hooks.clang_format:main"
clang-tidy-hook = "cpp_linter_hooks.clang_tidy:main"

[project.urls]
source = "https://github.com/cpp-linter/cpp-linter-hooks"
tracker = "https://github.com/cpp-linter/cpp-linter-hooks/issues"

# ... other project metadata fields as specified in:
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

[tool.setuptools]
zip-safe = false
packages = ["cpp_linter_hooks"]

[tool.setuptools_scm]
# It would be nice to include the commit hash in the version, but that
# can't be done in a PEP 440-compatible way.
version_scheme= "no-guess-dev"
# Test PyPI does not support local versions.
local_scheme = "no-local-version"
fallback_version = "0.0.0"

[tool.mypy]
show_error_codes = true
show_column_numbers = true
29 changes: 9 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
from setuptools import find_packages
from setuptools import setup
#!/usr/bin/env python
"""Info used for installing the cpp-linter-hooks package.
Since using setup.py is no longer std convention,
all install information is located in pyproject.toml
"""

setup(
name='cpp_linter_hooks',
description='Automatically check c/c++ with clang-format and clang-tidy',
url='https://github.com/cpp-linter/cpp-linter-hooks',
version='0.2.1',
author="Peter Shen",
author_email="[email protected]",
license="MIT",
keywords="clang clang-tidy clang-format pre-commit pre-commit-hooks",
packages=find_packages(),
install_requires=['clang-tools>=0.2.2'],
entry_points={
"console_scripts": [
"clang-format-hook=cpp_linter_hooks.clang_format:main",
"clang-tidy-hook=cpp_linter_hooks.clang_tidy:main",
]
},
)
import setuptools


setuptools.setup()