Skip to content

Commit

Permalink
refactor settings #152
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-RLI committed Oct 22, 2024
1 parent 2616713 commit d9fae74
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions metadata/v20/build_source/scripts/resolve_schema_refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
requires: "pip install jsonschema referencing"
Usage: Script with additional arguments --debug for more detailed output.
Usage: Script with additional arguments --debug for more detailed output.
Requires the folder structure introduced in oemetadata v2.0.0.
"""

Expand All @@ -22,28 +22,25 @@
import logging

# from datetime import datetime
from pathlib import Path
from urllib.parse import urljoin
import argparse

from referencing import Registry, Resource
from jsonschema import Draft7Validator

from settings import (
MAIN_SCHEMA_PATH,
SCHEMA_REFS,
RESOLVED_SCHEMA_FILE_NAME,
EXPECTED_SCHEMA_PATH,
LOG_FORMAT,
)

# Configuration
LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"

logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
logger = logging.getLogger(__name__)

# Constants
BASE_PATH = Path("metadata/")
VERSION = "v20"
VERSION_PATH = BASE_PATH / VERSION
SCHEMA_BUILD_PATH = VERSION_PATH / "build_source"
MAIN_SCHEMA_PATH = SCHEMA_BUILD_PATH / "schema_structure.json"
SCHEMA_REFS = SCHEMA_BUILD_PATH / "schemas"
RESOLVED_SCHEMA_FILE_NAME = VERSION_PATH / "schema.json"
EXPECTED_SCHEMA_PATH = VERSION_PATH / "schema.json"


# Function Definitions
def setup():
Expand Down

0 comments on commit d9fae74

Please sign in to comment.