diff --git a/chatmaild/pyproject.toml b/chatmaild/pyproject.toml index 45d9c5e0..190f1919 100644 --- a/chatmaild/pyproject.toml +++ b/chatmaild/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=45"] +requires = ["setuptools>=61", "setuptools_scm>=6.2"] build-backend = "setuptools.build_meta" [project] @@ -10,6 +10,12 @@ dependencies = [ "iniconfig", ] +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +where = ['src'] + [project.scripts] doveauth = "chatmaild.doveauth:main" filtermail = "chatmaild.filtermail:main" @@ -37,7 +43,6 @@ commands = ruff src/ [testenv] -passenv = CHATMAIL_DOMAIN deps = pytest pdbpp commands = pytest -v -rsXx {posargs: ../tests/chatmaild} diff --git a/deploy-chatmail/src/deploy_chatmail/cmdeploy.py b/deploy-chatmail/src/deploy_chatmail/cmdeploy.py index 1a40900f..ab04f48b 100644 --- a/deploy-chatmail/src/deploy_chatmail/cmdeploy.py +++ b/deploy-chatmail/src/deploy_chatmail/cmdeploy.py @@ -2,14 +2,12 @@ Provides the `cmdeploy` entry point function, along with command line option and subcommand parsing. """ -import importlib.resources import argparse import shutil import subprocess import os from pathlib import Path -import iniconfig from termcolor import colored from chatmaild.config import read_config, write_initial_config @@ -86,7 +84,6 @@ def get_parser(): return parser - def init_cmd(args, out): """Initialize chatmail config file.""" if args.chatmail_ini.exists(): @@ -98,7 +95,6 @@ def init_cmd(args, out): def run_cmd(args, out): """Deploy chatmail services on the remote server.""" - import pyinfra try: config = read_config(args.chatmail_ini) @@ -132,8 +128,10 @@ def test_cmd(args, out): subprocess.check_call([tox, "-c", "chatmaild"]) subprocess.check_call([tox, "-c", "deploy-chatmail"]) - pytest_path = shutil.which("tox") - subprocess.check_call([pytest_path, "tests/online", "-rs", "-x", "-vrx", "--durations=5"]) + pytest_path = shutil.which("pytest") + subprocess.check_call( + [pytest_path, "tests/online", "-rs", "-x", "-vrx", "--durations=5"] + ) def main(args=None): diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100755 index 6889c407..00000000 --- a/scripts/test.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -venv/bin/tox -c chatmaild -venv/bin/tox -c deploy-chatmail -venv/bin/pytest tests/online -rs -vrx --durations=5 $@