Skip to content

Commit

Permalink
chore: update pre-commit hooks (#177)
Browse files Browse the repository at this point in the history
* chore: update pre-commit hooks

updates:
- [github.com/psf/black-pre-commit-mirror: 23.9.1 → 23.10.1](psf/black-pre-commit-mirror@23.9.1...23.10.1)
- [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.3](astral-sh/ruff-pre-commit@v0.0.292...v0.1.3)

* chore: move to ruff-format

Signed-off-by: Henry Schreiner <[email protected]>

* chore: fix exclusion of main files from formatter

Signed-off-by: Henry Schreiner <[email protected]>

---------

Signed-off-by: Henry Schreiner <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and henryiii authored Oct 30, 2023
1 parent ce14b7a commit fdc2244
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
10 changes: 2 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,13 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace

# Black, the code formatter, natively supports pre-commit
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
files: ^(docs)

# Lints code
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.292"
rev: "v0.1.3"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ requires = [
]
build-backend = "setuptools.build_meta"


[tool.cibuildwheel]
test-command = "python {project}/tests/test.py"
test-skip = "*universal2:arm64"


[tool.ruff]
target-version = "py37"

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"PGH", # pygrep-hooks
"RUF", # Ruff-specific
"UP", # pyupgrade
]
extend-ignore = [
"E501", # Line too long
]
target-version = "py37"
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
# reproducible builds (https://github.com/pybind/python_example/pull/53)

ext_modules = [
Pybind11Extension("python_example",
Pybind11Extension(
"python_example",
["src/main.cpp"],
# Example: passing in the version to the compiled code
define_macros = [('VERSION_INFO', __version__)],
),
define_macros=[("VERSION_INFO", __version__)],
),
]

setup(
Expand Down
2 changes: 1 addition & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import python_example as m

assert m.__version__ == '0.0.1'
assert m.__version__ == "0.0.1"
assert m.add(1, 2) == 3
assert m.subtract(1, 2) == -1

0 comments on commit fdc2244

Please sign in to comment.