Skip to content

Commit 20fb4a6

Browse files
Remove PYTHONPATH setup and add Docker support for tests
Removed the PYTHONPATH configuration in the GitHub Actions workflow file as it is unnecessary. Added a new service in `compose.yml` to mimic the GitHub Actions job for running Python tests, and changed the Python version in the Dockerfile to 3.9-slim for compatibility.
1 parent d42657c commit 20fb4a6

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/workflows/python-pytests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ jobs:
3131
pip install poetry
3232
poetry install
3333
34-
- name: Set PYTHONPATH
35-
run: echo "PYTHONPATH=$(pwd):$(pwd)/tests" >> $GITHUB_ENV
36-
3734
- name: Run tests
3835
run: |
3936
source .venv/bin/activate

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use an official Python runtime as a parent image
2-
FROM python:3.12-slim
2+
FROM python:3.9-slim
33

44
# Create a non-root user
55
RUN useradd -m user

compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,11 @@ services:
2222
entrypoint: ["/usr/src/app/entrypoint.sh"]
2323
networks:
2424
- dcp
25+
26+
# Mimic the GitHub Actions job for running Python tests
27+
python-pytests:
28+
build:
29+
context: .
30+
user: root
31+
# entrypoint: ["/bin/bash"] # To get an interactive shell
32+
entrypoint: ["poetry", "run", "pytest"]

0 commit comments

Comments
 (0)