-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
132 lines (106 loc) · 3.38 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
[project]
name = "nbcat"
version = "0.2.0+dev"
description = "display jupyter notebooks in the terminal"
authors = [{name="Tsvika S", email= "tsvikas@gmail.com"}]
license.text = "AGPL-3.0-or-later"
readme = "README.md"
urls.repository = "https://github.com/tsvikas/nbcat"
requires-python = ">= 3.9"
dependencies= [
"pygments >= 2.17",
"typer >= 0.15",
"nbconvert >= 7.16",
]
[project.scripts]
nbcat = "nbcat.__main__:app"
[dependency-groups]
dev = [
# dev
"black[jupyter] >= 24",
"ruff >= 0.8",
"pre-commit >= 4",
# typing
"mypy >= 1",
"types-Pygments >= 2.17",
# tests
"pytest >= 8",
"pytest-clarity >= 1",
"pytest-cov >= 6",
"pytest-pretty >= 1",
"pytest-reverse >= 1",
"pytest-datadir >= 1.5.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.pytest.ini_options]
addopts = ["--doctest-modules", "--cov=nbcat"]
[tool.mypy]
mypy_path = "stubs"
packages = "nbcat"
strict = true
[tool.black]
target-version = ["py39"]
preview = false
[tool.ruff]
target-version = "py39"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# needed only in large codebases
"TD002", # flake8-todos/missing-todo-author
"TD003", # flake8-todos/missing-todo-link
# incompatible with other rules
"D203", # pydocstyle/one-blank-line-before-class, incompatible D211
"D212", # pydocstyle/multi-line-summary-first-line, incompatible D213
"D400", # pydocstyle/ends-in-period, incompatible D415
"COM812", # flake8-commas/missing-trailing-comma, incompatible with black
# wrong:
"PD010", # pandas-vet/pandas-use-of-dot-pivot-or-unstack
"PD013", # pandas-vet/pandas-use-of-dot-stack
"EM", # flake8-errmsg
# annoying:
"RET504", # flake8-return/unnecessary-assign
"ANN1", # flake8-annotations/missing-type-self,missing-type-cls
]
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true # allow you to omit the return type annotation for __init__ methods
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.lint.per-file-ignores]
"nbcat/" = [
"PT", # flake8-pytest-style
]
"tests/*.py" = [
"INP001", # flake8-no-pep420/implicit-namespace-package
"PLR2004", # PyLint-Refactor/magic-value-comparison
"S101", # flake8-bandit/assert
"D1", # pydocstyle/undocumented-*
]
"tests/**.ipynb" = ["D", "ANN", "T201", "PLR2004"]
[tool.poe.tasks]
check = ["format", "lint", "test"]
test = "pytest"
lint-mypy = "mypy"
[tool.poe.tasks.format]
sequence = ["format-isort $target", "format-black $target"]
args = [{name="target", positional=true, default=".", multiple=true}]
[tool.poe.tasks.format-isort]
cmd = "ruff check --select I001 --fix $target"
args = [{name="target", positional=true, default=".", multiple=true}]
[tool.poe.tasks.format-black]
cmd = "black $target"
args = [{name="target", positional=true, default=".", multiple=true}]
[tool.poe.tasks.lint]
sequence = ["lint-ruff $target", "lint-mypy"]
args = [{name="target", positional=true, default=".", multiple=true}]
[tool.poe.tasks.lint-ruff]
cmd = "ruff check $target"
args = [{name="target", positional=true, default=".", multiple=true}]
[tool.poe.tasks._tag]
cmd = "git tag -a $tagname -m \"version $tagname\" -e"
args = [{name="tagname", positional=true, required=true}]
[tool.poe.tasks.tag]
sequence = ["check", "_tag $tagname"]
args = [{name="tagname", positional=true, required=true}]