-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
116 lines (108 loc) · 3.92 KB
/
pyproject.toml
File metadata and controls
116 lines (108 loc) · 3.92 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
[project]
name = "DiscordBot"
version = "3.0.12"
description = "A simple Discord bot with OpenAI support 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",
"DiscordBot", "discord-bot", "bot",
"discord-py", "discord-py-bot", "discord"
]
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"
dependencies = [
"alembic>=1.18.4",
"beautifulsoup4>=4.14.3",
"better-profanity>=0.7.0",
"ddcdatabases[postgres]>=4.0.1",
"discord-py>=2.7.1",
"gTTS>=2.5.4",
"openai>=2.30.0",
"PyNaCl>=1.6.2",
"pythonLogs>=7.0.0",
"uuid-utils>=0.14.1",
]
[dependency-groups]
dev = [
"coverage>=7.13.5",
"poethepoet>=0.42.1",
"pytest-asyncio>=1.3.0",
"ruff>=0.15.8",
"testcontainers[postgres]>=4.14.2",
]
[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"
test.sequence = [{ shell = "uv run coverage run -m pytest tests/unit" }, { shell = "uv run coverage report" }, { shell = "uv run coverage xml" }]
test-integration = "uv run 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"
tests.sequence = ["linter", "hadolint", "test-docker", "test", "test-integration"]
updatedev.sequence = ["linter", {shell = "uv lock --upgrade && uv sync --all-extras --all-groups"}]
migration = "uv run --frozen alembic upgrade head"
[tool.pytest.ini_options]
addopts = "-v --import-mode=importlib --junitxml=junit.xml"
junit_family = "legacy"
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",
]
[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