Skip to content

Commit

Permalink
Update from feedback on PR
Browse files Browse the repository at this point in the history
Remove execution of tests on pre-commit. Remove current directory check for setting path of env file.
  • Loading branch information
zacdezgeo committed Aug 1, 2024
1 parent f8461f5 commit f9eeb58
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,3 @@ repos:
args: [--ignore-missing-imports]
files: ^space2stats_api/
exclude: ^space2stats/env/

- repo: local
hooks:
- id: pytest
name: Run pytest
entry: bash -c 'PYTHONPATH=space2stats_api python -m pytest space2stats_api'
language: system
pass_filenames: false
always_run: true
12 changes: 1 addition & 11 deletions space2stats_api/app/settings.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import os

from pydantic_settings import BaseSettings, SettingsConfigDict


current_directory = os.getcwd()
env_file_name = 'local_db.env'

if os.path.basename(current_directory) == "space2stats_api":
env_path = os.path.join(current_directory, '..', env_file_name)
else:
env_path = os.path.join(current_directory, env_file_name)

class Settings(BaseSettings):
DB_HOST: str
DB_PORT: int
Expand All @@ -19,7 +9,7 @@ class Settings(BaseSettings):
DB_PASSWORD: str
DB_TABLE_NAME: str

model_config = SettingsConfigDict(env_file=env_path)
model_config = SettingsConfigDict(env_file='../db.env')


settings = Settings()

0 comments on commit f9eeb58

Please sign in to comment.