-
Notifications
You must be signed in to change notification settings - Fork 85
/
pyproject.toml
206 lines (192 loc) · 7.52 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# Copyright (C) DATADVANCE, 2010-2023
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Python project configuration.
# File format is STANDARDIZED in the PEP 518:
# https://www.python.org/dev/peps/pep-0518/
# --------------------------------------------------------- BUILD-SYSTEM
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
# --------------------------------------------------------------- POETRY
# Python packaging and dependency management.
# Docs: https://python-poetry.org/docs/
[tool.poetry]
name = "django-channels-graphql-ws"
version = "v1.0.0rc7"
description = """Django Channels based WebSocket GraphQL server with Graphene-like subscriptions"""
authors = ["Alexander A. Prokhorov <[email protected]>"]
homepage = "https://github.com/datadvance/DjangoChannelsGraphqlWs"
repository = "https://github.com/datadvance/DjangoChannelsGraphqlWs"
license = "MIT"
packages = [{ include = "channels_graphql_ws/" }]
# Production dependencies.
# Version syntax: https://python-poetry.org/docs/dependency-specification/
[tool.poetry.dependencies]
python = "^3.8.0"
aiohttp = "^3"
asgiref = "^3"
channels = "^4"
Django = "^4"
graphene = "^3"
graphql-core = "3.2.3" # Carefully test after upgrade, since we path private internals.
msgpack = "^1"
# Development dependencies.
# Version syntax: https://python-poetry.org/docs/dependency-specification/
[tool.poetry.group.dev.dependencies]
black = { version = "*" }
channels = { version = "^4", extras = ["daphne"] }
channels-redis = "*"
coverage = "*"
graphene-django = "*"
isort = { version = "*", extras = ["pyproject"] }
mypy = "*"
plumbum = "*"
pylint = "*"
pylint-django = "*"
pylint-quotes = "*"
pytest = "*"
pytest-asyncio = "*"
pytest-cov = "*"
pytest-django = "*"
pytest-pythonpath = "*"
pytest-xdist = "*"
tox = "*"
# ---------------------------------------------------------------- BLACK
# Black - the uncompromising code formatter.
# https://black.readthedocs.io/en/stable/index.html
[tool.black]
target-version = ['py38', 'py39', 'py310']
# ---------------------------------------------------------------- ISORT
# Isort configuration.
# Docs: https://github.com/timothycrosley/isort/wiki/isort-Settings
[tool.isort]
profile = "black"
# --------------------------------------------------------------- PYLINT
# Pylint code checker configuration.
# - Pylint docs:
# https://pylint.readthedocs.io/en/latest/
# - Configuration reference:
# http://pylint.pycqa.org/en/latest/technical_reference/features.html
[tool.pylint.MASTER]
# Work in parallel.
# Parallel work disabled due to a bug in the pylint-django:
# https://github.com/PyCQA/pylint-django/issues/276
#jobs = "0"
jobs = "1"
# Disable Pylint-quotes until its issue is fixed:
# https://github.com/edaniszewski/pylint-quotes/issues/29.
## load-plugins = "pylint_quotes,pylint_django"
load-plugins = "pylint_django"
# Do not store results of previous runs.
persistent = "no"
# Allow to load C extension modules.
unsafe-load-any-extension = "yes"
[tool.pylint."MESSAGES CONTROL"]
# design: Do not count lines, members, ..., no use.
# similarities: Duplication does not mean bad design by itself.
disable = "design,similarities"
enable = "c-extension-no-member"
[tool.pylint.BASIC]
# It is OK to have 2-letters identifiers, e.g. 'id' or 'ok'. Also allow
# long identifiers, cause there is a strong line length limitation which
# will force engineers to thing twice before giving too long names.
argument-rgx = "[a-z_][a-z0-9_]{1,64}$"
attr-rgx = "[a-z_][a-z0-9_]{1,64}$"
bad-names = "foo,bar,baz,toto,tutu,tata,responce,pathes"
class-attribute-rgx = "([A-Za-z_][A-Za-z0-9_]{1,64}|(__.*__))$"
function-rgx = "[a-z_][a-z0-9_]{1,64}$"
good-names = "i,j,k,ex,Run,_"
method-rgx = "[a-z_][a-z0-9_]{1,64}$"
# Docstrings are needed everywhere.
no-docstring-rgx = "^$"
variable-rgx = "[a-z_][a-z0-9_]{1,64}$"
[tool.pylint.FORMAT]
max-line-length = "88"
max-module-lines = "9000" # Right, over nine thousand!
[tool.pylint.STRING_QUOTES]
docstring-quote = "double"
string-quote = "double-avoid-escape"
triple-quote = "double"
[tool.pylint.PYLINT_DJANGO]
# NOTE: When Pytest runs Pylint this setting is overwritten by the
# environment variable `DJANGO_SETTINGS_MODULE` set by `pytest-django`.
# Anyway, the setting is still useful when VS Code runs Pylint directly.
django-settings-module = "example.settings"
[tool.pylint.REFACTORING]
# We have line length 88, no need to check.
max-nested-blocks = "9000"
[tool.pylint.REPORTS]
reports = "no"
score = "no"
# ------------------------------------------------------------- COVERAGE
# Coverage.py configuration reference:
# https://coverage.readthedocs.io/en/latest/config.html
[tool.coverage.run]
branch = true
# List of packages to measure coverage in.
source = ["channels_graphql_ws/"]
# Do not include test files in the coverage report.
omit = ["**/test_*.py"]
# ------------------------------------------------------------------ TOX
# Tox configuration following Poetry FAQ instructions:
# https://python-poetry.org/docs/faq/#is-tox-supported
# At the moment of writing Tox only supports `pyproject.toml`-based
# configuration though this `legacy_tox_ini` option:
# https://tox.readthedocs.io/en/latest/example/basic.html#pyproject-toml-tox-legacy-ini
[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = true
envlist = py38,py39,py310
[testenv]
allowlist_externals = poetry
commands_pre = poetry install -v
commands = poetry run pytest {posargs}
"""
# ----------------------------------------------------------------- MYPY
# MyPy configuration.
# Docs: https://mypy.readthedocs.io/en/latest/config_file.html
[tool.mypy]
check_untyped_defs = true
ignore_missing_imports = true
warn_return_any = true
warn_unused_configs = true
# --------------------------------------------------------------- PYTEST
# https://docs.pytest.org/en/latest/reference.html#ini-options-ref
[tool.pytest.ini_options]
# Might be useful to enable logging for debug:
# log_cli = true
# log_cli_level = "DEBUG"
# log_cli_format = "[%(levelname)s] [%(asctime)s,%(msecs)s] [%(thread)d %(threadName)s] - %(message)s"
# log_cli_date_format = "%Y-%m-%dT%H:%M:%S"
# pytest-pythonpath:
# Set up paths to import Python modules from.
pythonpath = ". example"
# pytest-django:
# NOTE: This influence to both Pytest and to `pylint_django`, cause
# in fact, it simply sets `DJANGO_SETTINGS_MODULE` environment variable.
DJANGO_SETTINGS_MODULE = "example.settings"
# Test files to explore.
python_files = "**/test_*.py"
# Default command-line arguments:
# - Enable coverage measurement and set config file.
# - Force verbose output: output list of tests by default.
addopts = "--cov --verbose"