-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
921f33d
commit c353b44
Showing
10 changed files
with
89 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
minimum_pre_commit_version: "2.21.0" # rust version selection | ||
ci: | ||
skip: [taplo] | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
|
@@ -12,18 +9,18 @@ repos: | |
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v4.0.0-alpha.8 | ||
- id: ruff | ||
args: [--preview, --select=CPY] | ||
- id: ruff-format | ||
- repo: https://github.com/biomejs/pre-commit | ||
rev: v0.5.0 | ||
hooks: | ||
- id: prettier | ||
additional_dependencies: | ||
- prettier | ||
- prettier-plugin-jinja-template | ||
- repo: https://github.com/ComPWA/mirrors-taplo | ||
rev: v0.8.1 | ||
- id: biome-format | ||
additional_dependencies: ["@biomejs/[email protected]"] | ||
- repo: https://github.com/tox-dev/pyproject-fmt | ||
rev: v2.5.0 | ||
hooks: | ||
- id: taplo | ||
language_version: stable | ||
- id: pyproject-fmt | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.13.0 | ||
hooks: | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"recommendations": ["charliermarsh.ruff", "ms-python.python"], | ||
"recommendations": [ | ||
"charliermarsh.ruff", | ||
"ms-python.python", | ||
"biomejs.biome", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"overrides": [ | ||
{ | ||
"include": ["./.vscode/*.json", "**/*.jsonc"], | ||
"json": { | ||
"formatter": { | ||
"trailingCommas": "all", | ||
"indentStyle": "space", | ||
"indentWidth": 4, | ||
}, | ||
"parser": { | ||
"allowComments": true, | ||
"allowTrailingCommas": true, | ||
}, | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,70 @@ | ||
[build-system] | ||
build-backend = "hatchling.build" | ||
requires = [ "hatch-docstring-description", "hatch-vcs", "hatchling" ] | ||
|
||
[project] | ||
dynamic = ["version", "description"] | ||
name = "legacy-api-wrap" | ||
authors = [{ name = "Philipp A.", email = "[email protected]" }] | ||
urls.Source = "https://github.com/flying-sheep/legacy-api-wrap" | ||
readme = "README.rst" | ||
license = "MPL-2.0" | ||
authors = [ { name = "Philipp A.", email = "[email protected]" } ] | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Typing :: Typed", | ||
] | ||
dependencies = [] | ||
[project.optional-dependencies] | ||
test = [ | ||
"pytest", | ||
dynamic = [ "description", "version" ] | ||
dependencies = [ ] | ||
optional-dependencies.test = [ | ||
"anyconfig[toml]>=0.14", # coverage-rich uses anyconfig | ||
"coverage", | ||
"coverage-rich", | ||
"anyconfig[toml] >=0.14", # coverage-rich uses anyconfig | ||
"pytest", | ||
] | ||
urls.Source = "https://github.com/flying-sheep/legacy-api-wrap" | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
[tool.hatch.build.targets.wheel] | ||
packages = [ "src/legacy_api_wrap", "src/testing/legacy_api_wrap" ] | ||
|
||
[tool.hatch.envs.test] | ||
features = [ "test" ] | ||
[tool.hatch.envs.test.scripts] | ||
run = "pytest {args}" | ||
cov = "coverage run -m pytest {args} && coverage-rich report && coverage html" | ||
[[tool.hatch.envs.test.matrix]] | ||
python = [ "3.8", "3.9", "3.10", "3.11" ] | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
select = ["ALL"] | ||
ignore = [ | ||
"D203", # zero instead of one blank lines before class | ||
"D213", # multiline summary on first instead of second line | ||
lint.select = [ "ALL" ] | ||
lint.ignore = [ | ||
"COM812", # incompatible with formatter | ||
"D203", # zero instead of one blank lines before class | ||
"D213", # multiline summary on first instead of second line | ||
"ISC001", # incompatible with formatter | ||
] | ||
allowed-confusables = ["’"] | ||
[tool.ruff.isort] | ||
known-first-party = ["legacy_api_wrap"] | ||
required-imports = ["from __future__ import annotations"] | ||
[tool.ruff.extend-per-file-ignores] | ||
"src/testing/*.py" = ["INP001"] | ||
"tests/**/test_*.py" = [ | ||
lint.extend-per-file-ignores."src/testing/*.py" = [ "INP001" ] | ||
lint.extend-per-file-ignores."tests/**/test_*.py" = [ | ||
"D100", # tests need no module docstrings | ||
"D103", # tests need no function docstrings | ||
"INP001", # tests should not have __init__.py | ||
"PLR2004", # tests use magic values | ||
"S101", # tests use `assert` | ||
] | ||
|
||
[tool.mypy] | ||
strict = true | ||
explicit_package_bases = true | ||
mypy_path = "src" | ||
lint.allowed-confusables = [ "’" ] | ||
lint.flake8-copyright.notice-rgx = "SPDX-License-Identifier: MPL-2\\.0" | ||
lint.isort.known-first-party = [ "legacy_api_wrap" ] | ||
lint.isort.required-imports = [ "from __future__ import annotations" ] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = [ | ||
|
@@ -62,22 +80,10 @@ addopts = [ | |
run.data_file = "test-data/coverage" | ||
xml.output = "test-data/coverage.xml" | ||
html.directory = "test-data/htmlcov" | ||
run.omit = ["src/testing/*", "tests/*"] | ||
report.exclude_also = ["if TYPE_CHECKING:"] | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/legacy_api_wrap", "src/testing/legacy_api_wrap"] | ||
run.omit = [ "src/testing/*", "tests/*" ] | ||
report.exclude_also = [ "if TYPE_CHECKING:" ] | ||
|
||
[tool.hatch.envs.test] | ||
features = ["test"] | ||
[tool.hatch.envs.test.scripts] | ||
run = "pytest {args}" | ||
cov = "coverage run -m pytest {args} && coverage-rich report && coverage html" | ||
[[tool.hatch.envs.test.matrix]] | ||
python = ["3.8", "3.9", "3.10", "3.11"] | ||
|
||
[build-system] | ||
requires = ["hatchling", "hatch-vcs", "hatch-docstring-description"] | ||
build-backend = "hatchling.build" | ||
[tool.mypy] | ||
strict = true | ||
explicit_package_bases = true | ||
mypy_path = "src" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# SPDX-License-Identifier: MPL-2.0 | ||
"""Legacy API wrapper. | ||
>>> from legacy_api_wrap import legacy_api | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
# SPDX-License-Identifier: MPL-2.0 | ||
"""Testing utils for legacy_api_wrap.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# SPDX-License-Identifier: MPL-2.0 | ||
"""Pytest plugin for legacy_api_wrap.""" | ||
|
||
from __future__ import annotations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# SPDX-License-Identifier: MPL-2.0 | ||
from __future__ import annotations | ||
|
||
from inspect import signature | ||
|