diff --git a/bigfun/bigfunctions.py b/bigfun/bigfunctions.py index 8e6e4fc97..9f5bf22f1 100644 --- a/bigfun/bigfunctions.py +++ b/bigfun/bigfunctions.py @@ -177,7 +177,9 @@ def _test_python_function_locally(self): with open(code_filename, 'w', encoding='utf-8') as out: out.write(code) print_info(f'Executing python code file {code_filename}') - os.system(f'python {code_filename}') + requirements = ' '.join([f'--with "{r.strip()}"' for r in self.config.get('requirements', '').split('\n')]) + command = f'uv run --no-project {requirements} {code_filename}' + os.system(command) def deploy(self): self.config['dataset_location'] = self.dataset.location diff --git a/pyproject.toml b/pyproject.toml index 51af44bc8..5538214bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Supercharge BigQuery with BigFunctions" readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.10" keywords = ["bigquery", "data", "analytics"] license = {text = "MIT"} classifiers = [ @@ -28,6 +28,7 @@ dependencies = [ "click-help-colors", "vertexai", "cryptography", + "uv", ] dynamic = ["version"]