Skip to content

Commit

Permalink
Merge pull request #79 from python-discord/jb3/dynamic-init-version
Browse files Browse the repository at this point in the history
Get version dynamically from pyproject.toml file
  • Loading branch information
jb3 authored Sep 4, 2023
2 parents 20cc956 + 69176c4 commit c4daffe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion metricity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
import asyncio
import logging
import os
from pathlib import Path
from typing import TYPE_CHECKING

import coloredlogs
import toml
from pydis_core.utils import apply_monkey_patches

from metricity.config import PythonConfig

if TYPE_CHECKING:
from metricity.bot import Bot

__version__ = "2.0.1"
# Read the version from the pyproject.toml file.
with Path.open("pyproject.toml") as f:
package_vers = toml.load(f)["tool"]["poetry"]["version"]

__version__ = package_vers

# Set root log level
logging.basicConfig(level=PythonConfig.log_level)
Expand Down

0 comments on commit c4daffe

Please sign in to comment.