Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 912beca

Browse files
author
Kareem Zidane
committedMar 5, 2017
requires requests and reads version programmatically
1 parent ba3e44c commit 912beca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"Topic :: Utilities"
1515
],
1616
description="This is submit50, with which you can submit solutions to problems for CS50.",
17-
install_requires=["getch", "pexpect", "termcolor"],
17+
install_requires=["getch", "pexpect", "requests", "termcolor"],
1818
keywords=["submit", "submit50"],
1919
name="submit50",
2020
scripts=["submit50"],
2121
url="https://github.com/cs50/submit50",
22-
version="2.1.4"
22+
version="2.1.5"
2323
)

‎submit50

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ import time
2323
import traceback
2424
import urllib.request
2525

26-
from distutils.version import StrictVersion
26+
from pkg_resources import get_distribution, parse_version
2727
from threading import Thread
2828

2929
ORG_NAME = "submit50"
30-
VERSION = "2.1.4"
30+
__version__ = get_distribution("submit50").version
3131
timestamp = ""
3232

3333
class Error(Exception):
@@ -48,7 +48,7 @@ def main():
4848
if res.status_code != 200:
4949
raise Error("You have an unknown version of submit50. Email sysadmins@cs50.harvard.edu.") from None
5050
version_required = res.text.strip()
51-
if StrictVersion(version_required) > StrictVersion(VERSION):
51+
if parse_version(version_required) > parse_version(__version__):
5252
raise Error("You have an old version of submit50. Run update50, then re-run submit50!") from None
5353

5454
# compute timestamp

0 commit comments

Comments
 (0)
Please sign in to comment.