From b485001fcb7b99c6eb76334693c4a32d54d78f89 Mon Sep 17 00:00:00 2001 From: Paul Pfeister Date: Fri, 17 May 2024 20:57:37 -0400 Subject: [PATCH] Switch versioning plugin --- pyproject.toml | 19 +++++-------------- sherlock/__init__.py | 4 ++++ sherlock/__main__.py | 4 ++-- sherlock/sherlock.py | 20 ++++++++++++++------ 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f3a8d74b..04844ace 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,23 +1,14 @@ [build-system] -requires = [ "poetry-core>=1.6.0", "poetry-dynamic-versioning>1.0.0,<2.0.0" ] -build-backend = "poetry_dynamic_versioning.backend" +requires = [ "poetry-core>=1.2.0" ] +build-backend = "poetry.core.masonry.api" # poetry-core 1.8 not available in .fc39. Can upgrade to 1.8.0 at .fc39 EOL -[tool.poetry-dynamic-versioning] -enable = false -metadata = false -strict = true -vcs = "git" -# Matched tags: -# v0.0.0 followed by optional -rc0 (release candidate) OR -b0 (public beta) -pattern = "^v(?P\\d+(?:\\.\\d+){2})(?:-(?P(?:rc|b)\\d+?))??$" - -[tool.poetry-dynamic-versioning.substitution] -folders = [ { path = "sherlock" } ] +[tool.poetry-version-plugin] +source = "init" [tool.poetry] name = "sherlock-project" -version = "0.14.4" +version = "0" # single source of truth is __version__.py description = "Hunt down social media accounts by username across social networks" license = "MIT" authors = [ diff --git a/sherlock/__init__.py b/sherlock/__init__.py index 219dcaec..5bf79e24 100644 --- a/sherlock/__init__.py +++ b/sherlock/__init__.py @@ -4,3 +4,7 @@ This module contains the main logic to search for usernames at social networks. """ + +__shortname__ = "Sherlock" +__longname__ = "Sherlock: Find Usernames Across Social Networks" +__version__ = "0.14.4" diff --git a/sherlock/__main__.py b/sherlock/__main__.py index 39068a06..014d8b35 100644 --- a/sherlock/__main__.py +++ b/sherlock/__main__.py @@ -14,8 +14,8 @@ if __name__ == "__main__": # Check if the user is using the correct version of Python python_version = sys.version.split()[0] - if sys.version_info < (3, 6): - print(f"Sherlock requires Python 3.6+\nYou are using Python {python_version}, which is not supported by Sherlock.") + if sys.version_info < (3, 8): + print(f"Sherlock requires Python 3.8+\nYou are using Python {python_version}, which is not supported by Sherlock.") sys.exit(1) from sherlock import sherlock diff --git a/sherlock/sherlock.py b/sherlock/sherlock.py index e3474d1d..9846cb5a 100644 --- a/sherlock/sherlock.py +++ b/sherlock/sherlock.py @@ -19,6 +19,17 @@ from time import monotonic import requests +# Removing __version__ here will trigger update message for users +# Do not remove until ready to trigger that message +__version__ = "0.14.4" +del __version__ + +from .__init__ import ( + __shortname__, + __longname__, + __version__ +) + from requests_futures.sessions import FuturesSession from torrequest import TorRequest from sherlock.result import QueryStatus @@ -28,9 +39,6 @@ from sherlock.sites import SitesInformation from colorama import init from argparse import ArgumentTypeError -module_name = "Sherlock: Find Usernames Across Social Networks" -__version__ = "0.14.4" - class SherlockFuturesSession(FuturesSession): def request(self, method, url, hooks=None, *args, **kwargs): @@ -510,14 +518,14 @@ def handler(signal_received, frame): def main(): version_string = ( - f"Sherlock {__version__}\n" + f"{__shortname__} {__version__}\n" + f"Requests {requests.__version__}\n" - + f"Python {platform.python_version()}" + + f"Python {platform.python_version()}" ) parser = ArgumentParser( formatter_class=RawDescriptionHelpFormatter, - description=f"{module_name} (Version {__version__})", + description=f"{__longname__} (Version {__version__})", ) parser.add_argument( "--version",