-
Notifications
You must be signed in to change notification settings - Fork 17
/
__init__.py
38 lines (28 loc) · 1.27 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# pylint: disable=unused-argument
# ------------------------------------------------------------------------------
#
from .pipeline import Pipeline
from .stage import Stage
from .task import Task
from . import states
from .appman.appmanager import AppManager
# ------------------------------------------------------------------------------
#
import warnings
import os as _os
import radical.utils as _ru
import requests as req
from packaging.version import parse as parse_version
def custom_formatwarning(msg, *args, **kwargs):
# ignore everything except the message
return str(msg) + '\n'
warnings.formatwarning = custom_formatwarning
version_short, version_detail, version_base, version_branch, \
sdist_name, sdist_path = _ru.get_version(_os.path.dirname(__file__))
version = version_short
r = req.get("https://pypi.org/pypi/radical.entk/json")
versions = r.json()["releases"].keys()
last_version = list(versions)[-1]
if parse_version(version) < parse_version(last_version):
warnings.warn("WARNING: You are using radical.entk version %s, however version %s is available." % (version, last_version), UserWarning)
# ------------------------------------------------------------------------------