diff --git a/harvester/harvest.py b/harvester/harvest.py index cd2a363c..7913d69d 100644 --- a/harvester/harvest.py +++ b/harvester/harvest.py @@ -20,7 +20,9 @@ ckan = ckanapi.RemoteCKAN(os.getenv("CKAN_URL"), apikey=os.getenv("CKAN_API_TOKEN_DEV")) -ROOT_DIR = Path(__file__).parents[1] +dirname = os.path.dirname +SCHEMA_PATH = os.path.join(dirname(dirname(__file__)), os.path.join('data', 'dcatus', + 'schemas/dataset.json')) @dataclass @@ -34,9 +36,7 @@ class HarvestSource: _waf_config: dict = field(default_factory=lambda: {}) _extra_source_name: str = "harvest_source_name" # TODO: update this _dataset_schema: dict = field( - default_factory=lambda: open_json( - ROOT_DIR / "data" / "dcatus" / "schemas" / "dataset.json" - ) + default_factory=lambda: open_json(SCHEMA_PATH) ) # not read-only because these values are added after initialization