Skip to content

Commit

Permalink
Adding PYTHONPATH to fix pytest 8.0 error
Browse files Browse the repository at this point in the history
  • Loading branch information
marcieltorres committed Feb 4, 2024
1 parent 2f63a29 commit 9f086cc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# loading and exporting all env vars from .env file automatically
include .env
export $(shell sed 's/=.*//' .env)

APP_NAME="python-boilerplate-project"
IMAGE_NAME="python-boilerplate-project"
VERSION="latest"
Expand Down Expand Up @@ -35,7 +39,7 @@ docker/down:
docker-compose down --remove-orphans

docker/test:
docker-compose run ${APP_NAME} poetry run pytest --cov-report=html --cov-report=term --cov .
PYTHONPATH='.' docker-compose run ${APP_NAME} poetry run pytest --cov-report=html --cov-report=term --cov .

docker/lint:
docker-compose run ${APP_NAME} poetry run ruff check .
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ A python boilerplate project using poetry

Variable | Description | Available Values | Default Value | Required
--- | --- | --- | --- | ---
ENV | The application enviroment | `dev / test / qa / prod` | `dev` | Yes
ENV | The application enviroment | `dev / test / qa / prod` | `dev` | Yes
PYTHONPATH | Provides guidance to the Python interpreter about where to find libraries and applications | [ref](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH) | `.` | Yes

*Note: When you run the install command (using docker or locally), a .env file will be created automatically based on [env.template](env.template)*

Expand Down
3 changes: 2 additions & 1 deletion env.template
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ENV=dev
ENV=dev
PYTHONPATH=.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
python = "^3.11"

[tool.poetry.dev-dependencies]
pytest = "7.4.4"
pytest = "^8.0.0"
pytest-cov = "^4.1.0"
ruff = "^0.1.6"

Expand Down

0 comments on commit 9f086cc

Please sign in to comment.