File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,7 @@ source = "init"
8
8
9
9
[tool .poetry ]
10
10
name = " sherlock-project"
11
- # single source of truth for version is __init__.py
12
- version = " 0"
11
+ version = " 0.16.0"
13
12
description = " Hunt down social media accounts by username across social networks"
14
13
license = " MIT"
15
14
authors = [
@@ -50,6 +49,7 @@ stem = "^1.8.0"
50
49
torrequest = " ^0.1.0"
51
50
pandas = " ^2.2.1"
52
51
openpyxl = " ^3.0.10"
52
+ tomli = " ^2.2.1"
53
53
54
54
[tool .poetry .extras ]
55
55
tor = [" torrequest" ]
Original file line number Diff line number Diff line change 5
5
6
6
"""
7
7
8
+ from importlib .metadata import version as pkg_version , PackageNotFoundError
9
+ import pathlib
10
+ import tomli
11
+
12
+
13
+ def get_version () -> str :
14
+ """Fetch the version number of the installed package."""
15
+ try :
16
+ return pkg_version ("sherlock_project" )
17
+ except PackageNotFoundError :
18
+ pyproject_path : pathlib .Path = pathlib .Path (__file__ ).resolve ().parent .parent / "pyproject.toml"
19
+ with pyproject_path .open ("rb" ) as f :
20
+ pyproject_data = tomli .load (f )
21
+ return pyproject_data ["tool" ]["poetry" ]["version" ]
22
+
8
23
# This variable is only used to check for ImportErrors induced by users running as script rather than as module or package
9
24
import_error_test_var = None
10
25
11
26
__shortname__ = "Sherlock"
12
27
__longname__ = "Sherlock: Find Usernames Across Social Networks"
13
- __version__ = "0.16.0"
28
+ __version__ = get_version ()
14
29
15
30
forge_api_latest_release = "https://api.github.com/repos/sherlock-project/sherlock/releases/latest"
You can’t perform that action at this time.
0 commit comments