Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increment minor version (0.15.0) #2191

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sherlock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@

__shortname__ = "Sherlock"
__longname__ = "Sherlock: Find Usernames Across Social Networks"
__version__ = "0.14.4"
__version__ = "0.15.0"

forgeApiLatestReleaseUrl = "https://api.github.com/repos/sherlock-project/sherlock/releases/latest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we use snake_case across the project, we should use snake_case here as well

48 changes: 21 additions & 27 deletions sherlock/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,27 @@
import re
import sys
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from json import loads as json_loads
from time import monotonic

import requests
from requests_futures.sessions import FuturesSession
from torrequest import TorRequest

# Removing __version__ here will trigger update message for users
# Do not remove until ready to trigger that message
# When removed, also remove all the noqa: E402 comments for linting
__version__ = "0.14.4"
del __version__

from .__init__ import ( # noqa: E402
from sherlock.__init__ import (
__longname__,
__version__
__shortname__,
__version__,
forgeApiLatestReleaseUrl,
)

from requests_futures.sessions import FuturesSession # noqa: E402
from torrequest import TorRequest # noqa: E402
from sherlock.result import QueryStatus # noqa: E402
from sherlock.result import QueryResult # noqa: E402
from sherlock.notify import QueryNotify # noqa: E402
from sherlock.notify import QueryNotifyPrint # noqa: E402
from sherlock.sites import SitesInformation # noqa: E402
from colorama import init # noqa: E402
from argparse import ArgumentTypeError # noqa: E402
from sherlock.result import QueryStatus
from sherlock.result import QueryResult
from sherlock.notify import QueryNotify
from sherlock.notify import QueryNotifyPrint
from sherlock.sites import SitesInformation
from colorama import init
from argparse import ArgumentTypeError


class SherlockFuturesSession(FuturesSession):
Expand Down Expand Up @@ -523,7 +520,7 @@ def main():
parser.add_argument(
"--version",
action="version",
version=f"Sherlock v{__version__}",
version=f"{__shortname__} v{__version__}",
help="Display version information and dependencies.",
)
parser.add_argument(
Expand Down Expand Up @@ -671,17 +668,14 @@ def main():

# Check for newer version of Sherlock. If it exists, let the user know about it
try:
r = requests.get(
"https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/__init__.py"
)

remote_version = str(re.findall('__version__ *= *"(.*)"', r.text)[0])
local_version = __version__
latestReleaseJsonRaw = requests.get(forgeApiLatestReleaseUrl).text
latestReleaseJsonData = json_loads(latestReleaseJsonRaw)
latestRemoteTag = latestReleaseJsonData["tag_name"]
Comment on lines +671 to +673
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment about snake_case


if remote_version != local_version:
if latestRemoteTag[1:] != __version__:
print(
"Update Available!\n"
+ f"You are running version {local_version}. Version {remote_version} is available at https://github.com/sherlock-project/sherlock"
f"Update available! {__version__} --> {latestRemoteTag[1:]}"
f"\n{latestReleaseJsonData['html_url']}"
)

except Exception as error:
Expand Down
1 change: 0 additions & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def test_versioning() -> None:
expected:list = [
# Normalization is REQUIRED for Windows ( / vs \ )
os.path.normpath("sherlock/__init__.py"),
os.path.normpath("sherlock/sherlock.py"),
]
# Sorting is REQUIRED for Mac
assert sorted(found) == sorted(expected)
Loading