-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
163 lines (150 loc) · 5.22 KB
/
Copy pathpyproject.toml
File metadata and controls
163 lines (150 loc) · 5.22 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "bamboohr-sdk"
version = "1.0.0"
description = "Official Python SDK for the BambooHR API"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
authors = [
{ name = "BambooHR", email = "support@bamboohr.com" },
]
keywords = [
"bamboohr",
"api",
"sdk",
"openapi",
"openapi-generator",
"rest",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Typing :: Typed",
]
dependencies = [
"httpx>=0.25.0",
"pydantic>=2.0",
"python-dateutil>=2.8",
"urllib3>=1.25.3",
]
[project.urls]
Homepage = "https://www.bamboohr.com/"
Documentation = "https://documentation.bamboohr.com"
Repository = "https://github.com/BambooHR/bhr-api-python"
[project.optional-dependencies]
# Dev tooling is pinned to compatible ranges, NOT left open-ended.
#
# These bounds exist because the SDK-update pipeline lints and tests
# freshly *generated* code. When a linter stabilizes a new rule, or a
# type checker ships a major version, the pipeline fails on output we
# don't hand-write and can't fix at review time. That is exactly what
# happened with `ruff>=0.3`: CI resolved ruff 0.16.5, which stabilized
# RUF036, and `make lint` failed with 1059 errors in bamboohr_sdk/api/
# on a signature that comes straight from the upstream template.
#
# Bump these deliberately (and regenerate) rather than letting a
# transitive resolution decide the toolchain on a random Tuesday.
dev = [
"chevron>=0.14,<1",
"mypy>=1.19,<2",
"pytest>=8.0,<10",
"pytest-cov>=4.0,<8",
"pytest-asyncio>=0.23,<2",
"ruff>=0.16,<0.17",
]
[tool.hatch.build.targets.wheel]
packages = ["bamboohr_sdk"]
[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
module = "bamboohr_sdk.api.*"
disallow_untyped_defs = false
[[tool.mypy.overrides]]
module = "bamboohr_sdk.models.*"
disallow_untyped_defs = false
[tool.ruff]
target-version = "py310"
line-length = 120
src = ["bamboohr_sdk", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"RUF", # ruff-specific rules
]
ignore = [
"E501", # line too long (handled by formatter)
]
[tool.ruff.lint.isort]
known-first-party = ["bamboohr_sdk"]
# Generated code (openapi-generator output) — relax rules that come from
# the upstream templates and aren't worth fixing in our fork.
# Hand-written code lives under bamboohr_sdk/client/ and stays under the
# default rule set.
#
# RUF001/RUF002/RUF003 (ambiguous unicode in strings/docstrings/comments) are
# all ignored on generated paths — they fire on smart-quote characters (’, “”)
# that come straight from spec description text written by API designers. The
# characters aren't ambiguous in context; ruff is being pedantic about source
# we don't own.
#
# RUF036 (`None` not at the end of the type union) is ignored for the same
# reason: every generated operation takes
# _request_timeout: None | Annotated[StrictFloat, ...] | tuple[...] = None
# with `None` leading the union. That ordering comes from the openapi-generator
# Python template, ruff offers no safe autofix for it, and rewriting it would
# mean forking the template for a purely cosmetic gain.
[tool.ruff.lint.per-file-ignores]
"bamboohr_sdk/api/*.py" = [
"B028", "B904", "F841", "N805", "RUF001", "RUF002", "RUF003", "RUF012", "RUF036", "RUF059",
"SIM101", "SIM105", "SIM108", "SIM118", "TC001", "TC003", "UP030", "UP031",
]
"bamboohr_sdk/models/*.py" = [
"F841", "N805", "N818", "RUF001", "RUF002", "RUF003", "RUF012", "SIM118", "TC001", "TC003",
]
"bamboohr_sdk/api_client.py" = [
"B028", "B904", "F841", "RUF001", "RUF002", "RUF003", "RUF012", "RUF036", "RUF059",
"SIM101", "SIM105", "SIM108", "TC001", "TC003", "UP030", "UP031",
]
"bamboohr_sdk/api_helper.py" = ["TC001", "TC003"]
"bamboohr_sdk/api_response.py" = ["TC001", "TC003"]
"bamboohr_sdk/configuration.py" = ["B028", "B904", "RUF001", "RUF002", "RUF003", "UP030", "UP031"]
"bamboohr_sdk/exceptions.py" = ["N818", "SIM105"]
"bamboohr_sdk/rest.py" = ["B028", "B904", "RUF001", "RUF002", "RUF003", "SIM101", "SIM108"]
# Hand-written client code: relax rules for type-only imports and
# docstring-only stylistic noise. Real bugs would still surface via
# mypy and the test suite.
"bamboohr_sdk/client/**/*.py" = ["B904", "RUF001", "RUF002", "RUF003", "RUF059", "TC001", "TC003"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]
addopts = "-ra -q"