-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3851fb9
commit 317ecee
Showing
8 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.3 | ||
1.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import json | ||
|
||
import pkg_resources | ||
import requests | ||
|
||
|
||
def check_latest_version(): | ||
"""Check the latest version of arxiv-dl on PyPI.""" | ||
pypi_url = "https://pypi.org/pypi/arxiv-dl/json" | ||
response = requests.get(pypi_url) | ||
if response.status_code == 200: | ||
pypi_data = response.text | ||
pypi_data = json.loads(pypi_data) | ||
latest_version = pypi_data.get("info", {}).get("version", "") | ||
else: | ||
latest_version = "" | ||
return latest_version | ||
|
||
|
||
def check_current_version(): | ||
"""Check the current version of arxiv-dl.""" | ||
current_version = pkg_resources.get_distribution("arxiv-dl").version | ||
return current_version | ||
|
||
|
||
def check_update(): | ||
"""Remind user to update arxiv-dl if there is a new version.""" | ||
latest_version = check_latest_version() | ||
current_version = check_current_version() | ||
print(f"[arxiv-dl] (version: {current_version})") | ||
|
||
if latest_version and latest_version != current_version: | ||
print( | ||
f"[arxiv-dl] latest version available: {latest_version}. You may update by running: pip install --upgrade arxiv-dl" | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_update() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
MAJOR = 1 | ||
MINOR = 1 | ||
MICRO = 3 | ||
MICRO = 4 | ||
VERSION = "%d.%d.%d" % (MAJOR, MINOR, MICRO) | ||
|
||
|
||
|