forked from drivendataorg/cookiecutter-data-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
205 lines (175 loc) · 6.11 KB
/
pyproject.toml
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
[build-system]
requires = ["flit_core >=3.2,<3.13"]
build-backend = "flit_core.buildapi"
[tool.flit.module]
name = "ccds"
[tool.flit.sdist]
exclude = [
"docs/*",
"tests/*",
".cache/*",
".github/*",
".vscode/*"
]
[project]
name = "gatlens-opinionated-template"
version = "0.4.1"
description = "A modern, opinionated full-stack CookieCutter project template that prioritizes developer experience and cutting-edge tools."
authors = [
{ name = "Gatlen Culp", email = "[email protected]" },
{ name = "DrivenData", email = "[email protected]" },
]
license = { file = "LICENSE" }
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
requires-python = ">=3.10,<4"
dependencies = [
"click>=8.1.0",
"cookiecutter>=2.6.0",
"pymdown-extensions>=10.13",
]
[project.scripts]
gotem = "ccds.__main__:main"
[project.urls]
"Source Code" = "https://github.com/GatlenCulp/gatlens-opinionated-template"
"Documentation" = "https://gatlenculp.github.io/gatlens-opinionated-template/"
[dependency-groups]
dev = [
"ansi2html>=1.9.2",
"black>=24.8.0",
"build>=1.2.2.post1",
"chardet>=5.2.0",
"cz-conventional-gitmoji>=0.6.1",
"flake8>=5.0.4",
"ipykernel>=6.29.5",
"isort>=5.13.2",
"mdformat-frontmatter>=2.0.8",
"mkdocs>=1.6.1",
"mkdocs-gen-files>=0.5.0",
"mkdocs-include-markdown-plugin>=6.2.2",
"mkdocs-material>=9.5.49",
"mypy>=1.14.1",
"pexpect>=4.9.0",
"pipenv>=2024.4.0",
"pre-commit>=3.5.0",
"pytest>=8.3.4",
"pytest-icdiff>=0.9",
"pytest-sugar>=1.0.0",
"pytest-timeout>=2.3.0",
"pytest-watcher>=0.4.3",
"ruff>=0.8.4",
"termynal>=0.2.0",
"twine>=6.0.1",
"uv>=0.5.11",
"virtualenvwrapper>=6.1.1 ; sys_platform != 'win32'",
"virtualenvwrapper-win>=1.2.7 ; sys_platform == 'win32'",
"commitizen>=4.1.0",
"nbqa>=1.9.1",
"validate-pyproject>=0.23",
"mdformat>=0.7.21",
"mdformat-gfm>=0.4.1",
"mdformat-ruff>=0.1.3",
"pip>=24.3.1",
"notebook>=7.3.2",
"watermark>=2.5.0",
]
# pyforest?
# ---------------------------------------------------------------------------- #
# ruff formatter/linter #
# ---------------------------------------------------------------------------- #
# ----------------------------- ruff global config ----------------------------- #
[tool.ruff]
cache-dir = ".cache/ruff"
line-length = 100
# Doesn't work, this is a bug with ruff.
# https://github.com/astral-sh/ruff/issues/9381
# exclude = ["*/{{{{ cookiecutter.repo_name }}}}/*"]
exclude = [
"*cookiecutter*",
"tests/test-linting/*"
]
[tool.ruff.lint]
# TODO: Different groups of linting styles depending on code use.
select = ["ALL"]
ignore = [
"FIX002", # Allow TODOs
"TD003" # Allow TODO to not have link to issue
]
[tool.ruff.lint.isort]
known-first-party = ["{{ cookiecutter.module_name }}"]
force-sort-within-sections = true
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Allow unused imports in __init__.py
"tests/**/*.py" = [
# at least this three should be fine in tests:
"S101", # asserts allowed in tests...
"ARG", # Unused function args -> fixtures nevertheless are functionally relevant...
"FBT", # Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
# The below are debateable
"PLR2004", # Magic value used in comparison, ...
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"ANN001", "ANN201", # Allow for non-typed functions
"RET503", # Allow for implicit ignores
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pycodestyle]
max-doc-length = 99
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
# ---------------------------------------------------------------------------- #
# pydoclint #
# ---------------------------------------------------------------------------- #
[tool.pydoclint]
style = "google"
arg-type-hints-in-docstring = false
check-return-types = true
exclude = '\.venv'
# ---------------------------------------------------------------------------- #
# pyright #
# ---------------------------------------------------------------------------- #
[tool.pyright]
include = ["."]
# ---------------------------------------------------------------------------- #
# pytest #
# ---------------------------------------------------------------------------- #
[tool.pytest.ini_options]
addopts = """
--tb=long
--code-highlight=yes
--color=yes
-vv
"""
testpaths = ["./tests"]
log_file = "./logs/pytest.log"
# ---------------------------------------------------------------------------- #
# uv #
# ---------------------------------------------------------------------------- #
[tool.uv.sources]
gatlens-opinionated-template = { workspace = true }
# ---------------------------------------------------------------------------- #
# commitizen #
# ---------------------------------------------------------------------------- #
[tool.commitizen]
# TODO: Add commitlint + cz-git integration (seems difficult)
# TODO: Add custom scopes (also seems a bit hard to customize)
# name = "cz_gitmoji" # https://github.com/ljnsn/cz-conventional-gitmoji
version_scheme = "semver2"
version_provider = "pep621"
update_changelog_on_bump = true