crystalwindow 2.7.8__tar.gz → 2.9.8.2__tar.gz
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.
- {crystalwindow-2.7.8/crystalwindow.egg-info → crystalwindow-2.9.8.2}/PKG-INFO +1 -1
- crystalwindow-2.9.8.2/crystalwindow/ver_warner.py +44 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2/crystalwindow.egg-info}/PKG-INFO +1 -1
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/setup.py +1 -1
- crystalwindow-2.7.8/crystalwindow/ver_warner.py +0 -54
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/LICENSE +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/MANIFEST.in +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/README.md +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/FileHelper.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/Icons/default_icon.png +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/__init__.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/animation.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/assets.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/collision.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/draw_helpers.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/draw_rects.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/draw_text_helper.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/draw_tool.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/fun_helpers.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/gametests/__init__.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/gametests/__main__.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/gametests/gravitytest.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/gametests/guitesting.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/gametests/sandbox.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/gametests/windowtesting.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/gravity.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/gui.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/gui_ext.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/math.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/player.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/sprites.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/tilemap.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow/window.py +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow.egg-info/SOURCES.txt +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow.egg-info/dependency_links.txt +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow.egg-info/requires.txt +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/crystalwindow.egg-info/top_level.txt +0 -0
- {crystalwindow-2.7.8 → crystalwindow-2.9.8.2}/setup.cfg +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from importlib.metadata import version as get_version, PackageNotFoundError
|
|
2
|
+
from packaging import version as parse_ver
|
|
3
|
+
import requests
|
|
4
|
+
import os
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
def check_for_update(package_name="crystalwindow"):
|
|
8
|
+
"""
|
|
9
|
+
Checks PyPI for updates.
|
|
10
|
+
Warns every run if outdated.
|
|
11
|
+
Skips warning if your version is newer than PyPI.
|
|
12
|
+
"""
|
|
13
|
+
try:
|
|
14
|
+
# get current version
|
|
15
|
+
try:
|
|
16
|
+
current_version = get_version(package_name)
|
|
17
|
+
except PackageNotFoundError:
|
|
18
|
+
print(f"(⚠️ Package '{package_name}' not found)")
|
|
19
|
+
return
|
|
20
|
+
|
|
21
|
+
# get newest version from PyPI
|
|
22
|
+
url = f"https://pypi.org/pypi/{package_name}/json"
|
|
23
|
+
response = requests.get(url, timeout=3)
|
|
24
|
+
if response.status_code != 200:
|
|
25
|
+
print("(⚠️ PyPI request failed, skipping version check)")
|
|
26
|
+
return
|
|
27
|
+
|
|
28
|
+
latest_version = response.json()["info"]["version"]
|
|
29
|
+
|
|
30
|
+
# compare properly using packaging.version
|
|
31
|
+
if parse_ver.parse(current_version) < parse_ver.parse(latest_version):
|
|
32
|
+
print(f"\n⚠️ Yo dev! '{package_name}' is outdated ({current_version})")
|
|
33
|
+
print(f"👉 Newest is {latest_version}! Run:")
|
|
34
|
+
print(f" pip install --upgrade {package_name}")
|
|
35
|
+
print(f"Or peep: https://pypi.org/project/{package_name}/{latest_version}/\n")
|
|
36
|
+
|
|
37
|
+
elif parse_ver.parse(current_version) > parse_ver.parse(latest_version):
|
|
38
|
+
print(f"🚀 Local version ({current_version}) is newer than PyPI ({latest_version}) — flex on 'em 😎")
|
|
39
|
+
|
|
40
|
+
else:
|
|
41
|
+
print(f"✅ Up to date! ver = {current_version}.")
|
|
42
|
+
|
|
43
|
+
except Exception as e:
|
|
44
|
+
print(f"(⚠️ Version check failed: {e})")
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="crystalwindow", # this is the name ppl will pip install
|
|
5
|
-
version="2.
|
|
5
|
+
version="2.9.8.2", # update when u change stuff
|
|
6
6
|
packages=find_packages(include=["crystalwindow", "crystalwindow.*"]),
|
|
7
7
|
include_package_data=True,
|
|
8
8
|
install_requires=["pygame>=2.3.0"],
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
from importlib.metadata import version as get_version, PackageNotFoundError
|
|
2
|
-
import requests
|
|
3
|
-
import os
|
|
4
|
-
import json
|
|
5
|
-
|
|
6
|
-
def check_for_update(package_name="crystalwindow"):
|
|
7
|
-
"""
|
|
8
|
-
Checks PyPI for updates once per installed version.
|
|
9
|
-
If up to date, prints it only once.
|
|
10
|
-
If outdated, warns user every time until updated.
|
|
11
|
-
"""
|
|
12
|
-
try:
|
|
13
|
-
# get current version
|
|
14
|
-
try:
|
|
15
|
-
current_version = get_version(package_name)
|
|
16
|
-
except PackageNotFoundError:
|
|
17
|
-
print(f"(⚠️ Package '{package_name}' not found)")
|
|
18
|
-
return
|
|
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
|
-
url = f"https://pypi.org/pypi/{package_name}/json"
|
|
36
|
-
response = requests.get(url, timeout=3)
|
|
37
|
-
|
|
38
|
-
if response.status_code == 200:
|
|
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")
|
|
49
|
-
|
|
50
|
-
with open(cache_file, "w") as f:
|
|
51
|
-
json.dump(cache, f)
|
|
52
|
-
|
|
53
|
-
except Exception as e:
|
|
54
|
-
print(f"(⚠️ Version check failed: {e})")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|