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/*