-
-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove duplicate version info (#1608)
* Remove duplicate version info * freeze package name to tortoise-orm * fix missing assert * fix Codacy Static Code Analysis issues * fix lint error
- Loading branch information
1 parent
d7c59dc
commit 9053fa7
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import sys | ||
from pathlib import Path | ||
|
||
from tortoise import __version__ | ||
|
||
if sys.version_info >= (3, 11): | ||
import tomllib | ||
else: | ||
import tomlkit as tomllib | ||
|
||
|
||
def _read_version(): | ||
text = Path("pyproject.toml").read_text() | ||
data = tomllib.loads(text) | ||
return data["tool"]["poetry"]["version"] | ||
|
||
|
||
def test_version(): | ||
assert _read_version() == __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters