Skip to content

Commit

Permalink
fix: fix load pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinocroustibat committed May 24, 2024
1 parent b73fc11 commit 8fec2e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

COMMAND_PREFIX = "!"
APP_VERSION = "unknown"
with open(_ROOT_PATH / "pyproject.toml", "rb") as f:
pyproject: dict = tomllib.load(f)
APP_VERSION = pyproject["project"]["version"]
try:
with open(_ROOT_PATH / "pyproject.toml", "rb") as f:
pyproject: dict = tomllib.load(f)
APP_VERSION = pyproject["project"]["version"]
except FileNotFoundError:
pass


class BaseConfig(BaseSettings):
Expand Down

0 comments on commit 8fec2e9

Please sign in to comment.