-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
93 lines (83 loc) Β· 3.48 KB
/
Copy pathpyproject.toml
File metadata and controls
93 lines (83 loc) Β· 3.48 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
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "ghostbit"
version = "1.6.0"
description = "Self-hosted, end-to-end encrypted paste service"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
authors = [{ name = "StackOps" }]
# Keep this list aligned with requirements.txt. The requirements files stay
# the source of truth for the Docker build (pinned, no extras resolution),
# pyproject.toml describes the package for editable installs and tooling.
dependencies = [
"fastapi>=0.110.0",
"slowapi>=0.1.9",
"uvicorn[standard]>=0.27.0",
"jinja2>=3.1.3",
"python-multipart>=0.0.9",
"aiosqlite>=0.20.0",
"redis>=5.0.0",
"cryptography>=42.0.0",
"argon2-cffi>=23.1.0",
"pydantic-settings>=2.2.0",
"pygments>=2.17.0",
"prometheus-client>=0.20.0",
]
[project.optional-dependencies]
dev = [
"pytest",
"pytest-asyncio",
"httpx",
"ruff>=0.5",
]
[project.urls]
Homepage = "https://github.com/stackopshq/ghostbit"
Repository = "https://github.com/stackopshq/ghostbit"
[tool.setuptools.packages.find]
include = ["app*"]
[tool.setuptools.package-data]
app = ["languages.json"]
# ββ Ruff β lint + format βββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Intentionally narrow ruleset for an established codebase: enable the checks
# that catch real bugs (pyflakes F, pycodestyle E/W, bugbear B, simplify SIM,
# comprehensions C4, pyupgrade UP) and rely on ruff format for style. The full
# E501 line length enforcement is off because much of the existing code has
# intentionally long URLs/strings.
[tool.ruff]
line-length = 100
target-version = "py310"
extend-exclude = ["static/*.min.js", "static/cm"]
[tool.ruff.lint]
select = ["F", "E", "W", "I", "B", "SIM", "C4", "UP"]
ignore = [
"E501", # line too long β handled loosely; formatter wraps what it can
"E731", # lambda assignments β used deliberately in a couple of rate-limit decorators
"B008", # function calls in argument defaults β FastAPI relies on these (Path, Header, Form, Field)
]
[tool.ruff.format]
quote-style = "double"
[tool.pytest.ini_options]
asyncio_mode = "auto"
# The HTTP client fixture is module-scoped and the Redis backend pins its
# aioredis client to the event loop where init() ran. Default (function-
# scoped loops) would tear that loop down between tests and every
# subsequent Redis call would die with "Future attached to a different
# loop". Module-scoped loops keep the fixture and its client coherent.
# SQLite via aiosqlite is loop-agnostic, so this is a no-op for that backend.
#
# For the same reason, pytest-asyncio must be the ONLY async plugin driving
# these tests: do not add @pytest.mark.anyio. anyio's plugin parametrizes marked
# tests ("[asyncio]") and runs them in loops it manages itself, while the
# module-scoped fixtures stay on pytest-asyncio's loop. The Redis pool then ends
# up holding connections opened on loops that are already closed, and the module
# teardown dies with "RuntimeError: Event loop is closed" β reproducible only in
# CI. asyncio_mode = "auto" already handles every async test without a marker.
asyncio_default_fixture_loop_scope = "module"
asyncio_default_test_loop_scope = "module"
testpaths = ["tests"]
filterwarnings = [
"ignore::DeprecationWarning:slowapi.*",
]