-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
148 lines (130 loc) · 6.26 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
[build-system]
requires = ["setuptools>=60", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"
[project]
name = "posit-sdk"
description = "Posit SDK for Python"
readme = "README.md"
requires-python = ">=3.8"
license = { file = "LICENSE" }
keywords = ["posit", "sdk"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = ["requests>=2.31.0,<3", "packaging", "typing-extensions"]
[project.urls]
Source = "https://github.com/posit-dev/posit-sdk-py"
Issues = "https://github.com/posit-dev/posit-sdk-py/issues"
[tool.pyright]
include = ["src"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = ["--import-mode=importlib"]
[tool.setuptools_scm]
version_file = "src/posit/_version.py"
[tool.ruff]
extend-exclude = ["integration/resources"]
line-length = 99
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
[tool.ruff.lint]
extend-ignore = [
"E501", # Line too long
"PT011", # `pytest.raises(ValueError)` is too broad
"PT022", # No teardown in fixture
"F841", # Local variable is assigned but never used
"COM812", # missing-trailing-comma
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
]
extend-select = [
# "C90", # Many false positives # C90; mccabe: https://docs.astral.sh/ruff/rules/complex-structure/
# "DTZ", # Dates with timezones are different from dates without timezones # DTZ; flake8-datetimez: https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
# flake8-builtins
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
#
# Check for builtin shadowing (i.e., naming a variable 'for', which is a builtin.)
"A",
# pydocstyle
# https://docs.astral.sh/ruff/rules/#pydocstyle-d
# https://docs.astral.sh/ruff/faq/#does-ruff-support-numpy-or-google-style-docstrings
#
# Check docstring formatting. Many of these rules are intentionally ignored below.
"D",
"E", # E; pycodestyle: https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"F", # F; Pyflakes: https://docs.astral.sh/ruff/rules/#pyflakes-f
"I", # I; isort: https://docs.astral.sh/ruff/rules/#isort-i
"B", # B; flake8-bugbear: https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"Q", # Q; flake8-quotes: https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"COM", # COM; Commas: https://docs.astral.sh/ruff/rules/#flake8-commas-com
"C4", # C4; flake8-comprehensions: https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"FA102", # FA102; flake8-future-annotations: https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
"ISC", # ISC; flake8-implicit-str-concat: https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
"ICN", # ICN; flake8-import-conventions: https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
"PIE", # PIE; flake8-pie: https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"PYI013", # PYI013; flake8-pyi Non-empty class body must not contain `...`: https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PYI030", # PYI030; flake8-pyi Multiple literal members in a union: https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PYI034", # PYI034; flake8-pyi `__new__` methods usually reutrn `Self`: https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PT", # PT; flake8-pytest-style: https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"SIM118", # SIM118; flake8-simplify Use `key {operator} dict`: https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"TCH", # TCH; flake8-type-checking: https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
# "FIX", # FIX; flake8-fixme: https://docs.astral.sh/ruff/rules/#flake8-fixme-fix
# "PGH", # PGH; pygrep-hooks: https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"NPY", # NPY; NumPy-specific rules: https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy
"RUF005", # RUF005; Ruff specific rules Consider {expression} instead of concatenation: https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF100", # RUF100; Ruff specific rules Unused `noqa` directive https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
]
ignore = [
# NumPy style docstring convention with noted exceptions.
# https://docs.astral.sh/ruff/faq/#does-ruff-support-numpy-or-google-style-docstrings
#
# This docstring style works with [quartodoc](https://machow.github.io/quartodoc/get-started/overview.html).
#
'D101', # TODO(#135) implement docstring for public class
'D103', # TODO(#135) implement docstring for public functions
'D104', # TODO(#135) implement docstring for public package
'D105', # TODO(#135) implement docstring for magic methods
'D100', # TODO(#135) implement docstring for public modules
'D102', # TODO(#135) implement docstring for public methods
'D401', # TODO(#135) fix imperative mood warnings
'D418', # D418 contradicts the overload convention used in this project to describe different endpoints across Connect versions.
]
[tool.ruff.lint.per-file-ignores]
"examples/*" = ["D"]
"tests/*" = ["D"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
# # Ruff is enabled in config file to run on save
# Disable isort due to timing conflict with ruff
[tool.isort]
skip_glob = "**"
# Disable local black to avoid conflict with ruff
[tool.black]
exclude = ".*"
[dependency-groups]
build = ["build"]
coverage = ["coverage"]
examples = ["rsconnect-python", "pandas"]
git = ["pre-commit"]
lint = ["ruff", "pyright"]
test = ["rsconnect-python", "responses", "pytest", "pyjson5"]
# Default install group by `uv`: `dev`
dev = [
{ include-group = "build" },
{ include-group = "coverage" },
# # Must comment out `examples` group until only python>3.8 is supported
# # `numpy==1.24.4` requires `distutils`, which is not available in python3.12
# # `numpy>1.24.4` does not require `distutils`
# { include-group = "examples" },
{ include-group = "git" },
{ include-group = "lint" },
{ include-group = "test" },
]