setup: honor build automation ...
... and reorder imports to PEP it up
This commit is contained in:
parent
ea2175cb8a
commit
428344b6bc
39
setup.py
39
setup.py
|
@ -10,27 +10,12 @@ import zipfile
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from hashlib import sha3_512
|
from hashlib import sha3_512
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
import ModuleUpdate
|
|
||||||
ModuleUpdate.update()
|
|
||||||
|
|
||||||
from Launcher import components, icon_paths
|
|
||||||
from Utils import version_tuple, is_windows, is_linux
|
|
||||||
|
|
||||||
# On Python < 3.10 LogicMixin is not currently supported.
|
|
||||||
apworlds: set = {
|
|
||||||
"Subnautica",
|
|
||||||
"Factorio",
|
|
||||||
"Rogue Legacy",
|
|
||||||
}
|
|
||||||
|
|
||||||
# This is a bit jank. We need cx-Freeze to be able to run anything from this script, so install it
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
requirement = 'cx-Freeze>=6.14.1'
|
|
||||||
|
# This is a bit jank. We need cx-Freeze to be able to run anything from this script, so install it
|
||||||
try:
|
try:
|
||||||
|
requirement = 'cx-Freeze>=6.14.1'
|
||||||
pkg_resources.require(requirement)
|
pkg_resources.require(requirement)
|
||||||
import cx_Freeze
|
import cx_Freeze
|
||||||
except pkg_resources.ResolutionError:
|
except pkg_resources.ResolutionError:
|
||||||
|
@ -42,6 +27,24 @@ except pkg_resources.ResolutionError:
|
||||||
# .build only exists if cx-Freeze is the right version, so we have to update/install that first before this line
|
# .build only exists if cx-Freeze is the right version, so we have to update/install that first before this line
|
||||||
import setuptools.command.build
|
import setuptools.command.build
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
# need to run this early to import from Utils and Launcher
|
||||||
|
# TODO: move stuff to not require this
|
||||||
|
import ModuleUpdate
|
||||||
|
ModuleUpdate.update(yes="--yes" in sys.argv or "-y" in sys.argv)
|
||||||
|
ModuleUpdate.update_ran = False # restore for later
|
||||||
|
|
||||||
|
from Launcher import components, icon_paths
|
||||||
|
from Utils import version_tuple, is_windows, is_linux
|
||||||
|
|
||||||
|
|
||||||
|
# On Python < 3.10 LogicMixin is not currently supported.
|
||||||
|
apworlds: set = {
|
||||||
|
"Subnautica",
|
||||||
|
"Factorio",
|
||||||
|
"Rogue Legacy",
|
||||||
|
}
|
||||||
|
|
||||||
if os.path.exists("X:/pw.txt"):
|
if os.path.exists("X:/pw.txt"):
|
||||||
print("Using signtool")
|
print("Using signtool")
|
||||||
with open("X:/pw.txt", encoding="utf-8-sig") as f:
|
with open("X:/pw.txt", encoding="utf-8-sig") as f:
|
||||||
|
|
Loading…
Reference in New Issue