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:
Duck
2025-07-31 14:33:56 -06:00
committed by GitHub
parent 754e0a0de4
commit b1f729a970
5 changed files with 9 additions and 21 deletions

View File

@@ -1118,7 +1118,7 @@ class PlandoConnection(typing.NamedTuple):
entrance: str entrance: str
exit: 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 percentage: int = 100

View File

@@ -953,8 +953,7 @@ def _extend_freeze_support() -> None:
# Handle the first process that MP will create # Handle the first process that MP will create
if ( if (
len(sys.argv) >= 2 and sys.argv[-2] == '-c' and sys.argv[-1].startswith(( 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',
'from multiprocessing.resource_tracker import main', # Py>=3.8
'from multiprocessing.forkserver import main' 'from multiprocessing.forkserver import main'
)) and set(sys.argv[1:-2]) == set(_args_from_interpreter_flags()) )) and set(sys.argv[1:-2]) == set(_args_from_interpreter_flags())
): ):

View File

@@ -61,7 +61,6 @@ from Utils import version_tuple, is_windows, is_linux
from Cython.Build import cythonize from Cython.Build import cythonize
# On Python < 3.10 LogicMixin is not currently supported.
non_apworlds: set[str] = { non_apworlds: set[str] = {
"A Link to the Past", "A Link to the Past",
"Adventure", "Adventure",
@@ -78,9 +77,6 @@ non_apworlds: set[str] = {
"Wargroove", "Wargroove",
} }
# LogicMixin is broken before 3.10 import revamp
if sys.version_info < (3,10):
non_apworlds.add("Hollow Knight")
def download_SNI() -> None: def download_SNI() -> None:
print("Updating SNI") print("Updating SNI")
@@ -108,8 +104,8 @@ def download_SNI() -> None:
# prefer "many" builds # prefer "many" builds
if "many" in download_url: if "many" in download_url:
break break
# prefer the correct windows or windows7 build # prefer non-windows7 builds to get up-to-date dependencies
if platform_name == "windows" and ("windows7" in download_url) == (sys.version_info < (3, 9)): if platform_name == "windows" and "windows7" not in download_url:
break break
if source_url and source_url.endswith(".zip"): if source_url and source_url.endswith(".zip"):
@@ -418,7 +414,7 @@ class BuildExeCommand(cx_Freeze.command.build_exe.build_exe):
if is_windows: if is_windows:
# Inno setup stuff # Inno setup stuff
with open("setup.ini", "w") as f: 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") f.write(f"[Data]\nsource_path={self.buildfolder}\nmin_windows={min_supported_windows}\n")
with open("installdelete.iss", "w") as f: with open("installdelete.iss", "w") as f:
f.writelines("Type: filesandordirs; Name: \"{app}\\lib\\worlds\\"+world_directory+"\"\n" f.writelines("Type: filesandordirs; Name: \"{app}\\lib\\worlds\\"+world_directory+"\"\n"

View File

@@ -29,14 +29,9 @@ def run_locations_benchmark():
rule_iterations: int = 100_000 rule_iterations: int = 100_000
if sys.version_info >= (3, 9): @staticmethod
@staticmethod def format_times_from_counter(counter: collections.Counter[str], top: int = 5) -> str:
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))
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))
def location_test(self, test_location: Location, state: CollectionState, state_name: str) -> float: def location_test(self, test_location: Location, state: CollectionState, state_name: str) -> float:
with TimeIt(f"{test_location.game} {self.rule_iterations} " with TimeIt(f"{test_location.game} {self.rule_iterations} "

View File

@@ -63,9 +63,7 @@ class WorldSource:
sys.modules[mod.__name__] = mod sys.modules[mod.__name__] = mod
with warnings.catch_warnings(): with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="__package__ != __spec__.parent") warnings.filterwarnings("ignore", message="__package__ != __spec__.parent")
# Found no equivalent for < 3.10 importer.exec_module(mod)
if hasattr(importer, "exec_module"):
importer.exec_module(mod)
else: else:
importlib.import_module(f".{self.path}", "worlds") importlib.import_module(f".{self.path}", "worlds")
self.time_taken = time.perf_counter()-start self.time_taken = time.perf_counter()-start