From 65b3a2c7dd75d28e875c59b39ba2b48a065ae731 Mon Sep 17 00:00:00 2001 From: Sara Zan Date: Tue, 15 Mar 2022 17:33:01 +0100 Subject: [PATCH] Package JSON schemas properly in Haystack (#2316) * Restrain the files loaded by options.packages.find * Move json-schemas inside haystack * Change syntax in setup.cfg * Change again syntax in options.package_data * Specify more exactly which files to package Co-authored-by: Thomas Stadelmann --- .../json-schemas}/haystack-pipeline-1.0.0.schema.json | 0 .../json-schemas}/haystack-pipeline-1.2.1rc0.schema.json | 0 .../json-schemas}/haystack-pipeline-unstable.schema.json | 0 .../json-schemas}/haystack-pipeline.schema.json | 0 haystack/nodes/_json_schema.py | 4 ++-- setup.cfg | 7 +++++-- 6 files changed, 7 insertions(+), 4 deletions(-) rename {json-schemas => haystack/json-schemas}/haystack-pipeline-1.0.0.schema.json (100%) rename {json-schemas => haystack/json-schemas}/haystack-pipeline-1.2.1rc0.schema.json (100%) rename {json-schemas => haystack/json-schemas}/haystack-pipeline-unstable.schema.json (100%) rename {json-schemas => haystack/json-schemas}/haystack-pipeline.schema.json (100%) diff --git a/json-schemas/haystack-pipeline-1.0.0.schema.json b/haystack/json-schemas/haystack-pipeline-1.0.0.schema.json similarity index 100% rename from json-schemas/haystack-pipeline-1.0.0.schema.json rename to haystack/json-schemas/haystack-pipeline-1.0.0.schema.json diff --git a/json-schemas/haystack-pipeline-1.2.1rc0.schema.json b/haystack/json-schemas/haystack-pipeline-1.2.1rc0.schema.json similarity index 100% rename from json-schemas/haystack-pipeline-1.2.1rc0.schema.json rename to haystack/json-schemas/haystack-pipeline-1.2.1rc0.schema.json diff --git a/json-schemas/haystack-pipeline-unstable.schema.json b/haystack/json-schemas/haystack-pipeline-unstable.schema.json similarity index 100% rename from json-schemas/haystack-pipeline-unstable.schema.json rename to haystack/json-schemas/haystack-pipeline-unstable.schema.json diff --git a/json-schemas/haystack-pipeline.schema.json b/haystack/json-schemas/haystack-pipeline.schema.json similarity index 100% rename from json-schemas/haystack-pipeline.schema.json rename to haystack/json-schemas/haystack-pipeline.schema.json diff --git a/haystack/nodes/_json_schema.py b/haystack/nodes/_json_schema.py index b98230099..71c206e79 100644 --- a/haystack/nodes/_json_schema.py +++ b/haystack/nodes/_json_schema.py @@ -33,8 +33,8 @@ from haystack.errors import HaystackError, PipelineSchemaError from haystack.nodes.base import BaseComponent -JSON_SCHEMAS_PATH = Path(__file__).parent.parent.parent / "json-schemas" -SCHEMA_URL = "https://haystack.deepset.ai/json-schemas/" +JSON_SCHEMAS_PATH = Path(__file__).parent.parent.parent / "haystack" / "json-schemas" +SCHEMA_URL = "https://haystack.deepset.ai/haystack/json-schemas/" # Allows accessory classes (like enums and helpers) to be registered as valid input for # custom node's init parameters. For now we disable this feature, but flipping this variables diff --git a/setup.cfg b/setup.cfg index 6effb56db..b6efd2231 100644 --- a/setup.cfg +++ b/setup.cfg @@ -109,8 +109,11 @@ exclude = test* tutorials* ui* -include = - json-schemas + + +[options.package_data] +haystack = + json-schemas/*.schema.json [options.extras_require]