From 0591d8e10a9d0c89371e062bff2222f01ebd5ac3 Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Fri, 13 Sep 2024 13:47:58 +0100 Subject: [PATCH] Fix package missing bug (#606) The Python script in the `experimental.jvm` package is not intended to be invoked by the core OFG logic. Instead, it is meant to be executed by the `run_e2e.sh` script located in the same directory. Therefore, if the package name `experimental.jvm` needs to be changed as done in #604, the `sys.path` must be set to the core OFG base path. This PR implements that change. --------- Signed-off-by: Arthur Chan --- experimental/jvm/generate_projects.py | 4 ++++ experimental/jvm/utils.py | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/experimental/jvm/generate_projects.py b/experimental/jvm/generate_projects.py index e27b6b3f96..99df3a2268 100644 --- a/experimental/jvm/generate_projects.py +++ b/experimental/jvm/generate_projects.py @@ -14,6 +14,10 @@ # limitations under the License. """Manager for running auto-gen from scratch.""" +import sys + +sys.path.append('../../') + import argparse import logging import os diff --git a/experimental/jvm/utils.py b/experimental/jvm/utils.py index ffb042e6fe..f9207895b4 100644 --- a/experimental/jvm/utils.py +++ b/experimental/jvm/utils.py @@ -15,15 +15,19 @@ ############################################################################### """Provides a set of utils for oss-fuzz-gen on new Java projects integration""" +import sys + +sys.path.append('../../') + import logging import os import subprocess from typing import Optional -import constants -import oss_fuzz_templates from urllib3.util import parse_url +from experimental.jvm import constants, oss_fuzz_templates + logger = logging.getLogger(__name__)