Skip to content

Commit

Permalink
Add check for newer version
Browse files Browse the repository at this point in the history
  • Loading branch information
AyahRamahi authored Sep 12, 2021
1 parent c88d405 commit 81a644c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compare50/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import traceback
import time
import tempfile
import requests
import pkg_resources

import attr
import lib50
Expand Down Expand Up @@ -357,6 +359,12 @@ def main():

args = parser.parse_args()

# Check for newer version
if __version__:
latest = max(requests.get("https://pypi.org/pypi/compare50/json").json()["releases"], key=pkg_resources.parse_version)
if latest > __version__:
print("A newer version is available. Run `pip3 install --upgrade compare50` to upgrade.")

excepthook.verbose = args.verbose

# Set max file size in bytes
Expand Down

0 comments on commit 81a644c

Please sign in to comment.