Skip to content

Commit

Permalink
Remove duplicate version info
Browse files Browse the repository at this point in the history
  • Loading branch information
waketzheng committed May 9, 2024
1 parent f36f8b7 commit 7b8caad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import subprocess

from tortoise import __version__


def test_version():
r = subprocess.run(["poetry", "version", "-s"], capture_output=True)
r.stdout.decode() == __version__
4 changes: 3 additions & 1 deletion tortoise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import asyncio
import importlib
import importlib.metadata as importlib_metadata
import json
import os
import warnings
from copy import deepcopy
from inspect import isclass
from pathlib import Path
from types import ModuleType
from typing import Coroutine, Dict, Iterable, List, Optional, Tuple, Type, Union, cast

Expand Down Expand Up @@ -690,7 +692,7 @@ async def do_stuff():
loop.run_until_complete(connections.close_all(discard=True))


__version__ = "0.20.1"
__version__ = importlib_metadata.version(Path(__file__).parent.parent.name)

__all__ = [
"Model",
Expand Down

0 comments on commit 7b8caad

Please sign in to comment.