From 1f6c3ff94e974bc7cd33d1d85a217b3d918829fe Mon Sep 17 00:00:00 2001 From: Dee Anzorge Date: Wed, 25 Oct 2023 00:02:06 +0200 Subject: [PATCH] Use pyproject.toml version for settings.VERSION --- bookwyrm/settings.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 29e9bda62..70f99b8d3 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -1,5 +1,6 @@ """ bookwyrm settings and configuration """ import os +import importlib.metadata from typing import AnyStr from environs import Env @@ -16,12 +17,7 @@ env = Env() env.read_env() DOMAIN = env("DOMAIN") -with open("VERSION", encoding="utf-8") as f: - version = f.read() - version = version.replace("\n", "") -f.close() - -VERSION = version +VERSION = importlib.metadata.version(__package__) RELEASE_API = env( "RELEASE_API",