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:
Mike Edmunds
2023-05-03 16:55:08 -07:00
committed by GitHub
parent 9fba58237d
commit e8df0ec8e0
31 changed files with 418 additions and 292 deletions

View File

@@ -171,11 +171,13 @@ class AnymailConfigurationError(ImproperlyConfigured):
class AnymailImproperlyInstalled(AnymailConfigurationError, ImportError):
"""Exception for Anymail missing package dependencies"""
def __init__(self, missing_package, backend="<backend>"):
def __init__(self, missing_package, install_extra="<esp>"):
# install_extra must be the package "optional extras name" for the ESP
# (not the backend's esp_name)
message = (
"The %s package is required to use this ESP, but isn't installed.\n"
"(Be sure to use `pip install django-anymail[%s]` "
"with your desired ESPs.)" % (missing_package, backend)
'(Be sure to use `pip install "django-anymail[%s]"` '
"with your desired ESP name(s).)" % (missing_package, install_extra)
)
super().__init__(message)