-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpyproject.toml
81 lines (70 loc) · 2.09 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
[tool.poe.tasks]
# run with eg `uv run poe fmt`
fmt = "ruff format"
lint = "ruff check --fix"
check = "pyright"
test = "pytest"
# run all the above
all = [ {ref="fmt"}, {ref="lint"}, {ref="check"}, {ref="test"} ]
"ci:fmt" = "ruff format --check" # fail if not formatted
"ci:lint" = "ruff check"
[project]
name = "postmodern"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
authors = [
]
# Public libraries should be more lenient
# Internal stuff should enforce ~=3.13!
requires-python = ">=3.11"
dependencies = [
"pydantic>=2.10.4",
]
[dependency-groups]
dev = [
"poethepoet>=0.32.0",
"pyright>=1.1.391",
"pytest>=8.3.4",
"ruff>=0.8.5",
]
[tool.uv]
# tell uv we're building a package
# (i.e. something we can distribute for others to use)
# uncomment this to use project.scripts
# package = true
# [project.scripts]
# running `postmodern` will run the `postmodern.main` function
# postmodern = "postmodern.hello:main"
[tool.ruff]
# if this is a library, enter the _minimum_ version you
# want to support, otherwise do py313
target-version = "py313"
line-length = 120 # use whatever number makes you happy
[tool.ruff.lint]
# you can see the looong list of rules here:
# https://docs.astral.sh/ruff/rules/
# here's a couple to start with
select = [
"A", # warn about shadowing built-ins
"E", # style stuff, whitespaces
"F", # important pyflakes lints
"I", # import sorting
"N", # naming
"T100", # breakpoints (probably don't want these in prod!)
]
# if you're feeling confident you can do:
# select = ["ALL"]
# and then manually ignore annoying ones:
# ignore = [...]
[tool.ruff.lint.isort]
# so it knows to group first-party stuff last
known-first-party = ["postmodern"]
[tool.pyright]
venvPath = "." # uv installs the venv in the current dir
venv = ".venv" # in a folder called `.venv`
strict = ["**/*.py"] # use 'strict' checking on all files
pythonVersion = "3.13" # if library, specify the _lowest_ you support
[tool.pytest.ini_options]
addopts = "--doctest-modules"