From ff3e629c2a9987337a0fbb30fbe3207eb9895d86 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Fri, 17 Nov 2023 14:47:11 +0000 Subject: [PATCH] build tooling --- pyproject.toml | 7 +++++++ tox.ini | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0815ed2..eb2ccc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,9 @@ dev = [ # for linting "black == 23.10.0", "ruff == 0.1.1", + # for publishing + "build", + "twine" ] [build-system] @@ -43,6 +46,10 @@ build-backend = "setuptools.build_meta" [tool.setuptools_scm] + +[tool.setuptools.dynamic] +version = {attr = "synapse_super_invites.__version__"} + [tool.mypy] strict = true diff --git a/tox.ini b/tox.ini index 1258efe..f088967 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = serve, py, check_codestyle, fix_codestyle, check_types +envlist = serve, py, check_codestyle, fix_codestyle, check_types, publish # required for PEP 517 (pyproject.toml-style) builds isolated_build = true @@ -40,4 +40,15 @@ extras = dev commands = black synapse_super_invites tests - ruff --fix synapse_super_invites tests \ No newline at end of file + ruff --fix synapse_super_invites tests + + +[testenv:publish] + +extras = dev + +commands = + python -m build --sdist + python -m build --wheel + twine check dist/* + twine upload dist/*