-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
149 lines (134 loc) · 3.74 KB
/
Copy pathpyproject.toml
File metadata and controls
149 lines (134 loc) · 3.74 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
[project]
name = "oda_reader"
version = "1.3.3"
description = "A simple package to import ODA data from the OECD's API and AidData's database"
readme = "README.md"
license = "MIT"
authors = [
{ name = "Jorge Rivera", email = "jorge.rivera@one.org" }
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"filelock>=3.18.0",
"joblib>=1.4",
"openpyxl>=3.1.0",
"pandas>=2.2.0",
"platformdirs>=4.5.0",
"pyarrow>=14.0.0",
"requests>=2.32",
"requests-cache>=1.2.0",
]
[build-system]
requires = ["uv_build>=0.8.24,<0.9.0"]
build-backend = "uv_build"
[dependency-groups]
dev = [
"pre-commit>=4.0.0",
"ruff>=0.14.0",
]
docs = [
"mkdocs>=1.5.0",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.24.0",
]
test = [
"pytest>=8.0",
"pytest-mock>=3.12",
"pytest-cov>=4.1",
"pytest-xdist>=3.5",
]
[tool.ruff]
# Set the maximum line length
line-length = 88
# Target Python 3.10+
target-version = "py310"
# Exclude common directories
exclude = [
".git",
".venv",
"venv",
"__pycache__",
"build",
"dist",
"*.egg-info",
".pytest_cache",
"htmlcov",
".cache",
]
[tool.ruff.lint]
# Enable recommended rules plus extras
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"PL", # pylint
"RUF", # ruff-specific rules
]
# Ignore specific rules that might be too strict
ignore = [
"E501", # Line too long (handled by formatter)
"PLR0913", # Too many arguments
"PLR2004", # Magic value used in comparison
"RUF022", # Unsorted __all__ (intentional grouping by category)
"RUF013", # Implicit Optional (cleaner syntax for defaults)
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
# Allow longer lines in tests and examples
"tests/**/*.py" = ["E501"]
"docs/examples/**/*.py" = ["E501"]
# Allow global variable usage in cache and common modules (architectural decision)
"src/oda_reader/_cache/*.py" = ["PLW0603"]
"src/oda_reader/common.py" = ["PLW0603"]
# Allow try-except without from (external libraries may not support cause chaining)
"src/oda_reader/download/download_tools.py" = ["B904"]
# Allow camelcase import in tools (QueryBuilder is the standard name)
"src/oda_reader/tools.py" = ["N813"]
[tool.ruff.format]
# Use double quotes for strings
quote-style = "double"
# Use spaces for indentation
indent-style = "space"
# Like Black, respect magic trailing commas
skip-magic-trailing-comma = false
# Like Black, automatically detect line endings
line-ending = "auto"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"unit: Fast unit tests (no external dependencies)",
"integration: Tests that call real OECD API",
"slow: Long-running tests (bulk downloads)",
"cache: Tests that verify cache behavior",
]
addopts = [
"-v",
"--strict-markers",
"-m", "not integration",
]