From 1685ac1953121b20fae65214abcfaec733a53e0a Mon Sep 17 00:00:00 2001 From: Jascha Ezra Urbach Date: Thu, 19 Oct 2023 11:29:59 +0200 Subject: [PATCH] Move version out of settings (#3045) This removes the content of VERSION from settings.py and moves it into a seperate file which makes it easier to update versionnumbers via script in the future. --- VERSION | 1 + bookwyrm/settings.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..05e8a4593 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.6.6 diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 94ec761db..16241f9df 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -4,6 +4,7 @@ from typing import AnyStr from environs import Env + import requests from django.utils.translation import gettext_lazy as _ from django.core.exceptions import ImproperlyConfigured @@ -14,7 +15,13 @@ from django.core.exceptions import ImproperlyConfigured env = Env() env.read_env() DOMAIN = env("DOMAIN") -VERSION = "0.6.6" + +with open("VERSION", encoding="utf-8") as f: + version = f.read() + version = version.replace("\n", "") +f.close() + +VERSION = version RELEASE_API = env( "RELEASE_API",