import Callable, Iterable from collections.abs instead of typing.

update tests to reflect changes in the API.

reorganise hatch envs

add black,isort configs to pyproject.toml

add pre-commit config
This commit is contained in:
2025-02-11 09:51:00 +00:00
parent 0fe78197fc
commit 797161a6f2
10 changed files with 94 additions and 41 deletions

View File

@@ -17,14 +17,6 @@ dependencies = [
"websocket-client",
]
[project.optional-dependencies]
dev = [
"black",
"isort",
"pytest",
"pytest-randomly",
]
[project.urls]
Homepage = "https://github.com/aatikturk/obsws-python"
@@ -36,19 +28,58 @@ include = [
"/obsws_python",
]
[tool.hatch.envs.default]
dependencies = ["pre-commit"]
[tool.hatch.envs.e]
dependencies = ["keyboard"]
[tool.hatch.envs.e.scripts]
events = "python {root}\\examples\\events\\."
hotkeys = "python {root}\\examples\\hotkeys\\."
levels = "python {root}\\examples\\levels\\."
scene_rotate = "python {root}\\examples\\scene_rotate\\."
[tool.hatch.envs.test]
[tool.hatch.envs.hatch-test]
randomize = true
[tool.hatch.envs.hatch-test.scripts]
run = "pytest{env:HATCH_TEST_ARGS:} {args}"
[[tool.hatch.envs.hatch-test.matrix]]
python = ["313", "312", "311", "310", "39"]
[tool.hatch.envs.style]
detached = true
dependencies = [
"pytest",
"black",
"isort",
]
[tool.hatch.envs.test.scripts]
run = 'pytest -v'
[tool.hatch.envs.style.scripts]
check = [
"black --check --diff .",
"isort --check-only --diff .",
]
fmt = [
"isort .",
"black .",
]
[[tool.hatch.envs.test.matrix]]
python = ["39", "310", "311", "312"]
[tool.black]
line-length = 88
include = '\.pyi?$'
# 'extend-exclude' excludes files or directories in addition to the defaults
extend-exclude = '''
(
^/\.git/ # exclude all files in the .git directory
^/\.hatch/ # exclude all files in the .hatch directory
^/\.pytest_cache/ # exclude all files in the .pytest_cache directory
| .*_pb2.py # exclude autogenerated Protocol Buffer files anywhere in the project
)
'''
[tool.isort]
profile = "black"
skip = [".gitignore", ".dockerignore"]
skip_glob = [".git/*", ".hatch/*", ".pytest_cache/*"]