From 7abf82980d7c9007f93c789bfad6c39dbdb8d269 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 30 Nov 2021 13:55:39 +0100 Subject: [PATCH] Fix wkcuber --version (#494) * fix wkcuber --version * include version.py * fix placing version.py Co-authored-by: Norman Rzepka --- publish.sh | 4 ++-- webknossos/pyproject.toml | 1 + wkcuber/pyproject.toml | 3 ++- wkcuber/wkcuber/__main__.py | 2 +- wkcuber/{ => wkcuber}/versioning.py | 0 5 files changed, 6 insertions(+), 4 deletions(-) rename wkcuber/{ => wkcuber}/versioning.py (100%) diff --git a/publish.sh b/publish.sh index 4af9408ee..81fa39c5f 100755 --- a/publish.sh +++ b/publish.sh @@ -15,13 +15,13 @@ for PKG in */pyproject.toml; do cp pyproject.toml pyproject.toml.bak PKG_VERSION="$(dunamai from git)" + echo "__version__ = '$PKG_VERSION'" > ./"$PKG"/version.py + poetry version "$PKG_VERSION" # replace all relative path dependencies with the current version: sed -i 's/\(.*\) = .* path \= \"\.\..*/\1 = "'"$PKG_VERSION"'"/g' pyproject.toml poetry publish --build -u "$PYPI_USERNAME" -p "$PYPI_PASSWORD" - echo "__version__ = '$PKG_VERSION'" > ./"$PKG"/version.py - # Restore files mv pyproject.toml.bak pyproject.toml diff --git a/webknossos/pyproject.toml b/webknossos/pyproject.toml index 688e5ddd8..c6f34f5db 100644 --- a/webknossos/pyproject.toml +++ b/webknossos/pyproject.toml @@ -7,6 +7,7 @@ readme = "README.md" license = "AGPL-3.0" repository = "https://github.com/scalableminds/webknossos-libs" homepage = "https://docs.webknossos.org" +include = ["webknossos/version.py"] [tool.poetry.dependencies] python = "^3.7,>=3.7.1" diff --git a/wkcuber/pyproject.toml b/wkcuber/pyproject.toml index 19a539655..30f3993a0 100644 --- a/wkcuber/pyproject.toml +++ b/wkcuber/pyproject.toml @@ -1,10 +1,11 @@ [tool.poetry] name = "wkcuber" -version = "0.0.0" # filled by setuptools-scm +version = "0.0.0" # filled by dunamai description = "Python package to create, cube, and work with webKnossos WKW datasets" authors = ["scalable minds "] readme = "README.md" license = "AGPL-3.0" +include = ["wkcuber/version.py"] [tool.poetry.dependencies] python = "^3.7" diff --git a/wkcuber/wkcuber/__main__.py b/wkcuber/wkcuber/__main__.py index 3a1f35c8e..262502000 100644 --- a/wkcuber/wkcuber/__main__.py +++ b/wkcuber/wkcuber/__main__.py @@ -1,6 +1,5 @@ from typing import List, Dict -from versioning import get_available_version from wkcuber import downsample_mags from .compress import compress_mag_inplace from .metadata import refresh_metadata @@ -15,6 +14,7 @@ create_parser as create_conversion_parser, main as auto_detect_and_run_conversion, ) +from .versioning import get_available_version from argparse import Namespace, ArgumentParser from pathlib import Path diff --git a/wkcuber/versioning.py b/wkcuber/wkcuber/versioning.py similarity index 100% rename from wkcuber/versioning.py rename to wkcuber/wkcuber/versioning.py