forked from mongodb-labs/django-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
162 lines (150 loc) · 5.22 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
[build-system]
requires = ["setuptools>=65.0"]
build-backend = "setuptools.build_meta"
[project]
name = "django-mongodb"
dynamic = ["version"]
description = "MongoDB backend for Django"
readme = "README.md"
license = {file="LICENSE"}
requires-python = ">=3.8"
authors = [
{ name = "The MongoDB Python Team" },
]
keywords = [
"mongo",
"mongodb",
"pymongo",
"django"
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"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",
"Topic :: Database",
"Typing :: Typed",
]
dependencies = [
"pymongo>=4.6,<5.0",
]
[project.optional-dependencies]
test = ["pytest>=7"]
docs = [ "sphinx>=7"]
[project.urls]
Homepage = "https://www.mongodb.org"
Documentation = "https://django-mongodb.readthedocs.io"
Source = "https://github.com/mongodb-labs/django-mongodb"
Tracker = "https://github.com/mongodb-labs/django-mongodb/issues"
[tool.setuptools.dynamic]
version = {attr = "django_mongodb._version.__version__"}
[tool.pytest.ini_options]
minversion = "7"
addopts = ["-ra", "--strict-config", "--strict-markers", "--junitxml=xunit-results/TEST-results.xml"]
testpaths = ["test"]
log_cli_level = "INFO"
norecursedirs = ["test/*"]
faulthandler_timeout = 1500
xfail_strict = true
filterwarnings = [
"error"
]
[tool.mypy]
strict = true
show_error_codes = true
pretty = true
disable_error_code = ["type-arg", "no-any-return"]
[[tool.mypy.overrides]]
module = ["test.*"]
disable_error_code = ["no-untyped-def", "no-untyped-call"]
[tool.ruff]
line-length = 100
[tool.ruff.lint]
select = [
"E", "F", "W", # flake8
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"S", # flake8-bandit
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
]
ignore = [
"PLR", # Design related pylint codes
"E501", # Line too long
"PT004", # Use underscore for non-returning fixture (use usefixture instead)
"UP007", # Use `X | Y` for type annotation
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"G004", # Logging statement uses f-string"
"UP006", # Use `type` instead of `Type` for type annotation"
"RET505", # Unnecessary `elif` after `return` statement"
"RET506", # Unnecessary `elif` after `raise` statement
"SIM108", # Use ternary operator"
"PTH123", # `open()` should be replaced by `Path.open()`"
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM105", # Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass`
"ARG002", # Unused method argument:
"S101", # Use of `assert` detected
"SIM114", # Combine `if` branches using logical `or` operator
"PGH003", # Use specific rule codes when ignoring type issues
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"EM103", # Exception must not use a `.format()` string directly, assign to variable first
"C408", # Unnecessary `dict` call (rewrite as a literal)
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
]
unfixable = [
"RUF100", # Unused noqa
"T20", # Removes print statements
"F841", # Removes unused variables
]
exclude = []
flake8-unused-arguments.ignore-variadic-names = true
isort.required-imports = ["from __future__ import annotations"]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?)|dummy.*)$"
[tool.ruff.lint.per-file-ignores]
"django_mongodb/__init__.py" = ["E402"]
"test/*.py" = ["PT", "E402", "PLW", "SIM", "E741", "PTH", "S", "B904", "E722", "T201",
"RET", "ARG", "F405", "B028", "PGH001", "B018", "F403", "RUF015", "E731", "B007",
"UP031", "F401", "B023", "F811"]
[tool.coverage.report]
exclude_lines = [
"if (.*and +)*_use_c( and.*)*:",
"def has_c",
"def get_version_string",
"^except AttributeError:",
"except ImportError:",
"raise NotImplementedError",
"return NotImplemented",
"_use_c = true",
"if __name__ == '__main__':",
"if TYPE_CHECKING:"
]
partial_branches = ["if (.*and +)*not _use_c( and.*)*:"]
[tool.coverage.html]
directory = "htmlcov"