Skip to content

Commit 92dfa89

Browse files
committed
Some changes
1 parent f30f4f8 commit 92dfa89

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
lazurite==0.8.3
22
rich==14.2.0
3-
packaging==25.0
3+
packaging>=25.0
4+

tool/__main__.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
from packaging.version import parse as parse_ver
55
with open("requirements.txt", 'r') as file:
66
for ln in file:
7-
ln = ln.strip().replace(" ", "").split("==")
8-
ver = importlib.metadata.version(ln[0])
9-
if parse_ver(ver) != parse_ver(ln[1]):
10-
print(f'Warning! Using incompatible version {ver} of "{ln[0]}" instead of {ln[1]}')
7+
ln = ln.strip().replace(" ", "")
8+
if "==" in ln:
9+
pkg = ln.split("==")
10+
ver = importlib.metadata.version(pkg[0])
11+
if parse_ver(ver) != parse_ver(pkg[1]):
12+
print(f'Warning! Using incompatible version {ver} of "{pkg[0]}" instead of {pkg[1]}')
13+
elif ">=" in ln:
14+
pkg = ln.split(">=")
15+
ver = importlib.metadata.version(pkg[0])
16+
if parse_ver(ver) < parse_ver(pkg[1]):
17+
print(f'Warning! Using incompatible version {ver} of "{pkg[0]}" instead of {pkg[1]} or higher')
1118
from cli import main
1219
main()
1320
except importlib.metadata.PackageNotFoundError as e:

tool/setup.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,8 @@ def get_shaderc_url(data_path: str, os_name: str, arch: str):
5656
if os_name == 'Windows':
5757
shaderc_url += "win-x64.exe"
5858
shaderc_path += ".exe"
59-
return (shaderc_url, shaderc_path)
60-
6159
elif os_name == "Darwin":
6260
shaderc_url += "osx-x64"
63-
return (shaderc_url, shaderc_path)
64-
6561
elif os_name == "Linux":
6662
if arch == 'x86_64':
6763
shaderc_url += "linux-x64"
@@ -72,11 +68,10 @@ def get_shaderc_url(data_path: str, os_name: str, arch: str):
7268
else:
7369
progress.console.print("No shaderc version found for", arch, style='red')
7470
return None
75-
76-
return (shaderc_url, shaderc_path)
7771
else:
7872
progress.console.print("Unable to determine platform", os_name, style='red')
7973
return None
74+
return (shaderc_url, shaderc_path)
8075

8176

8277
def check_and_apply_termux_fix():

0 commit comments

Comments
 (0)