Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ jobs:
- name: ruff format
run: ruff format --check

type:
name: Type
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: 3.14
- name: Install dependencies
run: python -m pip install -r requirements-type.txt
- name: Create _version.py
run: echo '__version__ = ""' > src/pyzstd/_version.py
- name: mypy
run: mypy

publish:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
- Remove git submodule usage
- Drop support for Python 3.9 and below
- Use `ruff` as formatter and linter
- Embed type hints in Python code, and check with `mypy`

## 0.18.0 (October 5, 2025)

Expand Down
48 changes: 43 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,60 @@ version-file = "src/pyzstd/_version.py"
source = "vcs"


#
# mypy
#

[tool.mypy]
# Import discovery
files = "src"
ignore_missing_imports = false
follow_imports = "normal"
# Platform configuration
python_version = "3.14"
# Disallow dynamic typing
disallow_any_unimported = true
disallow_any_decorated = true
disallow_any_generics = true
disallow_subclassing_any = true
# Untyped definitions and calls
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
# None and Optional handling
no_implicit_optional = true
strict_optional = true
# Configuring warning
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true
# Suppressing errors
ignore_errors = false
# Miscellaneous strictness flags
strict_equality = true
# Configuring error messages
show_error_context = true
show_error_codes = true
# Miscellaneous
warn_unused_configs = true


#
# ruff
#

[tool.ruff]
src = ["src"]
target-version = "py310"
extend-exclude = [
"tests",
'*.pyi', # FIXME
]
extend-exclude = ["tests"]

[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN", # FIXME
"C901",
"COM812",
"D",
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-e .

-r requirements-lint.txt
-r requirements-type.txt
1 change: 1 addition & 0 deletions requirements-type.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mypy==1.19.0
Loading