chore: move SSOT to pyproject.toml
Co-authored-by: ByteXenon <125568681+ByteXenon@users.noreply.github.com>
This commit is contained in:
parent
7ff3924f0b
commit
b44ac231c1
|
|
@ -8,8 +8,7 @@ source = "init"
|
||||||
|
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "sherlock-project"
|
name = "sherlock-project"
|
||||||
# single source of truth for version is __init__.py
|
version = "0.16.0"
|
||||||
version = "0"
|
|
||||||
description = "Hunt down social media accounts by username across social networks"
|
description = "Hunt down social media accounts by username across social networks"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = [
|
authors = [
|
||||||
|
|
@ -50,6 +49,7 @@ stem = "^1.8.0"
|
||||||
torrequest = "^0.1.0"
|
torrequest = "^0.1.0"
|
||||||
pandas = "^2.2.1"
|
pandas = "^2.2.1"
|
||||||
openpyxl = "^3.0.10"
|
openpyxl = "^3.0.10"
|
||||||
|
tomli = "^2.2.1"
|
||||||
|
|
||||||
[tool.poetry.extras]
|
[tool.poetry.extras]
|
||||||
tor = ["torrequest"]
|
tor = ["torrequest"]
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,26 @@ networks.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from importlib.metadata import version as pkg_version, PackageNotFoundError
|
||||||
|
import pathlib
|
||||||
|
import tomli
|
||||||
|
|
||||||
|
|
||||||
|
def get_version() -> str:
|
||||||
|
"""Fetch the version number of the installed package."""
|
||||||
|
try:
|
||||||
|
return pkg_version("sherlock_project")
|
||||||
|
except PackageNotFoundError:
|
||||||
|
pyproject_path: pathlib.Path = pathlib.Path(__file__).resolve().parent.parent / "pyproject.toml"
|
||||||
|
with pyproject_path.open("rb") as f:
|
||||||
|
pyproject_data = tomli.load(f)
|
||||||
|
return pyproject_data["tool"]["poetry"]["version"]
|
||||||
|
|
||||||
# This variable is only used to check for ImportErrors induced by users running as script rather than as module or package
|
# This variable is only used to check for ImportErrors induced by users running as script rather than as module or package
|
||||||
import_error_test_var = None
|
import_error_test_var = None
|
||||||
|
|
||||||
__shortname__ = "Sherlock"
|
__shortname__ = "Sherlock"
|
||||||
__longname__ = "Sherlock: Find Usernames Across Social Networks"
|
__longname__ = "Sherlock: Find Usernames Across Social Networks"
|
||||||
__version__ = "0.16.0"
|
__version__ = get_version()
|
||||||
|
|
||||||
forge_api_latest_release = "https://api.github.com/repos/sherlock-project/sherlock/releases/latest"
|
forge_api_latest_release = "https://api.github.com/repos/sherlock-project/sherlock/releases/latest"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue