generated from seapagan/poetry-dev-setup
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
193 lines (167 loc) · 5.59 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
[project]
name = "pyproject-maker"
version = "0.13.0"
description = "A command line app to create a Python project skeleton."
authors = [{ name = "Grant Ramsay", email = "[email protected]" }]
readme = "README.md"
license = "MIT"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development",
"Topic :: Software Development :: Code Generators",
"Topic :: Utilities",
]
dependencies = [
"gitpython == 3.1.43",
"jinja2 == 3.1.4",
"pydantic == 2.9.2",
"pygithub == 2.4.0",
"requests == 2.32.3",
"rich == 13.9.2",
"rtoml == 0.11.0",
"simple-toml-settings == 0.8.0",
"typer == 0.12.5",
"validators == 0.34.0",
]
[tool.uv]
dev-dependencies = [
"mypy == 1.11.2",
"pre-commit == 4.0.0",
"pymarkdownlnt ==0.9.24",
"ruff == 0.6.9",
"faker ==30.3.0",
"greenlet == 3.1.1",
"mock == 5.1.0",
"pyfakefs ==5.7.0",
"pytest == 8.3.3",
"pytest-cov == 5.0.0",
"pytest-xdist == 3.6.1",
"pytest-sugar == 1.0.0",
"pytest-randomly == 3.15.0",
"pytest-reverse == 1.7.0",
"pytest-mock == 3.14.0",
"pytest-watcher == 0.4.3",
"github-changelog-md == 0.9.5",
"mkdocs == 1.6.1",
"mkdocs-autorefs == 1.2.0",
"mkdocs-material == 9.5.39",
"mkdocs-git-revision-date-localized-plugin == 1.2.9",
"mkdocs-latest-git-tag-plugin == 0.1.2",
"mkdocs-minify-plugin == 0.8.0",
"mkdocstrings == 0.26.1",
"pymdown-extensions == 10.11.2",
"pygments == 2.18.0",
"types-requests == 2.32.0.20240914",
"poethepoet == 0.29.0",
]
[project.urls]
repository = "https://github.com/seapagan/py-maker"
homepage = "https://py-maker.seapagan.net"
documentation = "https://py-maker.seapagan.net"
"Pull Requests" = "https://github.com/seapagan/py-maker/pulls"
"Bug Tracker" = "https://github.com/seapagan/py-maker/issues"
"Changelog" = "https://github.com/seapagan/py-maker/blob/main/CHANGELOG.md"
[project.scripts]
pymaker = "py_maker.main:app"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["py_maker"]
# Configure dev dependencies
[tool.poe.tasks]
# setup 'PoeThePoet' tasks
pre.cmd = "pre-commit run --all-files"
pre.help = "Run pre-commit checks"
mypy.cmd = "mypy py_maker/**/*.py tests/**/*.py --strict"
mypy.help = "Run mypy checks"
format.cmd = "ruff format ."
format.help = "Format code with Ruff"
ruff.cmd = "ruff check ."
ruff.help = "Run Ruff checks"
markdown.cmd = "pymarkdown scan -r py_maker/**/[!CHANGELOG,!.github/]*.md docs/**/*.md"
markdown.help = "Run markdown checks"
# run all linting checks in sequence. we want to run them all, even if one fails
lint.ignore_fail = "return_non_zero"
lint.sequence = ["format", "ruff", "mypy", "markdown"]
lint.help = "Run all linting checks"
# testing with pytest
test.cmd = "pytest"
test.help = "Run all tests (pytest)"
"test:watch".cmd = "ptw . --now --clear"
"test:watch".help = "Run tests using Pytest in watch mode"
# tasks to deal with documentation
"docs:publish".cmd = "mkdocs gh-deploy"
"docs:publish".help = "Publish documentation to GitHub Pages"
"docs:build".cmd = "mkdocs build"
"docs:build".help = "Build documentation locally to './site' folder"
"docs:serve".cmd = "mkdocs serve -w TODO.md -w CHANGELOG.md -w CONTRIBUTING.md"
"docs:serve".help = "Serve documentation locally"
"docs:serve:all".cmd = "mkdocs serve -w TODO.md -w CHANGELOG.md -w CONTRIBUTING.md -a 0.0.0.0:9000"
"docs:serve:all".help = "Serve documentation locally on all interfaces"
# Generate a CHANGELOG.md
changelog.cmd = "github-changelog-md -r py-maker"
changelog.help = "Generate a CHANGELOG.md file"
# configure assorted tools and linters
[tool.pymarkdown]
plugins.md014.enabled = false
plugins.md046.enabled = false
extensions.front-matter.enabled = true
[tool.ruff]
line-length = 80
src = ["py_maker"]
target-version = "py39" # minimum python version supported
[tool.ruff.format]
indent-style = "space"
quote-style = "double"
[tool.ruff.lint]
select = ["ALL"] # we are being very strict!
ignore = [
"ANN101",
"PGH003",
"FBT002",
"FBT003",
"B006",
] # These rules are too strict even for us 😝
extend-ignore = ["COM812", "ISC001"] # these are ignored for ruff formatting
[tool.ruff.lint.pylint]
max-args = 6
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["pydantic.validator", "pydantic.root_validator"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.extend-per-file-ignores]
"tests/**/*.py" = [
"S101", # we can (and MUST!) use 'assert' in test files.
"ANN001", # annotations for fixtures are sometimes a pain for test files
"ARG002", # often fixtures are not used in test files but need to be there
]
"py_maker/main.py" = ["UP007", "PLR0913"] # These cause issues in Typer Apps
"py_maker/commands/*.py" = ["UP007", "PLR0913"] # Same as above
[tool.ruff.lint.isort]
known-first-party = ["py_maker"]
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[[tool.mypy.overrides]]
disable_error_code = ["method-assign", "no-untyped-def", "attr-defined"]
module = "tests.*"
# Options for pytest and coverage
[tool.pytest.ini_options]
addopts = ["--cov", "--cov-report", "term-missing", "--cov-report", "html"]
filterwarnings = []
mock_use_standalone_module = true
markers = ["e2e: mark a test as an end-to-end test."]
[tool.coverage.run]
omit = ["*/tests/*", "py_maker/tree/*"]
source = ["py_maker"]
[tool.coverage.report]
show_missing = true