Skip to content

Commit 5e8872b

Browse files
Fix workflow: Add PYTHONPATH environment variable for tests and linting
- Set PYTHONPATH to include src/main/python directory - Updated pyproject.toml package discovery settings - This should resolve import issues in GitHub Actions
1 parent eea5a38 commit 5e8872b

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/commit-stage-monolith.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ jobs:
4848

4949
- name: Run Python Tests
5050
run: |
51+
export PYTHONPATH="${PYTHONPATH}:$(pwd)/src/main/python"
5152
pytest src/test/python/ -v
5253
working-directory: monolith
5354

5455
- name: Run Python Linting
5556
run: |
57+
export PYTHONPATH="${PYTHONPATH}:$(pwd)/src/main/python"
5658
flake8 src/main/python/ --max-line-length=100 --extend-ignore=E203,W503
5759
black --check src/main/python/
5860
isort --check-only src/main/python/

monolith/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ test = [
4848
[tool.setuptools.packages.find]
4949
where = ["src/main/python"]
5050

51+
[tool.setuptools.package-dir]
52+
"" = "src/main/python"
53+
5154
[tool.pytest.ini_options]
5255
testpaths = ["src/test/python"]
5356
python_files = ["test_*.py", "*_test.py"]

0 commit comments

Comments
 (0)