File tree Expand file tree Collapse file tree 3 files changed +43
-10
lines changed
Expand file tree Collapse file tree 3 files changed +43
-10
lines changed Original file line number Diff line number Diff line change 1+ #
2+ # Copyright 2025 ABSA Group Limited
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+ #
Original file line number Diff line number Diff line change 2727from jsonschema import validate
2828from jsonschema .exceptions import ValidationError
2929
30- from . import conf_path # new import for CONF_DIR resolution
31- try : # fallback if relative import fails (e.g., executed as a script)
32- from . import conf_path as _conf_mod
33- except Exception : # pragma: no cover
34- import conf_path as _conf_mod
35- conf_path = _conf_mod
36-
37- # Remove old resolution logic, use module instead
38- _CONF_DIR = conf_path .CONF_DIR
39- _INVALID_CONF_ENV = conf_path .INVALID_CONF_ENV
30+ try :
31+ from .conf_path import CONF_DIR , INVALID_CONF_ENV
32+ except ImportError : # fallback when executed outside package context
33+ from conf_path import CONF_DIR , INVALID_CONF_ENV
34+
35+ # Use imported symbols for internal variables
36+ _CONF_DIR = CONF_DIR
37+ _INVALID_CONF_ENV = INVALID_CONF_ENV
4038
4139sys .path .append (os .path .join (os .path .dirname (__file__ )))
4240
Original file line number Diff line number Diff line change 1+ #
2+ # Copyright 2025 ABSA Group Limited
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+ #
16+ import os , sys
17+ # Ensure project root is on sys.path so 'src' package is importable during tests
18+ PROJECT_ROOT = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' ))
19+ if PROJECT_ROOT not in sys .path :
20+ sys .path .insert (0 , PROJECT_ROOT )
You can’t perform that action at this time.
0 commit comments