mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-20 11:51:32 -06:00
Core: Remove Checks for Unsupported Versions (#5067)
* Remove redundant version checks/compatibility * Change windows7 check * Edit comments Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> --------- Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
@@ -1118,7 +1118,7 @@ class PlandoConnection(typing.NamedTuple):
|
||||
|
||||
entrance: str
|
||||
exit: str
|
||||
direction: typing.Literal["entrance", "exit", "both"] # TODO: convert Direction to StrEnum once 3.8 is dropped
|
||||
direction: typing.Literal["entrance", "exit", "both"] # TODO: convert Direction to StrEnum once 3.10 is dropped
|
||||
percentage: int = 100
|
||||
|
||||
|
||||
|
3
Utils.py
3
Utils.py
@@ -953,8 +953,7 @@ def _extend_freeze_support() -> None:
|
||||
# Handle the first process that MP will create
|
||||
if (
|
||||
len(sys.argv) >= 2 and sys.argv[-2] == '-c' and sys.argv[-1].startswith((
|
||||
'from multiprocessing.semaphore_tracker import main', # Py<3.8
|
||||
'from multiprocessing.resource_tracker import main', # Py>=3.8
|
||||
'from multiprocessing.resource_tracker import main',
|
||||
'from multiprocessing.forkserver import main'
|
||||
)) and set(sys.argv[1:-2]) == set(_args_from_interpreter_flags())
|
||||
):
|
||||
|
10
setup.py
10
setup.py
@@ -61,7 +61,6 @@ from Utils import version_tuple, is_windows, is_linux
|
||||
from Cython.Build import cythonize
|
||||
|
||||
|
||||
# On Python < 3.10 LogicMixin is not currently supported.
|
||||
non_apworlds: set[str] = {
|
||||
"A Link to the Past",
|
||||
"Adventure",
|
||||
@@ -78,9 +77,6 @@ non_apworlds: set[str] = {
|
||||
"Wargroove",
|
||||
}
|
||||
|
||||
# LogicMixin is broken before 3.10 import revamp
|
||||
if sys.version_info < (3,10):
|
||||
non_apworlds.add("Hollow Knight")
|
||||
|
||||
def download_SNI() -> None:
|
||||
print("Updating SNI")
|
||||
@@ -108,8 +104,8 @@ def download_SNI() -> None:
|
||||
# prefer "many" builds
|
||||
if "many" in download_url:
|
||||
break
|
||||
# prefer the correct windows or windows7 build
|
||||
if platform_name == "windows" and ("windows7" in download_url) == (sys.version_info < (3, 9)):
|
||||
# prefer non-windows7 builds to get up-to-date dependencies
|
||||
if platform_name == "windows" and "windows7" not in download_url:
|
||||
break
|
||||
|
||||
if source_url and source_url.endswith(".zip"):
|
||||
@@ -418,7 +414,7 @@ class BuildExeCommand(cx_Freeze.command.build_exe.build_exe):
|
||||
if is_windows:
|
||||
# Inno setup stuff
|
||||
with open("setup.ini", "w") as f:
|
||||
min_supported_windows = "6.2.9200" if sys.version_info > (3, 9) else "6.0.6000"
|
||||
min_supported_windows = "6.2.9200"
|
||||
f.write(f"[Data]\nsource_path={self.buildfolder}\nmin_windows={min_supported_windows}\n")
|
||||
with open("installdelete.iss", "w") as f:
|
||||
f.writelines("Type: filesandordirs; Name: \"{app}\\lib\\worlds\\"+world_directory+"\"\n"
|
||||
|
@@ -29,14 +29,9 @@ def run_locations_benchmark():
|
||||
|
||||
rule_iterations: int = 100_000
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@staticmethod
|
||||
def format_times_from_counter(counter: collections.Counter[str], top: int = 5) -> str:
|
||||
return "\n".join(f" {time:.4f} in {name}" for name, time in counter.most_common(top))
|
||||
else:
|
||||
@staticmethod
|
||||
def format_times_from_counter(counter: collections.Counter, top: int = 5) -> str:
|
||||
return "\n".join(f" {time:.4f} in {name}" for name, time in counter.most_common(top))
|
||||
@staticmethod
|
||||
def format_times_from_counter(counter: collections.Counter[str], top: int = 5) -> str:
|
||||
return "\n".join(f" {time:.4f} in {name}" for name, time in counter.most_common(top))
|
||||
|
||||
def location_test(self, test_location: Location, state: CollectionState, state_name: str) -> float:
|
||||
with TimeIt(f"{test_location.game} {self.rule_iterations} "
|
||||
|
@@ -63,9 +63,7 @@ class WorldSource:
|
||||
sys.modules[mod.__name__] = mod
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore", message="__package__ != __spec__.parent")
|
||||
# Found no equivalent for < 3.10
|
||||
if hasattr(importer, "exec_module"):
|
||||
importer.exec_module(mod)
|
||||
importer.exec_module(mod)
|
||||
else:
|
||||
importlib.import_module(f".{self.path}", "worlds")
|
||||
self.time_taken = time.perf_counter()-start
|
||||
|
Reference in New Issue
Block a user