Browse Source

Add environ module and stubs

Getty Ritter 1 year ago
parent
commit
619fc7cacb
3 changed files with 30 additions and 2 deletions
  1. 22 2
      poetry.lock
  2. 1 0
      pyproject.toml
  3. 7 0
      stubs/environ.py

+ 22 - 2
poetry.lock

@@ -16,7 +16,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
 version = "1.3.0"
 
 [[package]]
-category = "dev"
+category = "main"
 description = "Classes Without Boilerplate"
 name = "attrs"
 optional = false
@@ -99,6 +99,22 @@ typing-inspect = ">=0.4.0"
 [package.extras]
 dev = ["pytest", "ipython", "mypy (>=0.710)", "hypothesis", "portray", "flake8", "simplejson"]
 
+[[package]]
+category = "main"
+description = "Boilerplate-free configuration with env variables."
+name = "environ-config"
+optional = false
+python-versions = "*"
+version = "20.1.0"
+
+[package.dependencies]
+attrs = ">=17.4.0"
+
+[package.extras]
+dev = ["pytest", "coverage", "sphinx", "sphinx-rtd-theme", "pre-commit"]
+docs = ["sphinx", "sphinx-rtd-theme"]
+tests = ["pytest", "coverage"]
+
 [[package]]
 category = "main"
 description = "A simple framework for building complex web applications."
@@ -440,7 +456,7 @@ dev = ["pytest", "pytest-timeout", "coverage", "tox", "sphinx", "pallets-sphinx-
 watchdog = ["watchdog"]
 
 [metadata]
-content-hash = "199d426c3947fdf20a0945d853d9eaad79d800e6053dc4fd10228c28b21a9457"
+content-hash = "f40a6c27fd58db00cd96ef01da21d52516a783004dcd49d72787d734218dd8a9"
 python-versions = "^3.8"
 
 [metadata.files]
@@ -480,6 +496,10 @@ dataclasses-json = [
     {file = "dataclasses-json-0.4.2.tar.gz", hash = "sha256:65ac9ae2f7ec152ee01bf42c8c024736d4cd6f6fb761502dec92bd553931e3d9"},
     {file = "dataclasses_json-0.4.2-py3-none-any.whl", hash = "sha256:dbb53ebbac30ef45f44f5f436b21bd5726a80a14e1a193958864229100271372"},
 ]
+environ-config = [
+    {file = "environ-config-20.1.0.tar.gz", hash = "sha256:3167feda073bd3cd3457a3e5fa7c2836b6574c046cd0dcd79385ce3284e837bd"},
+    {file = "environ_config-20.1.0-py2.py3-none-any.whl", hash = "sha256:0e300307520c1e6a5424018b7f70246a2c7f4cb5cc5cbbebccc6a982eb1767cb"},
+]
 flask = [
     {file = "Flask-1.1.2-py2.py3-none-any.whl", hash = "sha256:8a4fdd8936eba2512e9c85df320a37e694c93945b33ef33c89946a340a238557"},
     {file = "Flask-1.1.2.tar.gz", hash = "sha256:4efa1ae2d7c9865af48986de8aeb8504bf32c7f3d6fdc9353d34b21f4b127060"},

+ 1 - 0
pyproject.toml

@@ -12,6 +12,7 @@ pystache = "^0.5.4"
 dataclasses-json = "^0.4.2"
 passlib = "^1.7.2"
 itsdangerous = "^1.1.0"
+environ-config = "^20.1.0"
 
 [tool.poetry.dev-dependencies]
 pytest = "^5.4.1"

+ 7 - 0
stubs/environ.py

@@ -0,0 +1,7 @@
+from typing import Any, TypeVar, Type
+
+T = TypeVar("T")
+
+def config(prefix: str) -> Any: pass
+def var(default: str="") -> str: pass
+def to_config(klass: Type[T]) -> T: pass