-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
254 lines (227 loc) · 7.3 KB
/
pyproject.toml
File metadata and controls
254 lines (227 loc) · 7.3 KB
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
[build-system]
requires = [ "setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "file-keeper"
version = "0.1.0"
description = "Abstraction level for object storages."
classifiers = [
]
keywords = [ "file management", "cloud", "filesystem", "DAL", "storage", "file" ]
requires-python = ">= 3.10"
dependencies = [ "typing_extensions", "pluggy", "python-magic" ]
authors = [
{name = "DataShades", email = "datashades@linkdigital.com.au"},
{name = "Sergey Motornyuk", email = "sergey.motornyuk@linkdigital.com.au"},
]
maintainers = [
{name = "DataShades", email = "datashades@linkdigital.com.au"},
]
[project.license]
text = "AGPL-3.0"
[project.readme]
file = "README.md"
content-type = "text/markdown"
[project.urls]
Homepage = "https://github.com/DataShades/file-keeper"
Documentation = "https://datashades.github.io/file-keeper/"
Changelog = "https://datashades.github.io/file-keeper/changelog/"
[project.optional-dependencies]
test = [
"pytest-cov", "pytest-faker", "faker", "werkzeug", "urllib3",
]
docs = [
"mkdocs", "mkdocs-material", "pymdown-extensions", "mkdocstrings[python]", "mkdocs-spellcheck[codespell]", "mkdocs-macros-plugin",
]
dev = [
"pytest-cov", "pytest-faker", "faker", "werkzeug", "urllib3",
"mkdocs", "mkdocs-material", "pymdown-extensions", "mkdocstrings[python]", "mkdocs-spellcheck[codespell]","mkdocs-macros-plugin",
"pre-commit",
]
user_config = ["platformdirs"]
azure = ["azure-storage-blob"]
gcs = [ "google-cloud-storage", "urllib3"]
s3 = [ "boto3", "boto3-stubs[essential]"]
cloud = [
"azure-storage-blob",
"google-cloud-storage", "urllib3",
"boto3", "boto3-stubs[essential]",
]
libcloud = [ "apache-libcloud", "cryptography", "requests"]
opendal = [ "opendal",]
fsspec = [ "fsspec",]
obstore = [ "obstore",]
redis = [ "redis",]
sqlalchemy = ["sqlalchemy"]
all = [
"azure-storage-blob",
"google-cloud-storage", "urllib3",
"boto3", "boto3-stubs[essential]",
"apache-libcloud", "cryptography", "requests",
"opendal",
"fsspec", "obstore",
"redis",
"sqlalchemy",
]
# --8<-- [start:entrypoint]
[project.entry-points.file_keeper_ext]
file_keeper = "file_keeper.default"
# --8<-- [end:entrypoint]
[tool.ruff]
target-version = "py310"
line-length = 120
[tool.ruff.lint]
select = [
"ANN0", # type annotations for function arguments
"B", # likely bugs and design problems
"BLE", # do not catch blind exception
"C4", # better list/set/dict comprehensions
"C90", # check McCabe complexity
"DTZ", # enforce timezone in date objects
"E", # pycodestyle error
"W", # pycodestyle warning
"F", # pyflakes
"FA", # verify annotations from future
"G", # format strings for logging statements
"N", # naming conventions
"I", # isort
"ICN", # import conventions
"D", # require doc
"PL", # pylint
"PERF", # performance anti-patterns
"PT", # pytest style
"PIE", # misc lints
"RET", # improvements for return statements
"RSE", # improvements for rise statements
"S", # security testing
"SIM", # simplify code
"T10", # debugging statements
"T20", # print statements
"TID", # tidier imports
"TRY", # better exceptions
"UP", # upgrade syntax for newer versions of the language
]
ignore = [
"RET503", # don't enforce return-None
"D107", # undocumented __init__
"D105", # undocumented magic methods
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S", "PL", "ANN", "D"]
"docs/examples/*" = ["S", "BLE", "ANN", "D", "PL", "PERF", "TRY", "B", "G", "E"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
"first-party",
"third-party",
"self",
"local-folder",
]
[tool.ruff.lint.isort.sections]
self = ["file_keeper"]
[tool.pytest.ini_options]
addopts = "-p no:ckan --doctest-modules"
markers = [
"fk_storage_option: modify storage configuration",
"expect_storage_capability: test relies on given capability available in the storage fixture"
]
filterwarnings = [
"ignore:'cgi' is deprecated",
"ignore:.*ckanext:pytest.PytestAssertRewriteWarning",
"ignore:distutils Version classes are deprecated.",
"ignore:datetime.datetime.utcnow",
]
[tool.pyright]
pythonVersion = "3.10"
include = ["."]
exclude = [
# "**/test*",
]
strict = []
strictParameterNoneValue = true
# Check the meaning of rules here
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md
reportFunctionMemberAccess = true # non-standard member accesses for functions
reportMissingImports = true
reportMissingModuleSource = true
reportMissingTypeStubs = false
reportImportCycles = false
reportUnusedImport = true
reportUnusedClass = true
reportUnusedFunction = true
reportUnusedVariable = true
reportDuplicateImport = true
reportOptionalSubscript = true
reportOptionalMemberAccess = true
reportOptionalCall = true
reportOptionalIterable = true
reportOptionalContextManager = true
reportOptionalOperand = true
reportTypedDictNotRequiredAccess = true
reportConstantRedefinition = true
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = true
reportOverlappingOverload = true
reportUntypedFunctionDecorator = false
reportUnknownParameterType = true
reportUnknownArgumentType = false
reportUnknownLambdaType = false
reportUnknownMemberType = false
reportMissingTypeArgument = true
reportInvalidTypeVarUse = true
reportCallInDefaultInitializer = true
reportUnknownVariableType = true
reportUntypedBaseClass = true
reportUnnecessaryIsInstance = true
reportUnnecessaryCast = true
reportUnnecessaryComparison = true
reportAssertAlwaysTrue = true
reportSelfClsParameterName = true
reportUnusedCallResult = false
useLibraryCodeForTypes = true
reportGeneralTypeIssues = true
reportPropertyTypeMismatch = true
reportWildcardImportFromLibrary = true
reportUntypedClassDecorator = false
reportUntypedNamedTuple = true
reportPrivateUsage = true
reportPrivateImportUsage = true
reportInconsistentConstructor = true
reportMissingSuperCall = false
reportUninitializedInstanceVariable = true
reportInvalidStringEscapeSequence = true
reportMissingParameterType = true
reportImplicitStringConcatenation = false
reportUndefinedVariable = true
reportUnboundVariable = true
reportInvalidStubStatement = true
reportIncompleteStub = true
reportUnsupportedDunderAll = true
reportUnusedCoroutine = true
reportUnnecessaryTypeIgnoreComment = true
reportMatchNotExhaustive = true
reportUnusedParameter = false
reportExplicitAny = false
reportAny = false
reportUnannotatedClassAttribute = false
[tool.coverage.run]
branch = true
omit = ["tests/*"]
include = ["src/*"]
[tool.tox]
requires = ["tox>=4"]
env_list = ["3.14", "3.13", "3.12", "3.11", "3.10"]
[tool.tox.env_run_base]
passenv = ["FILE_KEEPER_TEST_*"]
description = "run unit tests"
deps = [
"pytest>=8",
# "pytest-sugar",
]
commands = [["pytest", { replace = "posargs", default = ["tests"], extend = true }]]
extras = ["test", "redis", "opendal", "azure", "gcs", "libcloud", "s3", "sqlalchemy", "fsspec", "obstore"]
[tool.tox.env.3.14]
extras = ["test", "redis", "opendal", "azure", "gcs", "libcloud", "s3", "sqlalchemy"]