diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 071e1d7d1b..05e068b6c9 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -21,6 +21,10 @@ on: branches: - 'master' + pull_request: + branches: + - 'master' + jobs: # Build the docker image diff --git a/InvenTree/InvenTree/config.py b/InvenTree/InvenTree/config.py index 27722435f3..fe9a4e4914 100644 --- a/InvenTree/InvenTree/config.py +++ b/InvenTree/InvenTree/config.py @@ -59,6 +59,13 @@ def get_config_file(create=True) -> Path: def load_config_data() -> map: """Load configuration data from the config file.""" + import sys + + print("load_config_data()") + print("- cwd:", os.getcwd()) + print("- exe:", sys.executable) + print("- path:", sys.path) + import yaml cfg_file = get_config_file() diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index d8c8e45983..bd8bba0756 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -31,6 +31,16 @@ INVENTREE_NEWS_URL = 'https://inventree.org/news/feed.atom' # Determine if we are running in "test" mode e.g. "manage.py test" TESTING = 'test' in sys.argv +# Note: The following fix is "required" for docker build workflow +# Note: 2022-12-12 still unsure why... +if TESTING: + # Ensure that sys.path includes global python libs + python_dir = os.path.dirname(sys.executable) + python_lib = os.path.join(python_dir, "lib", "site-packages") + + if python_lib not in sys.path: + sys.path.append(python_lib) + # Are environment variables manipulated by tests? Needs to be set by testing code TESTING_ENV = False