Skip to content

Commit

Permalink
Added python version check (#100)
Browse files Browse the repository at this point in the history
* Fixed overwritten typo and in typo

* Added python version check

* Inverted validate python check
  • Loading branch information
Wardergrip authored Sep 29, 2024
1 parent d0521e8 commit 3f17cbb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ After that it will try to download the extension or compile it if the download f
### Manually downloading the extension

The `extensions.zip` is distributed as part of the releases.
I case the CI fails, you can also download it from the CI artifacts directly.
In case the CI fails, you can also download it from the CI artifacts directly.

Simply extract the archive file to the `bin` directory and you are good to go.

Expand Down Expand Up @@ -79,7 +79,7 @@ This can be done with the following command:
python ./default_assets/manifests.py
```

## Additional/overwirtten asset packs
## Additional/overwritten asset packs

It is possible to have additional asset packs or override data of existing ones.
To do this you need asset packs in the user dir.
Expand Down
20 changes: 20 additions & 0 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@

import requests

requiredPythonMajorVersion = 3
requiredPythonMinorVersion = 12

def main(args):

# check if python version is what we expect
if validate_python_version() is False:
return

# update the submodules unless the user specifies otherwise
if args["update_submodules"]:
update_submodules()
Expand All @@ -33,6 +39,20 @@ def main(args):
print("Compiling extension")
subprocess.run([sys.executable, "utility_scripts/compile.py"])

def validate_python_version() -> bool:

isHigherMajor = sys.version_info[0] > requiredPythonMajorVersion

if isHigherMajor:
return True

if sys.version_info[0] is requiredPythonMajorVersion and sys.version_info[1] > requiredPythonMinorVersion:
return True

print(f"Please update your python to {requiredPythonMajorVersion}.{requiredPythonMinorVersion} or higher")
print(f"Installing failed.")

return False

def download_and_install_extension() -> bool:
# get the current tag using git
Expand Down

0 comments on commit 3f17cbb

Please sign in to comment.