cuneus 0.2.2__py3-none-any.whl → 0.2.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cuneus/cli.py CHANGED
@@ -1,18 +1,28 @@
1
1
  """Base CLI that cuneus provides."""
2
2
 
3
- import click
3
+ from pathlib import Path
4
+
4
5
  import importlib
5
6
  import sys
6
7
  from typing import Any, cast
7
8
 
9
+ import click
10
+
8
11
  from .core.settings import Settings
9
12
 
10
13
 
11
14
  def import_from_string(import_str: str) -> Any:
12
15
  """Import an object from a module:attribute string."""
16
+ # Ensure cwd is in path for local imports
17
+ cwd = str(Path.cwd())
18
+ if cwd not in sys.path:
19
+ sys.path.insert(0, cwd)
20
+
13
21
  module_path, _, attr = import_str.partition(":")
14
22
  if not attr:
15
- attr = "app" # default attribute name
23
+ raise ValueError(
24
+ f"module_path missing function {import_str} expecting 'module.path:name'"
25
+ )
16
26
 
17
27
  module = importlib.import_module(module_path)
18
28
  return getattr(module, attr)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cuneus
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: ASGI application wrapper
5
5
  Project-URL: Homepage, https://github.com/rmyers/cuneus
6
6
  Project-URL: Documentation, https://github.com/rmyers/cuneus#readme
@@ -1,5 +1,5 @@
1
1
  cuneus/__init__.py,sha256=JJ3nZ4757GU9KKuurxP1FfJSdSVrcO-xaorLFSvUJ5E,1211
2
- cuneus/cli.py,sha256=pdtoGmjn8NFuOcxaqAlBJfrkLOZI9fS0NEWo5WVSaUo,3480
2
+ cuneus/cli.py,sha256=NHk_hI_KtXPQ0EXCCfottDwOFrSG6vcYSZPrzuzyZk8,3715
3
3
  cuneus/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  cuneus/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  cuneus/core/application.py,sha256=MlVjGWjuKGut5YaIP8BdjuCXFi-tpCwhL4g6N5NRL4U,3773
@@ -9,7 +9,7 @@ cuneus/core/logging.py,sha256=OlcWxBCLDqBORzTXZXKlMc_rGD8OkfOBfHgSwEpMCM4,6778
9
9
  cuneus/core/settings.py,sha256=PaYXQ_ubeSt3AFpxNNErii-h1_ehHYPrajFWRT42mTI,1703
10
10
  cuneus/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  cuneus/ext/health.py,sha256=5dWVVEPFL1tWFBhQwZv8C-IvZRzg28V-4sk_g1jJ0vc,3854
12
- cuneus-0.2.2.dist-info/METADATA,sha256=ItNul_KF_Lgjh2zU9cCm4SAqSdAR-Nqe7XDyGsQhB08,6794
13
- cuneus-0.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
- cuneus-0.2.2.dist-info/entry_points.txt,sha256=tzPgom-_UkpP_uLKv3V_XyoIsKg84FBAc9ddjYl0W0Y,43
15
- cuneus-0.2.2.dist-info/RECORD,,
12
+ cuneus-0.2.4.dist-info/METADATA,sha256=fEVHe2gl-LA__d3Q9wqdmHwU6SdlS3FLJxBrrou7wpU,6794
13
+ cuneus-0.2.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
+ cuneus-0.2.4.dist-info/entry_points.txt,sha256=tzPgom-_UkpP_uLKv3V_XyoIsKg84FBAc9ddjYl0W0Y,43
15
+ cuneus-0.2.4.dist-info/RECORD,,
File without changes