Use pyproject.toml version for settings.VERSION
This commit is contained in:
parent
d17c4ecc7e
commit
1f6c3ff94e
1 changed files with 2 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
||||||
""" bookwyrm settings and configuration """
|
""" bookwyrm settings and configuration """
|
||||||
import os
|
import os
|
||||||
|
import importlib.metadata
|
||||||
from typing import AnyStr
|
from typing import AnyStr
|
||||||
|
|
||||||
from environs import Env
|
from environs import Env
|
||||||
|
@ -16,12 +17,7 @@ env = Env()
|
||||||
env.read_env()
|
env.read_env()
|
||||||
DOMAIN = env("DOMAIN")
|
DOMAIN = env("DOMAIN")
|
||||||
|
|
||||||
with open("VERSION", encoding="utf-8") as f:
|
VERSION = importlib.metadata.version(__package__)
|
||||||
version = f.read()
|
|
||||||
version = version.replace("\n", "")
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
VERSION = version
|
|
||||||
|
|
||||||
RELEASE_API = env(
|
RELEASE_API = env(
|
||||||
"RELEASE_API",
|
"RELEASE_API",
|
||||||
|
|
Loading…
Add table
Reference in a new issue