[build-system] requires = ["hatchling"] build-backend = "hatchling.build" [project] dynamic = ["version"] name = "aiosmtplib" description = "asyncio SMTP client" authors = [{ name = "Cole Maclean", email = "hi@colemaclean.dev" }] license = { text = "MIT" } readme = "README.rst" requires-python = ">=3.10" keywords = ["smtp", "email", "asyncio"] classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: No Input/Output (Daemon)", "Framework :: AsyncIO", "Intended Audience :: Developers", "Natural Language :: English", "Operating System :: OS Independent", "Topic :: Communications", "Topic :: Communications :: Email", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", ] [project.urls] Documentation = "https://aiosmtplib.readthedocs.io/en/stable/" Changelog = "https://github.com/cole/aiosmtplib/blob/main/CHANGELOG.rst" GitHub = "https://github.com/cole/aiosmtplib" [project.optional-dependencies] uvloop = ["uvloop>=0.18"] # Docs extra is planned for removal in 4.x docs = [ "sphinx>=7.0.0", "sphinx_autodoc_typehints>=1.24.0", "sphinx-copybutton>=0.5.0", "furo>=2023.9.10", ] [tool.hatch.version] path = "src/aiosmtplib/__init__.py" [tool.poe.tasks] lint = { cmd = "uvx ruff check src tests", help = "Lint with ruff" } format = { cmd = "uvx ruff format src tests", help = "Format with ruff" } format-check = { cmd = "uvx ruff format --check src tests", help = "Check formatting (no writes)" } security = { cmd = "uvx bandit -n 10 -x tests -r src/aiosmtplib", help = "Scan for security issues with bandit" } test = { cmd = "pytest", help = "Run the test suite" } coverage-report = { cmd = "uvx coverage report --fail-under=100", help = "Report coverage (fails under 100%)" } 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" } [tool.poe.tasks.typecheck-mypy] help = "Type check with mypy" default_item_type = "cmd" sequence = ["uvx mypy src/aiosmtplib", "uvx --with . mypy tests/type_usage.py"] [tool.poe.tasks.typecheck-pyright] help = "Type check with pyright" default_item_type = "cmd" sequence = ["uvx pyright src/aiosmtplib", "uvx --with . pyright tests/type_usage.py"] [tool.poe.tasks.typecheck-ty] help = "Type check with ty" default_item_type = "cmd" sequence = ["uvx ty check src/aiosmtplib", "uvx --with . ty check tests/type_usage.py"] [tool.poe.tasks.typecheck] help = "Run all type checkers (mypy, pyright, ty)" default_item_type = "ref" sequence = ["typecheck-mypy", "typecheck-pyright", "typecheck-ty"] [tool.poe.tasks.buildcheck] help = "Validate built artifacts (run `uv build` first)" default_item_type = "cmd" sequence = ["uvx check-wheel-contents dist", "uvx twine check --strict dist/*.whl dist/*.tar.gz"] [tool.poe.tasks.check] help = "Run all lint/type/security/test checks" default_item_type = "ref" sequence = ["lint", "format-check", "typecheck", "security", "test"] [tool.pytest.ini_options] pythonpath = "src" asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "function" minversion = "6.0" junit_family = "xunit2" addopts = ["--import-mode=importlib", "--strict-markers"] testpaths = ["tests"] filterwarnings = [ # aiosmtpd 1.4.6 still imports typing.ByteString (deprecated in 3.14) "ignore:'typing.ByteString' and 'collections.abc.ByteString' are deprecated:DeprecationWarning:aiosmtpd.proxy_protocol", ] markers = [ "smtpd_options", "smtpd_mocks", "smtp_client_options", "skip_if_uvloop", ] [tool.ruff] target-version = "py310" line-length = 88 [tool.ruff.lint] # Enable flake8-bugbear (`B`) rules. select = ["E", "F", "B", "UP045", "UP007"] # Never enforce `E501` (line length violations). ignore = ["E501"] # Avoid trying to fix flake8-bugbear (`B`) violations. unfixable = ["B"] [tool.coverage] [tool.coverage.run] source = ["aiosmtplib"] branch = true parallel = true patch = ["subprocess"] [tool.coverage.report] show_missing = true exclude_lines = [ "pass", "pragma: no cover", "raise NotImplementedError", ] [tool.coverage.paths] source = [ "src/aiosmtplib", "/opt/pypy/lib/pypy3.*/site-packages/aiosmtplib", "/usr/local/lib/python3.*/site-packages/aiosmtplib", "/root/project/.venv/lib/python3.*/site-packages/aiosmtplib", ] [tool.pyright] strict = ["src/aiosmtplib"] # exclude all tests except pyright_usage exclude = [ "tests/test_*.py", "tests/auth.py", "tests/compat.py", "tests/conftest.py", "tests/smtpd.py", ]