-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
403 lines (371 loc) · 11.8 KB
/
pyproject.toml
File metadata and controls
403 lines (371 loc) · 11.8 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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "rxiv-maker"
dynamic = ["version"]
authors = [
]
keywords = ["latex", "markdown", "scientific-writing", "publishing", "automation", "cli", "command-line", "hatch"]
classifiers = [
"Development Status :: 4 - Beta",
"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",
"Topic :: Scientific/Engineering",
"Topic :: Text Processing :: Markup :: LaTeX",
"Topic :: Text Processing :: Markup :: Markdown",
]
description = "Write scientific preprints in Markdown. Generate publication-ready PDFs efficiently."
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
# Core scientific libraries for figure generation (optional for users who don't generate figures)
"matplotlib>=3.7.0",
"seaborn>=0.12.0",
"numpy>=1.24.0",
"pandas>=2.0.0",
# Core functionality dependencies
"Pillow>=9.0.0",
"pypdf>=6.0.0",
"PyYAML>=6.0.0",
"python-dotenv>=1.0.0",
"python-docx>=1.1.0",
"latex2mathml>=3.78.0",
"pdf2image>=1.16.0",
"crossref-commons>=0.0.7",
"click>=8.0.0",
"rich>=13.0.0",
"rich-click>=1.6.0",
"typing-extensions>=4.0.0",
"packaging>=21.0.0",
"platformdirs>=4.0.0",
"tomli-w>=1.0.0",
"requests>=2.28.0",
"playwright>=1.54.0",
# Repository management dependencies
"GitPython>=3.1.0",
"prompt_toolkit>=3.0.0",
# Update checking
"henriqueslab-updater>=1.2.0",
]
[project.urls]
Homepage = "https://github.com/HenriquesLab/rxiv-maker"
Documentation = "https://github.com/HenriquesLab/rxiv-maker#readme"
Repository = "https://github.com/HenriquesLab/rxiv-maker"
Issues = "https://github.com/HenriquesLab/rxiv-maker/issues"
Changelog = "https://github.com/HenriquesLab/rxiv-maker/blob/main/CHANGELOG.md"
"Bug Reports" = "https://github.com/HenriquesLab/rxiv-maker/issues"
"Source Code" = "https://github.com/HenriquesLab/rxiv-maker"
[project.optional-dependencies]
dev = [
# Core testing framework
"pytest>=7.4,<10.0",
"pytest-cov>=4.0",
"pytest-xdist>=3.8.0",
# Testing utilities
"pytest-timeout>=2.0.0",
"pytest-asyncio>=0.21.0",
"pytest-mock>=3.10.0",
"pytest-sugar>=0.9.7",
"pytest-benchmark>=4.0.0",
"pytest-env>=1.0.0",
"pytest-snapshot>=0.9.0",
"pytest-datadir>=1.4.0",
"pytest-clarity>=1.0.0",
"pytest-notebook>=0.10.0",
# Code quality and formatting
"ruff>=0.12.2",
"mypy>=1.0",
"pre-commit>=4.2.0",
# Build and packaging
"hatch>=1.14.1",
"build>=1.2.2.post1",
"twine>=6.1.0",
# Type checking
"types-requests>=2.32.4.20250611",
"types-PyYAML>=6.0.0",
# PDF utilities
"PyPDF2>=3.0.0",
# Documentation and utilities
"coverage[toml]>=7.0",
"nbstripout>=0.7.1",
"nox>=2023.0.0",
]
# Ruff configuration (replaces black, isort, flake8, autoflake, docformatter)
[tool.ruff]
# Set the maximum line length (increased for better readability)
line-length = 120
target-version = "py311"
exclude = [
"versioneer.py",
"rxiv_maker_colab.ipynb",
]
[tool.ruff.lint]
# Enable the following rule sets (reduced strictness)
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
]
# Ignore specific rules that are too strict or conflict with practical coding
ignore = [
"E203", # whitespace before ':'
"E501", # line too long (handled by line-length setting with more tolerance)
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D200", # One-line docstring should fit on one line
"D212", # Multi-line docstring summary should start at the first line
"D213", # Multi-line docstring summary should start at the second line
"D400", # First line should end with a period
"D401", # First line should be in imperative mood
"D415", # First line should end with a period, question mark, or exclamation point
]
[tool.ruff.format]
# Use double quotes for strings
quote-style = "double"
# Use spaces around the equals sign in keyword arguments
skip-magic-trailing-comma = false
# Prefer hanging indents for function arguments
indent-style = "space"
[tool.ruff.lint.isort]
known-first-party = ["rxiv_maker"]
[tool.ruff.lint.pydocstyle]
# Use Google-style docstrings
convention = "google"
[tool.ruff.lint.per-file-ignores]
# Ignore certain rules in test files (but keep docstring checks for main classes)
"tests/*" = ["D"]
# Ignore debug and example files
"debug_*.py" = ["D"]
"trace_*.py" = ["D"]
"notebooks/*" = ["D", "E501"]
# Ignore auto-generated files
"rxiv_maker_colab.ipynb" = ["ALL"]
[tool.mypy]
python_version = "3.11"
warn_return_any = false
warn_unused_configs = false
disallow_untyped_defs = false
check_untyped_defs = true
explicit_package_bases = true
ignore_missing_imports = true
[tool.coverage.run]
source = ["src/rxiv_maker"]
omit = [
"*/tests/*",
"*/test_*.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-v",
"--tb=short",
"--strict-markers",
"--strict-config",
"--durations=10", # Show slowest tests
"--cov-report=term-missing:skip-covered",
"--dist=worksteal", # Optimized work distribution with pytest-xdist
"--maxfail=5", # Increased to handle flaky tests better
"--timeout=60", # Default timeout for fast tests, overridden by specific timeouts
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"fast: marks tests as fast (select with '-m fast')",
"medium: marks tests as medium speed (1-5s duration)",
"asyncio: marks tests as async tests",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"notebook: marks tests as notebook tests",
"validation: marks tests as validation-related tests",
"build_manager: marks tests as build manager-related tests",
"pdf_validation: marks tests as PDF validation-related tests",
"cli: marks tests as CLI-related tests",
"docker: marks tests as Docker engine mode tests",
"podman: marks tests as Podman engine mode tests",
"binary: Binary distribution tests",
"pyinstaller: PyInstaller-specific tests",
"package_manager: Package manager integration tests",
"homebrew: Homebrew-specific tests",
"scoop: Scoop-specific tests",
"pypi: PyPI distribution and integration tests",
"end_to_end: End-to-end binary workflow tests",
"platform_specific: Tests that only run on specific platforms",
"performance: Performance benchmark tests",
"memory_intensive: Tests that use significant memory",
"requires_latex: Requires LaTeX installation",
"requires_docker: Requires Docker availability",
"requires_podman: Requires Podman availability",
"requires_r: Requires R statistical software",
"system: System-level integration tests",
"flaky: Tests that are known to be flaky or unstable",
"ci_exclude: Tests to exclude in CI environments",
"processor: marks tests as processor-related tests",
"medium: marks tests as medium-duration tests",
"docker: marks tests as Docker-related tests",
"podman: marks tests as Podman-related tests",
"network: marks tests requiring network connectivity",
"filesystem: marks tests requiring filesystem operations",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
"ignore::UserWarning",
"ignore::DeprecationWarning:pkg_resources",
"error::pytest.PytestUnraisableExceptionWarning",
]
# Hatch configuration
[tool.hatch.version]
path = "src/rxiv_maker/__version__.py"
[tool.hatch.envs.default]
dependencies = [
"pytest>=7.4.4",
"pytest-cov>=4.0",
"mypy>=1.0",
"ruff>=0.12.2",
"pre-commit>=4.2.0",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "pytest --cov=src/rxiv_maker {args:tests}"
lint = "ruff check {args:src}"
format = "ruff format {args:src}"
type-check = "mypy {args:src/rxiv_maker}"
all = ["lint", "type-check", "test-cov"]
[tool.hatch.envs.docs]
dependencies = [
"mkdocs>=1.4.0",
"mkdocs-material>=9.0.0",
"mkdocstrings[python]>=0.20.0",
]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build"
serve = "mkdocs serve"
# Console scripts entry point
[project.scripts]
rxiv = "rxiv_maker.cli:main"
rxiv-install-deps = "rxiv_maker.install.manager:main"
# Typos spell checker configuration
[tool.typos.files]
extend-exclude = [
"*.log",
"*.bib",
"*.tex",
"*.pdf",
"*.png",
"*.jpg",
"*.jpeg",
"*.svg",
"build/",
"dist/",
".git/",
"__pycache__/",
"*.egg-info/",
"src/docker/**", # Docker-related files may contain non-standard text
]
[tool.typos.default]
extend-ignore-re = [
# LaTeX commands and environments
"\\\\[a-zA-Z]+",
# File paths and URLs
"[a-zA-Z0-9-_.]+\\.[a-zA-Z0-9]{2,}",
]
[tool.typos.default.extend-words]
# Add technical terms and proper names that might be flagged as typos
rxiv = "rxiv"
arxiv = "arxiv"
biorxiv = "biorxiv"
preprint = "preprint"
doi = "doi"
orcid = "orcid"
yaml = "yaml"
toml = "toml"
# Institution names and proper nouns
instituto = "instituto" # Portuguese for "institute"
tennant = "tennant" # Proper surname
# LaTeX formatting sequences
ois = "ois" # Part of LaTeX accent commands like {\c{c}}ois
ure = "ure" # As in "Figure"
# File extensions
fot = "fot" # LaTeX font outline file extension
# Python/matplotlib functions
setp = "setp" # matplotlib function plt.setp()
# GObject Introspection packages - legitimate package names, not typos
gir = "gir" # Prevent "gir1.2-*" packages from being changed to "git1.2-*"
# Bandit security scanner configuration
[tool.bandit]
exclude_dirs = [
"tests",
"docs",
".venv",
"output",
]
skips = [
"B101", # assert_used
"B404", # subprocess
"B601", # shell_injection
"B602", # subprocess_popen_with_shell_equals_true
"B603", # subprocess_without_shell_equals_true
"B604", # any_other_function_with_shell_equals_true
"B605", # start_process_with_a_shell
"B606", # start_process_with_no_shell
"B607", # start_process_with_partial_path
]
# Mermaid diagram configuration
[tool.mermaid]
theme = "dark"
[tool.mermaid.themeVariables]
primaryColor = "#1f2937"
primaryTextColor = "#ffffff"
primaryBorderColor = "#ffffff"
secondaryBorderColor = "#ffffff"
tertiaryBorderColor = "#ffffff"
secondaryTextColor = "#ffffff"
tertiaryTextColor = "#ffffff"
textColor = "#ffffff"
fontFamily = "Arial, sans-serif"
fontSize = "16px"
# Hatchling build configuration
[tool.hatch.build.targets.wheel]
packages = ["src/rxiv_maker"]
[tool.hatch.build.targets.wheel.force-include]
"src/tex" = "rxiv_maker/tex"
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
"/README.md",
"/LICENSE",
"/CHANGELOG.md",
"/pyproject.toml"
]