Skip to content

Commit

Permalink
feat: consolidate ruff and mypy config in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Aug 1, 2024
1 parent 18d00c9 commit 8823827
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 49 deletions.
36 changes: 0 additions & 36 deletions mypy.ini

This file was deleted.

2 changes: 0 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ def types(session):
@nox.session(python=PYTHON_ALL_VERSIONS)
def tests(session):
session.install("pip")
session.install("setuptools")
session.install("-e", ".[dev]")
session.run("pytest")


@nox.session
def docs(session):
session.install("pip")
session.install("setuptools")
session.install("-e", ".[docs]")
session.run(
"python",
Expand Down
57 changes: 57 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,60 @@ tag-pattern = '(\d\d\d\d\d\d\d\d)'

[tool.hatch.build.targets.wheel]
packages = ["pdfminer"]

[tool.ruff]
namespace-packages = ["pdfminer"]

[tool.ruff.lint]
extend-select = [
"W", # pycodestyle warnings
"I", # isort
"TID" # flake8 tidy imports
]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.mypy]
warn_unused_configs = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_return_any = true
no_implicit_reexport = true
strict_equality = true

# This seems impossible to turn on in a version-independent manner
warn_unused_ignores = false

[[tool.mypy.overrides]]
module = "pdfminer.*"
disallow_untyped_defs = true

[[tool.mypy.overrides]]
module = "cryptography.hazmat.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "setuptools.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "pytest.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "nox.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "charset_normalizer.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "atheris.*"
ignore_missing_imports = true
11 changes: 0 additions & 11 deletions ruff.toml

This file was deleted.

0 comments on commit 8823827

Please sign in to comment.