From abf4b3bcbc429edc7971594ee09cbd910889e11a Mon Sep 17 00:00:00 2001 From: agilbert1412 Date: Sun, 28 May 2023 19:00:33 -0400 Subject: [PATCH] Stardew valley: Fix package and imports for apworld linux (#1842) - Fix csv load to use explicitly imported self package instead of keyword __package__ - Fix init.py having a relative import to outside of the apworld --- worlds/stardew_valley/__init__.py | 2 +- worlds/stardew_valley/data/crops_data.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/worlds/stardew_valley/__init__.py b/worlds/stardew_valley/__init__.py index 5d32f775..bf70cd8e 100644 --- a/worlds/stardew_valley/__init__.py +++ b/worlds/stardew_valley/__init__.py @@ -10,7 +10,7 @@ from .logic import StardewLogic, StardewRule, True_ from .options import stardew_valley_options, StardewOptions, fetch_options from .regions import create_regions from .rules import set_rules -from ..generic.Rules import set_rule +from worlds.generic.Rules import set_rule client_version = 0 diff --git a/worlds/stardew_valley/data/crops_data.py b/worlds/stardew_valley/data/crops_data.py index f5e652b8..a8c0cbc7 100644 --- a/worlds/stardew_valley/data/crops_data.py +++ b/worlds/stardew_valley/data/crops_data.py @@ -1,6 +1,8 @@ from dataclasses import dataclass from typing import List +from .. import data + @dataclass(frozen=True) class SeedItem: @@ -23,7 +25,7 @@ def load_crop_csv(): except ImportError: from importlib_resources import files # noqa - with files(__package__).joinpath("crops.csv").open() as file: + with files(data).joinpath("crops.csv").open() as file: reader = csv.DictReader(file) crops = [] seeds = []