-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 restructure the whole project and ensure best practices
- Loading branch information
Showing
42 changed files
with
598 additions
and
523 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[run] | ||
source = | ||
kiss_headers | ||
# Needed for Python 3.11 and lower | ||
disable_warnings = no-sysmon | ||
|
||
[paths] | ||
source = | ||
src/kiss_headers | ||
*/kiss_headers | ||
*\kiss_headers | ||
|
||
[report] | ||
exclude_lines = | ||
except ModuleNotFoundError: | ||
except ImportError: | ||
pass | ||
import | ||
raise NotImplementedError | ||
.* # Platform-specific.* | ||
.*:.* # Python \d.* | ||
.* # Abstract | ||
.* # Defensive: | ||
if (?:typing.)?TYPE_CHECKING: | ||
^\s*?\.\.\.\s*$ |
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,18 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
ignore: | ||
# Ignore all patch releases as we can manually | ||
# upgrade if we run into a bug and need a fix. | ||
- dependency-name: "*" | ||
update-types: ["version-update:semver-patch"] | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: [ "version-update:semver-patch" ] |
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
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,25 @@ | ||
exclude: 'docs/' | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.9.1 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
args: [ --fix, --target-version=py37 ] | ||
# Run the formatter. | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.14.1 | ||
hooks: | ||
- id: mypy | ||
args: [ --check-untyped-defs ] | ||
exclude: 'noxfile.py|tests/' |
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
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 |
---|---|---|
@@ -1,9 +1,3 @@ | ||
requests>=2.10 | ||
black | ||
pytest | ||
pytest-cov | ||
codecov | ||
isort | ||
mypy | ||
mkdocs | ||
mkdocs-material | ||
pytest>=2.8.0,<=7.4.4 | ||
coverage>=7.2.7,<7.7 |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from __future__ import annotations | ||
|
||
import os | ||
|
||
import nox | ||
|
||
|
||
@nox.session( | ||
python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy"] | ||
) | ||
def test(session: nox.Session) -> None: | ||
# Install deps and the package itself. | ||
session.install("-U", "pip", "setuptools", silent=False) | ||
session.install("-r", "dev-requirements.txt", silent=False) | ||
|
||
session.install(".", silent=False) | ||
|
||
# Show the pip version. | ||
session.run("pip", "--version") | ||
# Print the Python version and bytesize. | ||
session.run("python", "--version") | ||
|
||
# Inspired from https://hynek.me/articles/ditch-codecov-python/ | ||
# We use parallel mode and then combine in a later CI step | ||
session.run( | ||
"python", | ||
"-m", | ||
"coverage", | ||
"run", | ||
"--parallel-mode", | ||
"-m", | ||
"pytest", | ||
"-v", | ||
"-ra", | ||
f"--color={'yes' if 'GITHUB_ACTIONS' in os.environ else 'auto'}", | ||
"--tb=native", | ||
"--durations=10", | ||
"--strict-config", | ||
"--strict-markers", | ||
*session.posargs, | ||
env={ | ||
"PYTHONWARNINGS": "always::DeprecationWarning", | ||
"COVERAGE_CORE": "sysmon", | ||
"PY_IGNORE_IMPORTMISMATCH": "1", | ||
}, | ||
) | ||
|
||
|
||
@nox.session() | ||
def format(session: nox.Session) -> None: | ||
"""Run code formatters.""" | ||
lint(session) | ||
|
||
|
||
@nox.session | ||
def lint(session: nox.Session) -> None: | ||
session.install("pre-commit") | ||
session.run("pre-commit", "run", "--all-files") |
Oops, something went wrong.