-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
141 lines (131 loc) · 4.67 KB
/
Copy pathpyproject.toml
File metadata and controls
141 lines (131 loc) · 4.67 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
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
[project]
name = "DiscordBot"
version = "3.0.18"
description = "A simple Discord bot with multi-provider AI commands (OpenAI / Claude / Gemini) and server administration tools"
urls.Repository = "https://github.com/ddc/DiscordBot"
urls.Homepage = "https://ddc.github.io/DiscordBot"
license = { text = "MIT" }
readme = "README.md"
authors = [
{ name = "Daniel Costa", email = "daniel@ddcsoftwares.com" },
]
maintainers = [
{ name = "Daniel Costa" },
]
keywords = [
"python", "python3", "python-3",
"bot", "discord",
"DiscordBot", "discord-bot",
"discordpy", "discord-py", "discord-py-bot",
]
classifiers = [
"Topic :: Communications :: Chat",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Environment :: No Input/Output (Daemon)",
"Intended Audience :: Developers",
"Natural Language :: English",
]
requires-python = ">=3.14.6"
dependencies = [
"alembic>=1.18.5",
"anthropic>=0.117.0",
"beautifulsoup4>=4.15.0",
"better-profanity>=0.7.0",
"ddcdatabases[postgres]>=4.0.1",
"discord-py>=2.7.1",
"google-genai>=2.12.1",
"gTTS>=2.5.4",
"openai>=2.46.0",
"PyNaCl>=1.6.2",
"pythonLogs>=7.0.1",
"uuid-utils>=0.17.0",
]
[dependency-groups]
dev = [
"coverage>=7.15.2",
"poethepoet>=0.48.0",
"pytest-asyncio>=1.4.0",
"ruff>=0.15.22",
"testcontainers[postgres]>=4.15.0rc4",
]
[tool.poe.tasks]
linter.shell = "uv run ruff check --fix . && uv run ruff format ."
snyk-export.shell = "rm -f requirements.txt && uv export --no-hashes --no-annotate --format requirements-txt > requirements.txt && uvx pre-commit run --all-files || uvx pre-commit run --all-files"
snyk-container.shell = "docker build -t discordbot:snyk-scan . && snyk container test discordbot:snyk-scan --file=Dockerfile; docker rmi discordbot:snyk-scan"
snyk.sequence = ["snyk-export", { shell = "uv pip install pip && snyk test --file=requirements.txt && snyk code test; uv pip uninstall pip" }, "snyk-container"]
profile = "uv run python -m cProfile -o cprofile_unit.prof -m pytest tests/unit"
profile-integration = "uv run python -m cProfile -o cprofile_integration.prof -m pytest tests/integration"
hadolint.shell = "docker run --rm -i -v $(pwd)/.hadolint.yml:/.config/hadolint.yml:ro hadolint/hadolint < Dockerfile"
test-docker = "uv run pytest tests/docker"
test-unit.sequence = [
{ shell = "uv run coverage erase" },
{ shell = "uv run coverage run --append -m pytest tests/unit" },
{ shell = "uv run coverage report" },
{ shell = "uv run coverage xml" },
]
test-integration.sequence = [
{ shell = "uv run coverage run --append -m pytest tests/integration" },
{ shell = "uv run coverage report" },
]
tests.sequence = [
"linter", "hadolint", "test-docker",
{ shell = "uv run coverage erase" },
{ shell = "uv run coverage run --append -m pytest tests/unit" },
{ shell = "uv run coverage run --append -m pytest tests/integration" },
{ shell = "uv run coverage report" },
{ shell = "uv run coverage xml" },
]
updatedev.sequence = [{ shell = "uv lock --upgrade && uv sync --all-extras --all-groups" }, "snyk-export"]
migration = "uv run --frozen alembic upgrade head"
[tool.pytest.ini_options]
addopts = "-v --import-mode=importlib"
asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "function"
markers = [
"integration: marks tests as integration tests",
"docker: Docker and compose file tests",
"gw2_api: marks tests that require GW2 API access",
]
filterwarnings = [
# discord.py uses asyncio.iscoroutinefunction (deprecated in Python 3.16).
"ignore:'asyncio.iscoroutinefunction' is deprecated:DeprecationWarning",
# google-genai uses _UnionGenericAlias (deprecated in Python 3.17).
"ignore:'_UnionGenericAlias' is deprecated:DeprecationWarning",
]
[tool.coverage.run]
omit = [
"tests/*",
"*/__init__.py",
]
[tool.coverage.report]
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.ruff]
line-length = 120
target-version = "py314"
[tool.ruff.lint]
select = ["E", "W", "F", "I", "B", "C4", "UP", "S", "SLF"]
ignore = ["E501", "E402", "UP046", "UP047"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/**/*.py" = ["S101", "S105", "S106", "S110", "S311", "S603", "S607", "SLF001", "F841"]
[tool.ruff.lint.isort]
known-first-party = ["DiscordBot"]
no-lines-before = ["future", "standard-library", "third-party", "first-party", "local-folder"]
no-sections = true