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

Add check for newer version #97

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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