Debian Codegraph @

pyproject.toml

raw
1 [build-system]
2 requires = ["hatchling"]
3 build-backend = "hatchling.build"
4
5 [project]
6 dynamic = ["version"]
7 name = "aiosmtplib"
8 description = "asyncio SMTP client"
9 authors = [{ name = "Cole Maclean", email = "[email protected]" }]
10 license = { text = "MIT" }
11 readme = "README.rst"
12 requires-python = ">=3.10"
13 keywords = ["smtp", "email", "asyncio"]
14 classifiers = [
15 "Development Status :: 5 - Production/Stable",
16 "Environment :: No Input/Output (Daemon)",
17 "Framework :: AsyncIO",
18 "Intended Audience :: Developers",
19 "Natural Language :: English",
20 "Operating System :: OS Independent",
21 "Topic :: Communications",
22 "Topic :: Communications :: Email",
23 "Topic :: Software Development :: Libraries",
24 "Topic :: Software Development :: Libraries :: Python Modules",
25 "Typing :: Typed",
26 ]
27
28 [project.urls]
29 Documentation = "https://aiosmtplib.readthedocs.io/en/stable/"
30 Changelog = "https://github.com/cole/aiosmtplib/blob/main/CHANGELOG.rst"
31 GitHub = "https://github.com/cole/aiosmtplib"
32
33 [project.optional-dependencies]
34 uvloop = ["uvloop>=0.18"]
35 # Docs extra is planned for removal in 4.x
36 docs = [
37 "sphinx>=7.0.0",
38 "sphinx_autodoc_typehints>=1.24.0",
39 "sphinx-copybutton>=0.5.0",
40 "furo>=2023.9.10",
41 ]
42
43 [tool.hatch.version]
44 path = "src/aiosmtplib/__init__.py"
45
46 [tool.poe.tasks]
47 lint = { cmd = "uvx ruff check src tests", help = "Lint with ruff" }
48 format = { cmd = "uvx ruff format src tests", help = "Format with ruff" }
49 format-check = { cmd = "uvx ruff format --check src tests", help = "Check formatting (no writes)" }
50 security = { cmd = "uvx bandit -n 10 -x tests -r src/aiosmtplib", help = "Scan for security issues with bandit" }
51 test = { cmd = "pytest", help = "Run the test suite" }
52 coverage-report = { cmd = "uvx coverage report --fail-under=100", help = "Report coverage (fails under 100%)" }
53 docs = { cmd = "uv run --with-requirements docs/requirements.txt --with . python -m sphinx -nWT -b html docs docs/build/html", help = "Build the HTML docs" }
54
55 [tool.poe.tasks.typecheck-mypy]
56 help = "Type check with mypy"
57 default_item_type = "cmd"
58 sequence = ["uvx mypy src/aiosmtplib", "uvx --with . mypy tests/type_usage.py"]
59
60 [tool.poe.tasks.typecheck-pyright]
61 help = "Type check with pyright"
62 default_item_type = "cmd"
63 sequence = ["uvx pyright src/aiosmtplib", "uvx --with . pyright tests/type_usage.py"]
64
65 [tool.poe.tasks.typecheck-ty]
66 help = "Type check with ty"
67 default_item_type = "cmd"
68 sequence = ["uvx ty check src/aiosmtplib", "uvx --with . ty check tests/type_usage.py"]
69
70 [tool.poe.tasks.typecheck]
71 help = "Run all type checkers (mypy, pyright, ty)"
72 default_item_type = "ref"
73 sequence = ["typecheck-mypy", "typecheck-pyright", "typecheck-ty"]
74
75 [tool.poe.tasks.buildcheck]
76 help = "Validate built artifacts (run `uv build` first)"
77 default_item_type = "cmd"
78 sequence = ["uvx check-wheel-contents dist", "uvx twine check --strict dist/*.whl dist/*.tar.gz"]
79
80 [tool.poe.tasks.check]
81 help = "Run all lint/type/security/test checks"
82 default_item_type = "ref"
83 sequence = ["lint", "format-check", "typecheck", "security", "test"]
84
85 [tool.pytest.ini_options]
86 pythonpath = "src"
87 asyncio_mode = "auto"
88 asyncio_default_fixture_loop_scope = "function"
89 minversion = "6.0"
90 junit_family = "xunit2"
91 addopts = ["--import-mode=importlib", "--strict-markers"]
92 testpaths = ["tests"]
93 filterwarnings = [
94 # aiosmtpd 1.4.6 still imports typing.ByteString (deprecated in 3.14)
95 "ignore:'typing.ByteString' and 'collections.abc.ByteString' are deprecated:DeprecationWarning:aiosmtpd.proxy_protocol",
96 ]
97 markers = [
98 "smtpd_options",
99 "smtpd_mocks",
100 "smtp_client_options",
101 "skip_if_uvloop",
102 ]
103
104 [tool.ruff]
105 target-version = "py310"
106 line-length = 88
107
108 [tool.ruff.lint]
109 # Enable flake8-bugbear (`B`) rules.
110 select = ["E", "F", "B", "UP045", "UP007"]
111 # Never enforce `E501` (line length violations).
112 ignore = ["E501"]
113 # Avoid trying to fix flake8-bugbear (`B`) violations.
114 unfixable = ["B"]
115
116 [tool.coverage]
117
118 [tool.coverage.run]
119 source = ["aiosmtplib"]
120 branch = true
121 parallel = true
122 patch = ["subprocess"]
123
124 [tool.coverage.report]
125 show_missing = true
126 exclude_lines = [
127 "pass",
128 "pragma: no cover",
129 "raise NotImplementedError",
130 ]
131
132 [tool.coverage.paths]
133 source = [
134 "src/aiosmtplib",
135 "/opt/pypy/lib/pypy3.*/site-packages/aiosmtplib",
136 "/usr/local/lib/python3.*/site-packages/aiosmtplib",
137 "/root/project/.venv/lib/python3.*/site-packages/aiosmtplib",
138 ]
139
140 [tool.pyright]
141 strict = ["src/aiosmtplib"]
142 # exclude all tests except pyright_usage
143 exclude = [
144 "tests/test_*.py",
145 "tests/auth.py",
146 "tests/compat.py",
147 "tests/conftest.py",
148 "tests/smtpd.py",
149 ]