From bf972ae6cb97b8518dcc459f197928ebe1bb90bd Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 23 May 2024 10:34:43 +0200 Subject: Make tox tests run --- pytest.ini | 3 +++ setup.py | 7 +++++-- tox.ini | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 pytest.ini create mode 100644 tox.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..52a039b --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +testpaths = gerbolyze/tests +norecursedirs=* diff --git a/setup.py b/setup.py index d1998a4..e548f2e 100755 --- a/setup.py +++ b/setup.py @@ -10,8 +10,11 @@ from pathlib import Path import re def get_tag(): - res = subprocess.run(['git', 'describe', '--tags', '--match', 'v*'], capture_output=True, check=True, text=True) - return res.stdout.strip() + try: + res = subprocess.run(['git', '--git-dir', str(Path(__file__).with_name('.git')), 'describe', '--tags', '--match', 'v*'], capture_output=True, check=True, text=True) + return res.stdout.strip() + except subprocess.CalledProcessError as e: + return 'v0.0.0-dev' def get_version(): version, _, _rest = get_tag()[1:].partition('-') diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..622e2d5 --- /dev/null +++ b/tox.ini @@ -0,0 +1,6 @@ +[tox] +envlist = py38, py312 + +[testenv] +deps = pytest +commands = pytest -- cgit