-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
169 lines (146 loc) · 4.4 KB
/
pyproject.toml
File metadata and controls
169 lines (146 loc) · 4.4 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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["tests*"]
namespaces = false
[tool.setuptools.package-data]
"assets" = ["*"]
[project]
name = "python-app-template"
version = "0.2.1"
description = "A template for python (dockerized) applications."
readme = "README.md"
license = "Apache-2.0"
authors = [
{ name = "Tomás J. Link", email = "tomas.link@globalfishingwatch.org" },
]
maintainers = [
{ name = "Tomás J. Link", email = "tomas.link@globalfishingwatch.org" },
]
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">= 3.9"
dependencies = [
"pyyaml~=6.0",
"rich~=14.0",
"rich-argparse~=1.6",
]
[project.urls]
Homepage = "https://github.com/GlobalFishingWatch/python-app-template"
Documentation = "https://globalfishingwatch.github.io/python-app-template/"
Changelog = "https://github.com/GlobalFishingWatch/python-app-template/blob/main/CHANGELOG.md"
Repository = "https://github.com/GlobalFishingWatch/python-app-template"
Issues = "https://github.com/GlobalFishingWatch/python-app-template/issues"
[project.scripts]
python-app-template = "python_app_template.cli.main:main"
[project.optional-dependencies]
# Linting and code quality tools
lint = [
"black~=25.1", # Code formatting tool.
"isort~=6.0", # Python imports sorting tool.
"mypy~=1.15", # Static type checker.
"pydocstyle~=6.3", # Python docstring style checker.
"ruff~=0.11", # Linter and code analysis tool.
"codespell[toml]~=2.4", # Spell checker for code.
"flake8~=7.0", # Simple PEP8 checker.
"types-PyYAML", # MyPy stubs for pyyaml.
]
# Development workflow and tools
dev = [
"pre-commit~=4.2", # Framework for managing pre-commit hooks.
"pip-tools>=7.4,<8.0", # Compatible with pip 24+, fixes use_pep517 AttributeError.
"pip-audit~=2.8", # Audit for finding vulnerabilities in dependencies.
]
# Build tools
build = [
"build~=1.2", # Python PEP 517 compliant build system.
"setuptools~=78.1", # Python packaging library.
"twine~=6.1", # For uploading Python packages to PyPI.
]
[tool.ruff]
fix = true
line-length = 99
src = ["src", "tests"]
target-version = "py312"
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
unfixable = []
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"RUF", # Ruff-specific rules
"ANN", # flake8-annotations
"C", # flake8-comprehensions
"B", # flake8-bugbear
"I", # isort
"D", # pydocstyle
]
ignore = [
"E501", # line too long, handled by black
"C901", # too complex
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
[tool.ruff.lint.isort]
lines-after-imports = 2
lines-between-types = 1
known-first-party = ["gfw", "tests"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.black]
target-version = ["py312"]
line-length = 99
[tool.isort]
profile = "black"
line_length = 99
known_first_party = ["gfw"]
lines_after_imports = 2
lines_between_sections = 1
lines_between_types = 1
ensure_newline_before_comments = true
force_sort_within_sections = true
src_paths = ["src", "tests"]
[tool.pydocstyle]
convention = "google"
[tool.mypy]
strict = true
ignore_missing_imports = true
files = "src"
disallow_untyped_calls = false
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
addopts = "-v --cov=python_app_template --cov=init_project --cov-report=term-missing"
[tool.coverage.run]
branch = true
parallel = true
context = "${CONTEXT}"
[tool.coverage.report]
precision = 0
skip_empty = true
ignore_errors = false
show_missing = true
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
"AbstractMethodError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.codespell]
skip = '.git,env*,venv*,.venv*, build*,tmp*'