Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
230 lines (192 loc) · 6.48 KB
/
Copy pathpyproject.toml
File metadata and controls
230 lines (192 loc) · 6.48 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
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
name = "libredte"
# Versions should comply with PEP440
version = "5.1.0"
description = "Cliente para realizar la integración con los servicios web de LibreDTE desde Python."
readme = "README.rst"
license = "LGPL-3.0-or-later"
license-files = ["COPYING"]
authors = [{name = "LibreDTE", email = "dev@libredte.cl"}]
keywords = ["sii", "chile", "facturación", "electrónica"]
# Minimum Python version supported
requires-python = ">=3.13"
# See https://pypi.org/classifiers/
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Typing :: Typed",
]
# Run-time dependencies, installed with the package. Only the packages that
# libredte imports, with minimum versions (not exact ones), so the projects
# that use it can keep their own versions. certifi, idna and
# charset-normalizer come with requests.
# - requests 2.32.4 fixes CVE-2024-47081 (credentials leaked through .netrc).
# - urllib3: Retry (used in ApiClient) with the options of version 2.
dependencies = [
"requests>=2.32.4",
"urllib3>=2.0",
]
[project.urls]
Homepage = "https://github.com/LibreDTE/libredte-api-client-python"
[dependency-groups]
# Development tools, not installed with the package: `pip install --group dev`
dev = [
# Lint and type checking
"mypy==2.4.1",
"pyright==1.1.414",
"ruff==0.17.6",
"types-requests==2.32.4.20250913",
# Tests
"python-dotenv==1.0.0",
# Documentation (Sphinx)
"alabaster==0.7.15",
"Babel==2.14.0",
"docutils==0.20.1",
"imagesize==1.4.1",
"Jinja2==3.1.6",
"MarkupSafe==2.1.3",
"Pygments==2.17.2",
"snowballstemmer==2.2.0",
"Sphinx==7.2.6",
"sphinx-rtd-theme==2.0.0",
"sphinxcontrib-applehelp==1.0.7",
"sphinxcontrib-devhelp==1.0.5",
"sphinxcontrib-htmlhelp==2.0.4",
"sphinxcontrib-jquery==4.1",
"sphinxcontrib-jsmath==1.0.1",
"sphinxcontrib-qthelp==1.0.6",
"sphinxcontrib-serializinghtml==2.0.0",
# Build and upload to PyPI (build, twine)
"build==1.6.1",
"id==1.6.1",
"importlib-metadata==7.0.1",
"jaraco.classes==3.3.0",
"keyring==24.3.0",
"markdown-it-py==3.0.0",
"mdurl==0.1.2",
"more-itertools==10.2.0",
"nh3==0.2.15",
"packaging==26.3",
"pkginfo==1.9.6",
"pyproject_hooks==1.3.3",
"readme-renderer==42.0",
"requests-toolbelt==1.0.0",
"rfc3986==2.0.0",
"rich==13.7.0",
"twine==6.2.0",
"zipp==4.1.2",
]
[tool.setuptools.packages.find]
exclude = ["tests", "tests.*"]
namespaces = false
[tool.setuptools.package-data]
# py.typed: marks the package as typed (PEP 561), so the projects that use
# it see its types
libredte = ["py.typed"]
[tool.ruff]
# Files to include in linting (Python source and stub files)
include = ["**/*.py", "**/*.pyi"]
# Folders to exclude from linting (e.g., virtual environments, build folders)
exclude = [
".git",
"__pycache__",
"build",
"dist",
".venv",
"venv",
]
# Maximum allowed characters per line
line-length = 79
# Target Python version (used for version-specific rules)
target-version = "py313"
# Respect `.gitignore` files (e.g., to skip __init__.py or ignored files)
respect-gitignore = true
# Apply fixes only with `ruff check --fix` (avoid rewriting the tree on `ruff check .`)
fix = false
[tool.ruff.lint]
# List of enabled rule categories
select = [
"D", # pydocstyle: docstring conventions
"F", # Pyflakes: code correctness errors
"E", # pycodestyle: style errors
"W", # pycodestyle: warnings
"I", # isort: import order checks
"UP", # Python upgrades: modern language features
"N", # pep8-naming: naming conventions
"B", # bugbear: common bug patterns
"A", # flake8-builtins: avoid shadowing built-in names
"C90", # mccabe: cyclomatic complexity
"ARG", # flake8-unused-arguments: unused arguments detection
"DTZ", # datetimez: best practices with datetime usage
"TRY", # tryceratops: exception handling best practices
"SLF", # flake8-self: discourage private attribute access
"ERA", # eradicate: detect commented-out/dead code
"PL", # pylint: extra validations
"RUF", # Ruff-specific rules
]
# Rules to ignore (useful for relaxing or customizing enforcement)
ignore = [
# Docstring style: these rules are the opposite of D203 and D213, which
# the project follows (both enabled). Ruff cannot enforce both rules of a
# pair, so one of each pair must be disabled.
"D211", # Opposite of D203 (blank line before class docstring)
"D212", # Opposite of D213 (summary on the docstring's second line)
# Project patterns, not errors:
"N818", # Exceptions keep their current names (`ApiException`, part of
# the public API), not the 'Error' suffix
]
[tool.ruff.lint.mccabe]
# Maximum cyclomatic complexity allowed before a warning is raised
max-complexity = 25
[tool.ruff.lint.pylint]
max-args = 20 # Maximum number of arguments for a function
max-branches = 25 # Maximum number of branches for a function
max-statements = 60 # Maximum number of statements for a function
[tool.ruff.format]
quote-style = "single"
[tool.mypy]
# Target Python version
python_version = "3.13"
# Folders checked when running `mypy` without arguments
files = ["libredte", "tests", "docs"]
# Folders to exclude from type checking
exclude = ["build/", "dist/", "venv/"]
# Strict mode: every function with type annotations, no implicit Any and
# no untyped calls (it includes check_untyped_defs)
strict = true
# Checks outside strict mode: variables that may be unassigned, iterables
# (always truthy) used as conditions and use of deprecated functions
enable_error_code = ["possibly-undefined", "truthy-iterable", "deprecated"]
# The type of a variable created empty (None, [], {}) is inferred only in
# the scope where it is created, not from other functions
local_partial_types = true
[tool.pyright]
# Folders to exclude from type checking
exclude = [
"**/node_modules",
"**/__pycache__",
"build",
"dist",
".git",
"venv",
".venv",
]
# Target Python version
pythonVersion = "3.13"
# Type checking mode: strict (no unknown types, unnecessary checks are
# errors)
typeCheckingMode = "strict"
# Code that can never run (outside strict mode)
reportUnreachable = "error"
# Virtual environment with the dependencies: ./venv
venvPath = "."
venv = "venv"