cuneus 0.2.3__tar.gz → 0.2.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cuneus
3
- Version: 0.2.3
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,6 +1,6 @@
1
1
  [project]
2
2
  name = "cuneus"
3
- version = "0.2.3"
3
+ version = "0.2.4"
4
4
  description = "ASGI application wrapper"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Robert Myers", email = "robert@julython.org" }]
@@ -13,9 +13,16 @@ from .core.settings import Settings
13
13
 
14
14
  def import_from_string(import_str: str) -> Any:
15
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
+
16
21
  module_path, _, attr = import_str.partition(":")
17
22
  if not attr:
18
- attr = "app" # default attribute name
23
+ raise ValueError(
24
+ f"module_path missing function {import_str} expecting 'module.path:name'"
25
+ )
19
26
 
20
27
  module = importlib.import_module(module_path)
21
28
  return getattr(module, attr)
@@ -40,10 +47,6 @@ def get_user_cli() -> click.Group | None:
40
47
  def cli(ctx: click.Context) -> None:
41
48
  """Cuneus CLI - FastAPI application framework."""
42
49
  ctx.ensure_object(dict)
43
- # Ensure cwd is in path for local imports
44
- cwd = str(Path.cwd())
45
- if cwd not in sys.path:
46
- sys.path.insert(0, cwd)
47
50
 
48
51
 
49
52
  @cli.command()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes