Add a config object

- add the following file:
  + src/urban_meal_delivery/_config.py
- a config module is created holding two sets of configurations:
  + production => against the real database
  + testing => against a database with test data
- the module is "protected" (i.e., underscore) and imported at the
  top level via a proxy-like object `config` that detects in which of
  the two environments the package is being run
This commit is contained in:
Alexander Hess 2020-08-08 14:43:02 +02:00
commit 9456f86d65
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
7 changed files with 170 additions and 3 deletions

View file

@ -109,6 +109,11 @@ per-file-ignores =
WPS213,
# No overuse of string constants (e.g., '--version').
WPS226,
src/urban_meal_delivery/_config.py:
# Allow upper case class variables within classes.
WPS115,
# Numbers are normal in config files.
WPS432,
tests/*.py:
# Type annotations are not strictly enforced.
ANN0, ANN2,
@ -135,10 +140,10 @@ show-source = true
# wemake-python-styleguide's settings
# ===================================
allowed-domain-names =
obj,
param,
result,
value,
min-name-length = 3
max-name-length = 40
# darglint
strictness = long
@ -186,7 +191,13 @@ single_line_exclusions = typing
[mypy]
cache_dir = .cache/mypy
[mypy-nox.*,packaging,pytest]
[mypy-dotenv]
ignore_missing_imports = true
[mypy-nox.*]
ignore_missing_imports = true
[mypy-packaging]
ignore_missing_imports = true
[mypy-pytest]
ignore_missing_imports = true