Compare commits

...

3 Commits

Author SHA1 Message Date
Fabian Dill
aa36271e02 Core: write playthrough is disabled, rather than an empty section 2023-10-03 22:38:46 +02:00
Aaron Wagener
78057476f3 Docs: python 3.11 works now (#2258)
* Docs: python 3.11 works now

* change to py 3.12 unsupported
2023-10-03 12:19:09 +02:00
black-sliver
cdbb2cf7b7 Core: fix unittest world discovery (#2262) 2023-10-03 09:47:22 +02:00
5 changed files with 16 additions and 11 deletions

View File

@@ -1087,14 +1087,16 @@ class Spoiler:
playthrough: Dict[str, Union[List[str], Dict[str, str]]] # sphere "0" is list, others are dict
unreachables: Set[Location]
paths: Dict[str, List[Union[Tuple[str, str], Tuple[str, None]]]] # last step takes no further exits
level: int
def __init__(self, multiworld: MultiWorld) -> None:
def __init__(self, multiworld: MultiWorld, level: int = 0) -> None:
self.multiworld = multiworld
self.hashes = {}
self.entrances = {}
self.playthrough = {}
self.unreachables = set()
self.paths = {}
self.level = level
def set_entrance(self, entrance: str, exit_: str, direction: str, player: int) -> None:
if self.multiworld.players == 1:
@@ -1296,11 +1298,13 @@ class Spoiler:
outfile.write('\n\nLocations:\n\n')
outfile.write('\n'.join(
['%s: %s' % (location, item) for location, item in locations]))
outfile.write('\n\nPlaythrough:\n\n')
outfile.write('\n'.join(['%s: {\n%s\n}' % (sphere_nr, '\n'.join(
[f" {location}: {item}" for (location, item) in sphere.items()] if isinstance(sphere, dict) else
[f" {item}" for item in sphere])) for (sphere_nr, sphere) in self.playthrough.items()]))
if self.level > 1:
outfile.write('\n\nPlaythrough:\n\n')
outfile.write('\n'.join(['%s: {\n%s\n}' % (sphere_nr, '\n'.join(
[f" {location}: {item}" for (location, item) in sphere.items()] if isinstance(sphere, dict) else
[f" {item}" for item in sphere])) for (sphere_nr, sphere) in self.playthrough.items()]))
else:
outfile.write('\n\nPlaythrough is disabled.\n\n')
if self.unreachables:
outfile.write('\n\nUnreachable Items:\n\n')
outfile.write(

View File

@@ -36,7 +36,7 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
logger = logging.getLogger()
world.set_seed(seed, args.race, str(args.outputname) if args.outputname else None)
world.plando_options = args.plando_options
world.spoiler.level = args.spoiler
world.shuffle = args.shuffle.copy()
world.logic = args.logic.copy()
world.mode = args.mode.copy()

View File

@@ -8,7 +8,7 @@ use that version. These steps are for developers or platforms without compiled r
What you'll need:
* [Python 3.8.7 or newer](https://www.python.org/downloads/), not the Windows Store version
* **Python 3.11 does not work currently**
* **Python 3.12 is currently unsupported**
* pip: included in downloads from python.org, separate in many Linux distributions
* Matching C compiler
* possibly optional, read operating system specific sections
@@ -30,7 +30,7 @@ After this, you should be able to run the programs.
Recommended steps
* Download and install a "Windows installer (64-bit)" from the [Python download page](https://www.python.org/downloads)
* **Python 3.11 does not work currently**
* **Python 3.12 is currently unsupported**
* **Optional**: Download and install Visual Studio Build Tools from
[Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/).

View File

@@ -13,5 +13,6 @@ ModuleUpdate.update_ran = True # don't upgrade
import Utils
Utils.local_path.cached_path = pathlib.Path(__file__).parent.parent
file_path = pathlib.Path(__file__).parent.parent
Utils.local_path.cached_path = file_path
Utils.user_path() # initialize cached_path

View File

@@ -1,7 +1,7 @@
def load_tests(loader, standard_tests, pattern):
import os
import unittest
from ..TestBase import file_path
from .. import file_path
from worlds.AutoWorld import AutoWorldRegister
suite = unittest.TestSuite()