-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
189 lines (170 loc) · 5.88 KB
/
Copy pathpyproject.toml
File metadata and controls
189 lines (170 loc) · 5.88 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
[build-system]
requires = ["uv_build>=0.12.5,<0.13"]
build-backend = "uv_build"
[project]
name = "lost_years"
version = "0.8.0"
description = "Get Expected Number of Years Lost"
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "Suriyan Laohaprapanon", email = "suriyant@gmail.com" },
{ name = "Gaurav Sood", email = "gsood07@gmail.com" },
]
maintainers = [
{ name = "Suriyan Laohaprapanon", email = "suriyant@gmail.com" },
{ name = "Gaurav Sood", email = "gsood07@gmail.com" },
]
requires-python = ">=3.12"
dependencies = [
# pandas.read_html needs a parser backend; lxml is the one pandas prefers.
"lxml>=5",
"pandas",
"platformdirs>=4",
"pyarrow>=15",
"requests",
]
keywords = [
"lost years",
"life expectancy",
"human life table",
"mortality",
"actuarial",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
]
[project.urls]
Homepage = "https://github.com/gojiplus/lost-years"
Documentation = "https://gojiplus.github.io/lost-years/"
Repository = "https://github.com/gojiplus/lost-years.git"
Issues = "https://github.com/gojiplus/lost-years/issues"
[project.scripts]
lost_years = "lost_years.cli:main"
lost_years_ssa = "lost_years.ssa:main"
lost_years_hld = "lost_years.hld:main"
lost_years_who = "lost_years.who:main"
[tool.uv.build-backend]
module-name = "lost_years"
module-root = ""
# The only table that ships is lost_years/data/ssa/ssa.parquet. The raw
# upstream artifacts live in data/ at the repository root, outside the import
# package, so neither the wheel nor the sdist carries them -- uv_build's sdist
# holds the module root and the metadata files, nothing else. An explicit
# `data/**` exclude is worse than none: the pattern is unanchored, so it also
# matches lost_years/data/ and drops the one table that is supposed to ship.
source-exclude = [
"**/.DS_Store",
]
wheel-exclude = [
# uv_build packages from the working tree, so a local macOS build shipped
# these even though .gitignore covers them.
"**/.DS_Store",
]
[tool.ruff]
line-length = 88
target-version = "py312"
[tool.ruff.lint]
external = ["DOC"]
select = [
"E", "W", "F", "I", "B", "C4", "UP", "N", "D", "S", "SIM", "T20", "PT", "RUF",
"PTH", "RET", "PIE", "FURB", "PERF", "DTZ", "LOG", "G", "TC", "FLY",
"RSE", "SLOT", "FA", "A", "EXE", "ICN", "PGH", "PLE", "ARG", "SLF",
]
# D203/D213: the google convention the fleet standard picks. W191/D206/D300:
# ruff's own docs list these as always incompatible with `ruff format`, which
# the standard also runs.
ignore = ["D203", "D213", "W191", "D206", "D300"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["S101", "D", "ARG", "SLF"]
"docs/**" = ["D"]
"__init__.py" = ["F401"]
# Published notebooks: their cells are prose-driven and their outputs are
# committed, so reflowing them to satisfy style rules would churn the rendered
# docs without making the examples any clearer.
"**/examples/*.ipynb" = ["E501", "UP031", "I001", "E402", "F401"]
"**/scrape-*.ipynb" = ["E501", "UP031", "I001", "E402", "F401", "E741", "S113", "T201"]
# `lost_years update` and `lost_years status` print their results; that output
# IS the user interface, so T201 does not apply to the CLI.
"lost_years/cli.py" = ["T201"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = ""
[dependency-groups]
dev = [
# >=0.16 so the locked ruff matches the `uvx ruff` that preen check runs;
# 0.16 formats Python inside markdown fences and older pins disagree with it.
"ruff>=0.16",
"pandas-stubs",
"types-requests>=2.32.4.20250913",
"pydoclint>=0.5.0",
"pyright[nodejs]>=1.1.0",
"preen>=0.1.0",
{ include-group = "test" },
]
test = ["pytest>=8", "pytest-cov>=6"]
docs = [
"sphinx>=8",
"furo",
# myst-nb renders the example notebooks. It supersedes nbsphinx, which needs
# a pandoc binary the shared docs workflow does not install. myst-nb
# registers myst_parser itself, so conf.py must not list both extensions.
"myst-nb",
"sphinx-copybutton",
"py-canon @ git+https://github.com/gojiplus/py-canon@v1",
]
[tool.pydoclint]
style = "google"
arg-type-hints-in-docstring = false
check-return-types = false
check-class-attributes = false
allow-init-docstring = true
exclude = '\.venv|tests|docs'
check-yield-types = false
skip-checking-short-docstrings = true
skip-checking-raises = false
[tool.pyright]
include = ["lost_years"]
typeCheckingMode = "standard"
pythonVersion = "3.12"
pythonPlatform = "All"
exclude = [
"**/node_modules",
"**/__pycache__",
"examples/**/*.ipynb"
]
reportMissingImports = true
reportMissingTypeStubs = false
reportMissingModuleSource = false
reportUnusedImport = true
reportUnusedClass = true
reportUnusedFunction = true
reportUnusedVariable = true
reportDuplicateImport = true
[tool.deptry.per_rule_ignores]
# lxml is pandas.read_html's parser backend for the SSA page. Nothing imports
# it directly, which is exactly what deptry reads as an unused dependency.
DEP002 = ["lxml"]
[tool.codespell]
# THA is Thailand's ISO-3166 code; it appears throughout the README's worked
# examples, where codespell reads it as a typo for "than"/"that"/"the".
ignore-words-list = "tha"
[tool.preen]
# Nothing tabular ships: the one packaged table is typed Parquet with an
# explicit Arrow schema, and the raw upstream artifacts live outside the import
# package. `runtime-assets` therefore runs like every other check.