crystalwindow 2.7.8__py3-none-any.whl → 2.9.8.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of crystalwindow might be problematic. Click here for more details.
- crystalwindow/ver_warner.py +18 -32
- {crystalwindow-2.7.8.dist-info → crystalwindow-2.9.8.1.dist-info}/METADATA +1 -1
- {crystalwindow-2.7.8.dist-info → crystalwindow-2.9.8.1.dist-info}/RECORD +6 -6
- {crystalwindow-2.7.8.dist-info → crystalwindow-2.9.8.1.dist-info}/WHEEL +0 -0
- {crystalwindow-2.7.8.dist-info → crystalwindow-2.9.8.1.dist-info}/licenses/LICENSE +0 -0
- {crystalwindow-2.7.8.dist-info → crystalwindow-2.9.8.1.dist-info}/top_level.txt +0 -0
crystalwindow/ver_warner.py
CHANGED
|
@@ -1,54 +1,40 @@
|
|
|
1
1
|
from importlib.metadata import version as get_version, PackageNotFoundError
|
|
2
|
+
from packaging import version as parse_version
|
|
2
3
|
import requests
|
|
3
4
|
import os
|
|
4
5
|
import json
|
|
5
6
|
|
|
6
7
|
def check_for_update(package_name="crystalwindow"):
|
|
7
8
|
"""
|
|
8
|
-
Checks PyPI for updates
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
Checks PyPI for updates.
|
|
10
|
+
Warns every run if outdated.
|
|
11
|
+
Skips warning if your version is newer than PyPI.
|
|
11
12
|
"""
|
|
12
13
|
try:
|
|
13
|
-
# get current version
|
|
14
14
|
try:
|
|
15
15
|
current_version = get_version(package_name)
|
|
16
16
|
except PackageNotFoundError:
|
|
17
17
|
print(f"(⚠️ Package '{package_name}' not found)")
|
|
18
18
|
return
|
|
19
19
|
|
|
20
|
-
# file to track last notified version
|
|
21
|
-
cache_file = os.path.join(os.path.expanduser("~"), f".{package_name}_version_cache.json")
|
|
22
|
-
|
|
23
|
-
# load cache
|
|
24
|
-
if os.path.exists(cache_file):
|
|
25
|
-
with open(cache_file, "r") as f:
|
|
26
|
-
cache = json.load(f)
|
|
27
|
-
else:
|
|
28
|
-
cache = {}
|
|
29
|
-
|
|
30
|
-
# skip check if we already confirmed this version
|
|
31
|
-
if cache.get("last_checked") == current_version:
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
# get newest version from PyPI
|
|
35
20
|
url = f"https://pypi.org/pypi/{package_name}/json"
|
|
36
21
|
response = requests.get(url, timeout=3)
|
|
22
|
+
if response.status_code != 200:
|
|
23
|
+
print("(⚠️ PyPI request failed, skipping version check)")
|
|
24
|
+
return
|
|
37
25
|
|
|
38
|
-
|
|
39
|
-
latest_version = response.json()["info"]["version"]
|
|
40
|
-
|
|
41
|
-
if latest_version == current_version:
|
|
42
|
-
print(f"✅ Up to date! ver = {current_version}.")
|
|
43
|
-
cache["last_checked"] = current_version
|
|
44
|
-
else:
|
|
45
|
-
print(f"\n⚠️ Hey Future Dev! You're using an old version of {package_name} ({current_version})")
|
|
46
|
-
print(f"👉 The latest is {latest_version}! To update, run:")
|
|
47
|
-
print(f" pip install --upgrade {package_name}")
|
|
48
|
-
print(f"Or visit: https://pypi.org/project/{package_name}/{latest_version}/\n")
|
|
26
|
+
latest_version = response.json()["info"]["version"]
|
|
49
27
|
|
|
50
|
-
|
|
51
|
-
|
|
28
|
+
# compare versions properly
|
|
29
|
+
if parse_version(current_version) < parse_version(latest_version):
|
|
30
|
+
print(f"\n⚠️ Yo dev! '{package_name}' is outdated ({current_version})")
|
|
31
|
+
print(f"👉 Newest is {latest_version}! Run:")
|
|
32
|
+
print(f" pip install --upgrade {package_name}")
|
|
33
|
+
print(f"Or peep: https://pypi.org/project/{package_name}/{latest_version}/\n")
|
|
34
|
+
elif parse_version(current_version) > parse_version(latest_version):
|
|
35
|
+
print(f"🚀 Local version ({current_version}) is newer than PyPI ({latest_version}) — flex on 'em 😎")
|
|
36
|
+
else:
|
|
37
|
+
print(f"✅ Up to date! ver = {current_version}.")
|
|
52
38
|
|
|
53
39
|
except Exception as e:
|
|
54
40
|
print(f"(⚠️ Version check failed: {e})")
|
|
@@ -15,7 +15,7 @@ crystalwindow/math.py,sha256=slOY3KQZ99VDMUMxsSJabMyRtJcwVzEyxR2RoXspHho,963
|
|
|
15
15
|
crystalwindow/player.py,sha256=4wpIdUZLTlRXV8fDRQ11yVJRbx_cv8Ekpn2y7pQGgAQ,3442
|
|
16
16
|
crystalwindow/sprites.py,sha256=9_3chojuLKVBtd2UJR8fsUSRexMx22rQKognsAxfw70,1171
|
|
17
17
|
crystalwindow/tilemap.py,sha256=PHoKL1eWuNeHIf0w-Jh5MGdQGEgklVsxqqJOS-GNMKI,322
|
|
18
|
-
crystalwindow/ver_warner.py,sha256=
|
|
18
|
+
crystalwindow/ver_warner.py,sha256=TQ_JXfFxmACNne7GKwQN70yi_Gl_xGmykwSY-N0KXf8,1656
|
|
19
19
|
crystalwindow/window.py,sha256=JmWjR0aOm4Q8OoboqDHzGKqUmxlAJbj37KBBY0QPjrs,17779
|
|
20
20
|
crystalwindow/Icons/default_icon.png,sha256=Loq27Pxb8Wb3Sz-XwtNF1RmlLNxR4TcfOWfK-1lWcII,7724
|
|
21
21
|
crystalwindow/gametests/__init__.py,sha256=-CQ2bIDMe4v2dzTuYcu9GshVGZC8d5yQVPW53Q8D4-E,434
|
|
@@ -24,8 +24,8 @@ crystalwindow/gametests/gravitytest.py,sha256=mMqOkjJTbpa_XgHHBSIcVt9zfE8yW6rd7K
|
|
|
24
24
|
crystalwindow/gametests/guitesting.py,sha256=SrOssY5peCQEV6TQ1AiOWtjb9phVGdRzW-QzIl_MX5Q,1920
|
|
25
25
|
crystalwindow/gametests/sandbox.py,sha256=Oo2tU2N0y3BPVa6T5vs_h9N6islhQrjSrr_78XLut5I,1007
|
|
26
26
|
crystalwindow/gametests/windowtesting.py,sha256=_9X6wnV1-_X_PtNS-0zu-k209NtFIwAc4vpxLPp7V2o,97
|
|
27
|
-
crystalwindow-2.
|
|
28
|
-
crystalwindow-2.
|
|
29
|
-
crystalwindow-2.
|
|
30
|
-
crystalwindow-2.
|
|
31
|
-
crystalwindow-2.
|
|
27
|
+
crystalwindow-2.9.8.1.dist-info/licenses/LICENSE,sha256=7pvUgvRXL3ED5VVAZPH5oGn1CaIXcyoDC9gqox6sB0g,1079
|
|
28
|
+
crystalwindow-2.9.8.1.dist-info/METADATA,sha256=l8IriB_FS0EIrbcOiYlRxVUsR5GJkwS5U3z68gDynyI,6587
|
|
29
|
+
crystalwindow-2.9.8.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
30
|
+
crystalwindow-2.9.8.1.dist-info/top_level.txt,sha256=PeQSld4b19XWT-zvbYkvE2Xg8sakIMbDzSzSdOSRN8o,14
|
|
31
|
+
crystalwindow-2.9.8.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|