From c855d2a35009319567293eb37410b05407cfd8ea Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sat, 14 Jan 2023 22:07:21 -0500 Subject: [PATCH] Consolidate version numbers (#2201) * update version number * print version number at startup * move version number into ldm/invoke/_version.py * bump version to 2.2.6+a0 * handle whitespace better * resolve issues raised by mauwii during PR review --- installer/create_installer.sh | 9 ++++----- ldm/invoke/__init__.py | 5 +++-- ldm/invoke/_version.py | 1 + setup.py | 8 +++++++- 4 files changed, 15 insertions(+), 8 deletions(-) mode change 100755 => 100644 installer/create_installer.sh create mode 100644 ldm/invoke/_version.py diff --git a/installer/create_installer.sh b/installer/create_installer.sh old mode 100755 new mode 100644 index 0302e4192c..5309a5d1c0 --- a/installer/create_installer.sh +++ b/installer/create_installer.sh @@ -2,24 +2,23 @@ cd "$(dirname "$0")" -VERSION=$(grep ^VERSION ../setup.py | awk '{ print $3 }' | sed "s/'//g" ) +VERSION=$(cd ..; python -c "from ldm.invoke import __version__ as version; print(version)") PATCH="" VERSION="v${VERSION}${PATCH}" +echo Building installer for version $VERSION echo "Be certain that you're in the 'installer' directory before continuing." read -p "Press any key to continue, or CTRL-C to exit..." read -e -p "Commit and tag this repo with ${VERSION} and 'latest'? [n]: " input RESPONSE=${input:='n'} if [ "$RESPONSE" == 'y' ]; then - git commit -a if ! git tag $VERSION ; then - echo "Existing/invalid tag" - exit -1 + echo "Existing/invalid tag" + exit -1 fi - git push origin :refs/tags/latest git tag -fa latest fi diff --git a/ldm/invoke/__init__.py b/ldm/invoke/__init__.py index 412e035dbc..9452f54c0a 100644 --- a/ldm/invoke/__init__.py +++ b/ldm/invoke/__init__.py @@ -1,3 +1,4 @@ +from ._version import __version__ + __app_id__= 'invoke-ai/InvokeAI' -__app_name__= 'InvokeAI' -__version__='2.2.5' +__app_name__= 'InvokeAI' \ No newline at end of file diff --git a/ldm/invoke/_version.py b/ldm/invoke/_version.py new file mode 100644 index 0000000000..312ecd88c5 --- /dev/null +++ b/ldm/invoke/_version.py @@ -0,0 +1 @@ +__version__='2.2.6+a0' diff --git a/setup.py b/setup.py index 3324a0184f..c4772aaf0a 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import sys import os import re from setuptools import setup, find_packages @@ -9,7 +10,12 @@ def list_files(directory): listing.append(pair) return listing -VERSION = '2.2.5' +def get_version()->str: + from ldm.invoke import __version__ as version + return version + +# The canonical version number is stored in the file ldm/invoke/_version.py +VERSION = get_version() DESCRIPTION = ('An implementation of Stable Diffusion which provides various new features' ' and options to aid the image generation process') LONG_DESCRIPTION = ('This version of Stable Diffusion features a slick WebGUI, an'