Skip to content

Commit

Permalink
Move towards standardized project layout/setup (#211)
Browse files Browse the repository at this point in the history
move towards standardized project layout/setup

* Remove setup.py, replace with pyproject.toml
* Use flit for building package/wheels
* Move project logic to `src/`
* Move tests to `tests/`
  • Loading branch information
wlach authored May 20, 2024
1 parent c68dce1 commit 517b68f
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 49 deletions.
43 changes: 42 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
[project]
name = "Flask-Mail"
version = "0.9.1"
description = "Flask extension for sending email"
readme = "README.md"
authors = [{ name = "Dan Jacob" }]
maintainers = [{ name = "Pallets Ecosystem", email = "contact@palletsprojects.com" }]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"flask",
"blinker",
]
license = { file = "LICENSE" }
requires-python = ">=3.8"

[project.urls]
Documentation = "https://flask-mail.readthedocs.io"
Changes = "https://flask-mail.readthedocs.io/en/latest/changes/"
Source = "https://github.com/pallets-eco/flask-mail/"
Chat = "https://discord.gg/pallets"

[build-system]
requires = ["flit_core<4"]
build-backend = "flit_core.buildapi"

[tool.flit.module]
name = "flask_mail"

[tool.pytest.ini_options]
testpaths = ["tests"]
filterwarnings = ["error"]

[tool.ruff]
src = ["flask_mail.py"]
src = ["src"]
fix = true
show-fixes = true
output-format = "full"
Expand Down
45 changes: 0 additions & 45 deletions setup.py

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion tests.py → tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
from unittest import mock

from flask import Flask
from speaklater import make_lazy_string

from flask_mail import BadHeaderError
from flask_mail import Mail
from flask_mail import Message
from flask_mail import sanitize_address
from speaklater import make_lazy_string


class TestCase(unittest.TestCase):
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ wheel_build_env = .pkg
constrain_package_deps = true
use_frozen_constraints = true
deps = -r requirements/tests.txt

commands = pytest -v --tb=short --basetemp={envtmpdir} tests.py
commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}

[testenv:minimal]
deps =
Expand Down

0 comments on commit 517b68f

Please sign in to comment.