add lookup of relative paths for import hooks, related to #33

This commit is contained in:
Florian Förster 2025-06-11 11:45:04 +02:00
parent 7df35ed05d
commit ff450a03de
3 changed files with 29 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[project]
name = "delta-barth"
version = "0.5.10"
version = "0.5.11rc2"
description = "workflows and pipelines for the Python-based Plugin of Delta Barth's ERP system"
authors = [
{name = "Florian Förster", email = "f.foerster@d-opt.com"},
@ -74,7 +74,7 @@ directory = "reports/coverage"
[tool.bumpversion]
current_version = "0.5.10"
current_version = "0.5.11rc2"
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.

22
src/delta_barth/_debug.py Normal file
View File

@ -0,0 +1,22 @@
import importlib.util
import os
import sys
def print_infos() -> str:
PATH = os.environ.get("PATH", "")
PY_HOME = os.environ.get("PYTHONHOME", "")
PY_PATH = os.environ.get("PYTHONPATH", "")
SYS_PATH = sys.path
out = ""
out += f"\n>>> PATH is:\n{PATH}"
out += f"\n>>> PYTHONHOME is:\n{PY_HOME}"
out += f"\n>>> PYTHONPATH is:\n{PY_PATH}"
out += f"\n>>> Internal sys.path is:\n{SYS_PATH}"
found_spec = importlib.util.find_spec("numpy")
out += f"\n>>> Found spec for 'numpy' is:\n{found_spec}"
print(out)
return out

5
tests/test_debug.py Normal file
View File

@ -0,0 +1,5 @@
from delta_barth import _debug as debug
def test_print_info():
debug.print_infos()