mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-21 20:31:06 -05:00
Modernize packaging
Switch to pyproject.toml packaging, using hatchling. - Replace all uses of setup.py with updated equivalent - BREAKING: Change extra name `amazon_ses` to `amazon-ses`, to comply with Python packaging name normalization - Use hatch custom build hook to freeze version number in readme (previously custom setup.py code) - Move separate requirements for dev, docs, tests into their own requirements.txt files - Fix AnymailImproperlyInstalled to correctly refer to package extra name - Update testing documentation - Update docs readme rendering to match PyPI (and avoid setup.py) - In tox tests, use isolated builds and update pip - Remove AUTHORS.txt (it just referred to GitHub)
This commit is contained in:
100
pyproject.toml
100
pyproject.toml
@@ -1,3 +1,103 @@
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "django-anymail"
|
||||
dynamic = ["readme", "version"]
|
||||
license = {file = "LICENSE"}
|
||||
|
||||
authors = [
|
||||
{name = "Mike Edmunds", email = "medmunds@gmail.com"},
|
||||
{name = "Anymail Contributors"},
|
||||
]
|
||||
description = """\
|
||||
Django email backends and webhooks for Amazon SES, MailerSend, Mailgun, \
|
||||
Mailjet, Mandrill, Postal, Postmark, SendGrid, SendinBlue, and SparkPost\
|
||||
"""
|
||||
# readme: see tool.hatch.metadata.hooks.custom below
|
||||
keywords = [
|
||||
"Django", "email", "email backend",
|
||||
"ESP", "transactional mail",
|
||||
"Amazon SES",
|
||||
"MailerSend", "Mailgun", "Mailjet", "Mandrill",
|
||||
"Postal", "Postmark",
|
||||
"SendGrid", "SendinBlue", "SparkPost",
|
||||
]
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
"Topic :: Communications :: Email",
|
||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||
"Intended Audience :: Developers",
|
||||
"Framework :: Django",
|
||||
"Framework :: Django :: 3.0",
|
||||
"Framework :: Django :: 3.1",
|
||||
"Framework :: Django :: 3.2",
|
||||
"Framework :: Django :: 4.0",
|
||||
"Framework :: Django :: 4.1",
|
||||
# not yet registered: "Framework :: Django :: 4.2",
|
||||
"Environment :: Web Environment",
|
||||
]
|
||||
|
||||
requires-python = ">=3.7"
|
||||
dependencies = [
|
||||
"django>=2.0",
|
||||
"requests>=2.4.3",
|
||||
"urllib3>=1.25.0", # requests dependency: fixes RFC 7578 header encoding
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
# ESP-specific additional dependencies.
|
||||
# (For simplicity, requests is included in the base dependencies.)
|
||||
# (Do not use underscores in extra names: they get normalized to hyphens.)
|
||||
amazon-ses = ["boto3"]
|
||||
mailersend = []
|
||||
mailgun = []
|
||||
mailjet = []
|
||||
mandrill = []
|
||||
postmark = []
|
||||
sendgrid = []
|
||||
sendinblue = []
|
||||
sparkpost = []
|
||||
postal = [
|
||||
# Postal requires cryptography for verifying webhooks.
|
||||
# Cryptography's wheels are broken on darwin-arm64 before Python 3.9.
|
||||
"cryptography; sys_platform != 'darwin' or platform_machine != 'arm64' or python_version >= '3.9'"
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/anymail/django-anymail"
|
||||
Documentation = "https://anymail.dev/en/stable/"
|
||||
Source = "https://github.com/anymail/django-anymail"
|
||||
Changelog = "https://anymail.dev/en/stable/changelog/"
|
||||
Tracker = "https://github.com/anymail/django-anymail/issues"
|
||||
|
||||
[tool.hatch.build]
|
||||
packages = ["anymail"]
|
||||
# Hatch automatically includes pyproject.toml, LICENSE, and hatch_build.py.
|
||||
# Help it find the dynamic readme source (otherwise wheel will only build with
|
||||
# `hatch build`, not with `python -m build`):
|
||||
force-include = {"README.rst" = "README.rst"}
|
||||
|
||||
[tool.hatch.metadata.hooks.custom]
|
||||
# Provides dynamic readme
|
||||
path = "hatch_build.py"
|
||||
readme = "README.rst"
|
||||
|
||||
[tool.hatch.version]
|
||||
path = "anymail/_version.py"
|
||||
|
||||
|
||||
[tool.black]
|
||||
force-exclude = '^/tests/test_settings/settings_.*\.py'
|
||||
max-line-length = 88
|
||||
|
||||
Reference in New Issue
Block a user