-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
209 lines (192 loc) · 7.84 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
207
208
209
[project]
name = "intersect-sdk"
description = "Python SDK to interact with INTERSECT"
authors = [
{ name = "Lance Drane", email = "dranelt@ornl.gov" },
{ name = "Marshall McDonnell", email = "mcdonnellmt@ornl.gov" },
{ name = "Seth Hitefield", email = "hitefieldsd@ornl.gov" },
{ name = "Andrew Ayres", email = "ayresaf@ornl.gov" },
{ name = "Gregory Cage", email = "cagege@ornl.gov" },
{ name = "Jesse McGaha", email = "mcgahajr@ornl.gov" },
{ name = "Robert Smith", email = "smithrw@ornl.gov" },
{ name = "Gavin Wiggins", email = "wigginsg@ornl.gov" },
{ name = "Michael Brim", email = "brimmj@ornl.gov" },
{ name = "Rick Archibald", email = "archibaldrk@ornl.gov" },
{ name = "Addi Malviya Thakur", email = "malviyaa@ornl.gov" },
]
readme = "README.md"
license = { text = "BSD-3-Clause" }
requires-python = ">=3.8.10,<4.0"
keywords = ["intersect"]
dynamic = ["version"]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"pydantic>=2.7.0",
"retrying>=1.3.4,<2.0.0",
"paho-mqtt>=1.6.1,<2.0.0",
"minio>=7.2.3",
"jsonschema[format-nongpl]>=4.21.1", # extras necessary for enforcing formats
"eval-type-backport>=0.1.3;python_version<'3.10'", # make pydantic work with newer syntax and older python
#"brotli>=1.1.0", # TODO - add this dependency when we add compression
]
[project.urls]
Homepage = "https://github.com/INTERSECT-SDK/python-sdk/"
Changelog = "https://github.com/INTERSECT-SDK/python-sdk/blob/main/CHANGELOG.md"
Documentation = "https://intersect-python-sdk.readthedocs.io/en/latest/"
Issues = "https://github.com/INTERSECT-SDK/python-sdk/issues"
[project.optional-dependencies]
amqp = ["pika>=1.3.2,<2.0.0"]
docs = ["sphinx>=5.3.0", "furo>=2023.3.27"]
[tool.ruff]
line-length = 100
format = { quote-style = 'single' }
[tool.ruff.lint]
isort = { known-first-party = ['src'] }
pydocstyle = { convention = 'google' }
flake8-quotes = { inline-quotes = 'single', multiline-quotes = 'double' }
mccabe = { max-complexity = 20 }
pylint = { max-args = 10, max-branches = 20, max-returns = 10, max-statements = 75 }
# pyflakes and the relevant pycodestyle rules are already configured
extend-select = [
'C90', # mccabe complexity
'I', # isort
'N', # pep8-naming
'D', # pydocstyle
'UP', # pyupgrade
'YTT', # flake8-2020
'ANN', # flake8-annotations
'ASYNC', # flake8-async
'S', # flake8-bandit
'BLE', # flake8-blind-except
'B', # flake8-bugbear
'A', # flake8-builtins
'COM', # flake8-commas
'C4', # flake8-comprehensions
'DTZ', # flake8-datetimez
'T10', # flake8-debugger
'EM', # flake8-error-message
'FA', # flake8-future-annotations
'ISC', # flake8-implicit-string-concat
'ICN', # flake8-import-conventions
'G', # flake8-logging-format
'INP', # flake8-no-pep420
'PIE', # flake8-PIE
'T20', # flake8-T20
'PYI', # flake8-pyi
'PT', # flake8-pytest-style
'Q', # flake8-quotes
'RSE', # flake8-raise
'RET', # flake8-return
'SLF', # flake8-self
'SLOT', # flake8-slots
'SIM', # flake8-simplify
'TCH', # flake8-type-checking
'ARG', # flake8-unused-arguments
'PTH', # flake8-use-pathlib
'PGH', # pygrep-hooks
'PL', # pylint
'TRY', # tryceratops
'FLY', # flynt
'RUF', # RUFF additional rules
]
# If you're seeking to disable a rule, first consider whether the rule is overbearing, or if it should only be turned off for your usecase.
ignore = [
'COM812', # formatter, handled by Ruff format
'ISC001', # formatter, handled by Ruff format
'SIM105', # "with contextlib.suppress():" is slower than try-except-pass
'ANN101', # don't need to annotate "self" typing
'ANN102', # don't need to annotate "cls" typing for class methods
'ANN401', # allow explicit "Any" typing, use with care
'PLR2004', # allow "magic numbers"
]
[tool.ruff.lint.extend-per-file-ignores]
'__init__.py' = ['F401'] # __init__.py commonly has unused imports
'docs/*' = [
'D', # the documentation folder does not need documentation
'INP001', # docs are not a namespace package
]
'examples/*' = [
'N999', # module names for examples are not standard
'T20', # allow print/pprint statements in examples
'S106', # don't care about credentials in examples
'D100', # documenting modules in examples is unhelpful
'D104', # documenting packages in examples is unhelpful
'TRY002', # examples can raise their own exception
'FA100', # examples are tested on Python 3.8, and future annotations cause problems with Pydantic
]
'tests/*' = [
'S101', # allow assert statements in tests
'S106', # don't care about credentials in tests
'S311', # don't care about cryptographic security in tests
'SLF001', # allow private member access in tests
'ANN', # tests in general don't need types, unless they are runtime types.
'ARG', # allow unused parameters in tests
'D', # ignore documentation in tests
'FA100', # tests frequently use runtime typing annotations
]
# see https://mypy.readthedocs.io/en/stable/config_file.html for a complete reference
[tool.mypy]
strict = true
ignore_missing_imports = true # don't require typing for library stubs if they don't exist
disallow_untyped_decorators = false # this is needed for library decorator compatibility, i.e. "retrying"
plugins = ["pydantic.mypy"]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true
[tool.pytest.ini_options]
log_cli = true
addopts = "-ra"
[tool.coverage.report]
omit = [
'*__init__*', # __init__ files should just re-export other classes and functions
'*/discovery_service.py', # currently unused
]
exclude_also = [
'pragma: no-cover', # standard
'if (typing\\.)?TYPE_CHECKING:', # type checking blocks are not executed in coverage, but we don't care
'@(abc\\.)?abstractmethod', # don't try to cover abstract methods
"class .*\\bProtocol\\):", # don't cover protocol classes (similar to abstract classes)
'raise NotImplementedError', # it's not implemented so shouldn't be covered
'except.* ImportError', # these are usually used to throw a "friendlier" error and are not really worth testing
]
[tool.pdm.dev-dependencies]
lint = [
"pre-commit>=3.3.1",
"ruff==0.5.7",
"mypy>=1.10.0",
"types-paho-mqtt>=1.6.0.20240106",
"codespell>=2.3.0",
]
test = ["pytest>=7.3.2", "pytest-cov>=4.1.0", "httpretty>=1.1.4"]
[tool.pdm.scripts]
test-all = "pytest tests/ --cov=src/intersect_sdk/ --cov-fail-under=80 --cov-report=html:reports/htmlcov/ --cov-report=xml:reports/coverage_report.xml --junitxml=reports/junit.xml"
test-all-debug = "pytest tests/ --cov=src/intersect_sdk/ --cov-fail-under=80 --cov-report=html:reports/htmlcov/ --cov-report=xml:reports/coverage_report.xml --junitxml=reports/junit.xml -s"
test-unit = "pytest tests/unit --cov=src/intersect_sdk/"
test-e2e = "pytest tests/e2e --cov=src/intersect_sdk/"
lint = { composite = ["lint-format", "lint-ruff", "lint-mypy", "lint-spelling"] }
lint-format = "ruff format"
lint-ruff = "ruff check --fix"
lint-mypy = "mypy src/intersect_sdk/"
lint-spelling = "codespell -w docs examples src tests *.md -S docs/_build"
[tool.pdm.build]
package-dir = "src"
[tool.pdm.version]
source = "file"
path = "src/intersect_sdk/version.py"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git*,*.lock,.venv,.*cache/*,./docs/_build/*'
check-hidden = true
# ignore-regex = ''
# ignore-words-list = ''