Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
104 lines (94 loc) · 4.11 KB
/
Copy pathpyproject.toml
File metadata and controls
104 lines (94 loc) · 4.11 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
[project]
name = "pubmed2db"
version = "1.2.0"
description = "Download PubMed abstracts, load them into DuckDB, and export to JSON and Parquet."
readme = "README.md"
requires-python = ">=3.11" # hashlib.file_digest (download.file_md5)
license = { file = "LICENSE" }
authors = [{ name = "Gaurav Vaidya", email = "gaurav@ggvaidya.com" }]
# Floors are the versions this release is built and tested against, not the
# oldest that might work: the corpus run is the thing that matters here, and
# "it resolved to something older on your machine" is not a debugging session
# anyone wants during one. Raise them together with a full `uv lock --upgrade`
# and a green suite.
dependencies = [
# Upper bound: we call private APIs (`_extract_article`, `_ensure_urls`), so
# any release can break us; 0.1.0 already renamed `Heading.mesh_id` and
# changed how it reads MeSH IDs, which is why `parse._mesh_headings` reads
# them from the XML instead. Re-test before raising the ceiling. The floor
# is the version this release was tested against, per the note above:
# nothing we call needs a 0.1.0 feature.
"pubmed-downloader>=0.1.0,<0.2",
# The export is one COPY statement whose SQL leans on version-specific
# behaviour (regexp classes, TRY_CAST, PER_THREAD_OUTPUT options), so the
# floor tracks what the twin tests actually ran against.
"duckdb>=1.5.5",
# DuckDB's Python client needs pytz to return a TIMESTAMPTZ, which every
# timestamp in the data model is (an aware instant, not a wall-clock time).
"pytz>=2026.5",
"pyarrow>=25",
"click>=8.4",
"requests>=2.34",
# Imported directly: util.download_file reads the undecoded body through
# urllib3 and translates its exceptions.
"urllib3>=2",
# pubmed-downloader 0.1.0 itself requires >=0.10.2.
"pystow>=0.10.3",
"tqdm>=4.70",
"lxml>=6.1",
]
[project.scripts]
pubmed2db = "pubmed2db.cli:main"
[project.optional-dependencies]
dev = ["pytest>=9"]
[dependency-groups]
# The linters CI runs (.github/workflows/lint.yml). uv.lock pins the exact
# versions, so a dev box and CI format alike; a new ruff can reformat code, so
# raise it on purpose, with its reformat in its own commit. A group rather than
# part of the dev extra so each CI job installs only what it runs: the lint job
# installs these two alone (`--only-group lint`), the test jobs leave them out.
# Not a default group, so a plain `uv sync` on the cluster leaves them out too.
lint = [
"ruff>=0.17.1",
"rumdl>=0.3.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/pubmed2db"]
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.ruff]
# The code already ran past 88 on hundreds of lines but past 100 on few, so 100
# reformats least.
line-length = 100
# No target-version: ruff reads it from requires-python, so the two cannot
# disagree when the floor is raised.
[tool.ruff.lint]
# Listed explicitly: ruff's own default set is far broader (~400 rules in
# 0.17) and changes between releases, so an unlisted set would make an upgrade
# a lint change too. No E501: the formatter owns line width, and the long
# strings and URLs it leaves are better long than split.
select = [
"E4", "E7", "E9", # pycodestyle errors that are not style
"F", # pyflakes
"I", # import order
"UP", # pyupgrade, to requires-python
]
[tool.rumdl]
disable = [
# Line length: docs/Releases.md writes a paragraph per line, and the
# generated docs/data-model/Reference.md has long table cells.
"MD013",
# Blank line inside a blockquote: the README puts two callouts in a row,
# which GitHub renders as two quotes.
"MD028",
]
# Reported, never autofixed. On wrapped prose, a line that happens to start
# with `#13` or `+` trips these, and the fix is to rewrap it: MD018's autofix
# adds the space that makes the line a heading, MD032's adds the blank lines
# that split the paragraph around a one-item list.
unfixable = ["MD018", "MD032"]
[tool.rumdl.per-file-ignores]
"CLAUDE.md" = ["MD041"] # it is only "@AGENTS.md", which has no heading to give