cuneus 0.2.2__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.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,6 +1,6 @@
1
1
  [project]
2
2
  name = "cuneus"
3
- version = "0.2.2"
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" }]
@@ -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)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes