-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
150 lines (142 loc) · 3.67 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
[tool]
[tool.poetry]
name = "graphene-django-permissions"
version = "1.0.0"
homepage = "https://github.com/sjdemartini/graphene-django-permissions"
description = "A performant holistic permissions layer for graphene-django/GraphQL."
authors = ["Steven DeMartini <[email protected]>"]
readme = "README.md"
license = "MIT"
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
]
packages = [
{ include = "graphene_django_permissions" },
{ include = "tests", format = "sdist" },
]
[tool.poetry.dependencies]
python = ">=3.7,<4.0"
graphene-django = ">=3.0.2"
[tool.poetry.dev-dependencies]
black = "22.12.0"
django-stubs = "4.2.0"
mypy = "1.2.0"
pytest = "^7.1.2"
pytest-cov = "^3.0.0"
pytest-django = "^4.5.2"
ruff = "0.0.264"
tox = "^4.5.1"
twine = "^4.0.0"
pre-commit = "^2.19.0"
toml = "^0.10.2"
bump2version = "^1.0.1"
graphql-core = "~3.1.7" # 3.2+ appears to be incompatible with graphene currently
graphene-django-optimizer = "^0.9.0"
factory-boy = "^3.2.1"
[tool.pytest.ini_options]
addopts = "--ds=tests.settings"
testpaths = [
"tests",
]
python_files = [
"test_*.py",
]
[tool.black]
line-length = 88
preview = true # Format strings
target-version = ['py37', 'py38']
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| build
| dist
)/
|
.*migrations.* # Never format migrations files
)
'''
[tool.mypy]
python_version = '3.7'
check_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
# For convenience, display the error codes of the violations. Makes it easier to
# `type: ignore[specific-violation]` rather than use sweeping type-ignores.
show_error_codes = true
packages = [
"graphene_django_permissions",
"tests",
]
plugins = ["mypy_django_plugin.main"]
[tool.django-stubs]
django_settings_module = "tests.settings"
[tool.ruff]
select = [
"E",
"F",
"W",
"I", # isort
"B", # flake8-bugbear
"DJ", # flake8-django
"UP", # pyupgrade
"C4", # unnecessary comprehensions (formerly handled by pyupgrade)
"RUF", # Ruff-specific lint-rules https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf
]
ignore = [
# Don't enforce max line length, since black handles line-length automatically for
# code, and disagrees with ruff/flake8 in certain situations
"E501",
# Disable the opinionated bugbear rules
"B9",
# Disable warnings about using __all__ for fields in Django admin
# (https://beta.ruff.rs/docs/rules/django-all-with-model-form/), since the concern is
# minor
"DJ007",
# Disable some "ambiguous unicode char" rules since we're fine with curly quotes
"RUF001",
"RUF002",
"RUF003",
]
line-length = 88
exclude = [
".git",
"__pycache__",
"setup.py",
"build",
"dist",
"docs",
"releases",
".venv",
".tox",
".mypy_cache",
".pytest_cache",
".vscode",
".github",
".coverage",
"*/migrations/*",
]
# Always generate Python 3.7-compatible code.
target-version = "py37"
[tool.ruff.per-file-ignores]
# Ignore warnings about model definitions needing __str__ in the test context
"tests/**/*" = ["DJ008"]