diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df370c1..634afcc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -Ue .[test] + pip install -Ue . --group test pip install -Ue . - name: Run tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c7a60d2..7490193 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,6 +54,11 @@ repos: - id: conventional-pre-commit stages: [commit-msg] args: ["--strict"] + - repo: https://github.com/astral-sh/ty-pre-commit + rev: v0.0.57 + hooks: + - id: ty + stages: [manual] - repo: https://github.com/pre-commit/mirrors-mypy rev: v2.2.0 hooks: diff --git a/Makefile b/Makefile index f51821b..d8c5eae 100755 --- a/Makefile +++ b/Makefile @@ -1,13 +1,30 @@ #!/usr/bin/make -f +.PHONY: dist pushrelease pushreleasetest clean lint lint-fix format + dist: - python3 setup.py sdist bdist_wheel + python3 setup.py sdist bdist_wheel pushreleasetest: - python3 -m twine upload --repository testpypi dist/* + python3 -m twine upload --repository testpypi dist/* pushrelease: - python3 -m twine upload dist/* + python3 -m twine upload dist/* clean: - $(RM) -r dist + $(RM) -r dist + +lint: + -prek run -a + +lint-fix: + -prek run -a --hook-stage manual ruff-fix + +format: + -prek run -a --hook-stage manual ruff-format + +ty: + -prek run -a --hook-stage manual ty + +mypy: + -prek run -a --hook-stage manual mypy diff --git a/pyproject.toml b/pyproject.toml index 40f427d..31d2a85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,8 @@ requires-python = ">=3.8" [project.optional-dependencies] xml = ["defusedxml"] hal = ["uritemplate"] + +[dependency-groups] test = [ "pytest", "pytest-cov", @@ -70,6 +72,21 @@ exclude_lines = [ "pragma: no cover", ] +[tool.ty.terminal] +output-format = "concise" + +[tool.ty.environment] +python-version = "3.8" + +[tool.mypy] +python_version = "3.10" +strict = true +show_error_codes = true +explicit_package_bases = true +namespace_packages = true +mypy_path = ["httoop"] +files = ["httoop/"] + [tool.ruff] line-length = 180 target-version = "py37"