Skip to content

Commit

Permalink
chore: update pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <[email protected]>
  • Loading branch information
Stranger6667 committed Aug 6, 2024
1 parent 34b7556 commit 6445424
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 63 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -20,23 +20,23 @@ repos:
- id: gitlint

- repo: https://github.com/adrienverge/yamllint
rev: v1.33.0
rev: v1.35.1
hooks:
- id: yamllint

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.11.1
hooks:
- id: mypy
exclude: ^(docs/|test/).*$
args: ["--ignore-missing-imports"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.5.6
hooks:
- id: ruff-format

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.5.6
hooks:
- id: ruff
101 changes: 43 additions & 58 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,32 @@ version = "0.11.0"
description = "Hypothesis strategies for GraphQL queries"
keywords = ["hypothesis", "graphql", "testing"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Framework :: Hypothesis",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Testing",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Framework :: Hypothesis",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Testing",
]
authors = [{ name = "Dmitry Dygalo", email = "[email protected]" }]
maintainers = [{ name = "Dmitry Dygalo", email = "[email protected]" }]
readme = "README.md"
license = "MIT"
include = ["src/hypothesis_graphql/py.typed"]
requires-python = ">=3.8"
dependencies = [
"hypothesis>=6.84.3,<7.0",
"graphql-core>=3.1.0,<3.3.0",
]
dependencies = ["hypothesis>=6.84.3,<7.0", "graphql-core>=3.1.0,<3.3.0"]

[project.optional-dependencies]
tests = [
"coverage>=7",
"pytest>=6.2.0,<8",
"pytest-xdist>=2.5,<3.0",
]
cov = [
"coverage-enable-subprocess",
"coverage[toml]>=7",
]
tests = ["coverage>=7", "pytest>=6.2.0,<8", "pytest-xdist>=2.5,<3.0"]
cov = ["coverage-enable-subprocess", "coverage[toml]>=7"]
dev = ["hypothesis_graphql[tests,cov]"]

[project.urls]
Expand All @@ -53,10 +43,7 @@ Funding = "https://github.com/sponsors/Stranger6667"
"Source Code" = "https://github.com/Stranger6667/hypothesis-graphql"

[tool.hatch.build.targets.sdist]
include = [
"/src",
"/test",
]
include = ["/src", "/test"]

[tool.coverage.run]
parallel = true
Expand All @@ -70,47 +57,45 @@ source = ["src", ".tox/*/site-packages"]
show_missing = true
skip_covered = true
precision = 2
exclude_lines = [
"raise NotImplementedError",
"if TYPE_CHECKING:",
"pass"
]
exclude_lines = ["raise NotImplementedError", "if TYPE_CHECKING:", "pass"]

[tool.ruff]
line-length = 120
target-version = "py38"

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"C", # flake8-comprehensions
"B", # flake8-bugbear
"D", # pydocstyle
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"C", # flake8-comprehensions
"B", # flake8-bugbear
"D", # pydocstyle
]
ignore = [
"E501", # Line too long
"B008", # Do not perform function calls in argument defaults
"C901", # Too complex
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"D203", # One blank line before class
"D213", # Multiline summary second line
"D401", # Imperative mood
"E501", # Line too long
"B008", # Do not perform function calls in argument defaults
"C901", # Too complex
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"D203", # One blank line before class
"D213", # Multiline summary second line
"D401", # Imperative mood
]
target-version = "py38"

# Ignore `F401` (unused import) in all `__init__.py` files.
[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"strategies.py" = ["F401"]

[tool.ruff.format]
skip-magic-trailing-comma = false

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["hypothesis_graphql"]
known-third-party = ["graphql", "hypothesis", "pytest"]
1 change: 1 addition & 0 deletions src/hypothesis_graphql/_strategies/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Most of them exist to avoid using lambdas, which might become expensive in Hypothesis in some cases.
"""

from functools import lru_cache
from typing import Callable, List, Optional, Tuple

Expand Down
1 change: 1 addition & 0 deletions src/hypothesis_graphql/_strategies/primitives.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Strategies for simple types like scalars or enums."""

from functools import lru_cache
from typing import Optional, Tuple, Type, TypeVar, Union

Expand Down

0 comments on commit 6445424

Please sign in to comment.