lenapi 0.1.4.9__tar.gz → 0.1.4.10__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.
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/PKG-INFO +4 -4
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/README.md +3 -3
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/__init__.py +1 -1
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/cli.py +2 -3
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi.egg-info/PKG-INFO +4 -4
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi_bootstrap.py +17 -3
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/pyproject.toml +1 -1
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/LICENSE +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/admin.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/application.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/auth.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/authentication.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/authorization.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/background.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/concurrency.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/database.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/dependencies.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/docs_guard.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/graphql.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/logging.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/middleware.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/migration_render.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/model.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/models.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/mongodb.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/openapi.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/parameters.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/project.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/request.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/response.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/security.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/security_store.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/sentinels.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/service.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/signals.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/soap.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/throttling.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi/transaction.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi.egg-info/SOURCES.txt +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi.egg-info/dependency_links.txt +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi.egg-info/entry_points.txt +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi.egg-info/requires.txt +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/lenapi.egg-info/top_level.txt +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/setup.cfg +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_admin_console.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_cli_settings_recovery.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_docs_guard.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_framework_features.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_media_upload.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_migration_render.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_mongodb.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_optional_protocols.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_platform_services.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_project_isolation.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_security_patch.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_sentinels.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_signals_and_deployment.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_throttle.py +0 -0
- {lenapi-0.1.4.9 → lenapi-0.1.4.10}/tests/test_user_model_extension.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lenapi
|
|
3
|
-
Version: 0.1.4.
|
|
3
|
+
Version: 0.1.4.10
|
|
4
4
|
Summary: A modern ASGI framework with Pydantic validation, sync and async database access, WebSockets, authentication, and integrated API documentation.
|
|
5
5
|
Author: Maekandex Communication Limitation
|
|
6
6
|
Author-email: "Ifeanyi M. Onovo" <ifeanyi@maekandex.com.ng>
|
|
@@ -611,7 +611,7 @@ python lenora.py run
|
|
|
611
611
|
|
|
612
612
|
Use the installed `lenora` command to create the first project; `python lenora.py ...` commands are available after entering the generated project. The server listens on `127.0.0.1:8009` by default. The generated application contains `app/models.py`, `app/schemas.py`, `settings.py`, `main.py`, a `tests/` package, a project-local CLI launcher, `alembic.ini`, and a `migrations/` folder. The default `User` model and authentication implementation live in the framework. The initial migration includes the framework's `User` table automatically. `LENAPI()` sets up `app.authenticator` from `settings.AUTHENTICATION`, but route protection is opt-in: pass an authenticator to `LENAPI(auth=...)`, `Router(auth=...)`, or a route's `auth=` parameter. This keeps login and registration routes public unless you protect them too. The framework repository contains the installable `lenapi` package; create an application scaffold separately with `lenora startproject`.
|
|
613
613
|
|
|
614
|
-
Generated `main.py`
|
|
614
|
+
Generated `main.py` calls the framework's `create_app()` before importing project models or routers. LenAPI discovers the calling project module, loads its settings, and sets `PROJECT_NAMESPACE` before SQLAlchemy declares model tables. The generated app can run directly with Uvicorn, for example `uvicorn main:app --host 0.0.0.0 --port 8010`.
|
|
615
615
|
|
|
616
616
|
If `settings.py` is accidentally deleted, run `python lenora.py repair-settings` from the project directory. It recreates the generated defaults only when the file is missing and refuses to overwrite an existing settings file. The recreated file gets fresh `SECRET_KEY` and `API_KEY` values; review it before starting the app. The old `SECRET_KEY` cannot be recovered, so tokens signed with that key will no longer validate.
|
|
617
617
|
|
|
@@ -1177,9 +1177,9 @@ For example, a custom model with `email` and a hashed `password` can sign in usi
|
|
|
1177
1177
|
|
|
1178
1178
|
```python
|
|
1179
1179
|
from lenapi_bootstrap import create_app
|
|
1180
|
-
from lenapi import Depends, authentication
|
|
1181
1180
|
|
|
1182
|
-
app = create_app(
|
|
1181
|
+
app = create_app()
|
|
1182
|
+
from lenapi import Depends, authentication
|
|
1183
1183
|
from app.models import Customer
|
|
1184
1184
|
auth = authentication(
|
|
1185
1185
|
"jwt",
|
|
@@ -555,7 +555,7 @@ python lenora.py run
|
|
|
555
555
|
|
|
556
556
|
Use the installed `lenora` command to create the first project; `python lenora.py ...` commands are available after entering the generated project. The server listens on `127.0.0.1:8009` by default. The generated application contains `app/models.py`, `app/schemas.py`, `settings.py`, `main.py`, a `tests/` package, a project-local CLI launcher, `alembic.ini`, and a `migrations/` folder. The default `User` model and authentication implementation live in the framework. The initial migration includes the framework's `User` table automatically. `LENAPI()` sets up `app.authenticator` from `settings.AUTHENTICATION`, but route protection is opt-in: pass an authenticator to `LENAPI(auth=...)`, `Router(auth=...)`, or a route's `auth=` parameter. This keeps login and registration routes public unless you protect them too. The framework repository contains the installable `lenapi` package; create an application scaffold separately with `lenora startproject`.
|
|
557
557
|
|
|
558
|
-
Generated `main.py`
|
|
558
|
+
Generated `main.py` calls the framework's `create_app()` before importing project models or routers. LenAPI discovers the calling project module, loads its settings, and sets `PROJECT_NAMESPACE` before SQLAlchemy declares model tables. The generated app can run directly with Uvicorn, for example `uvicorn main:app --host 0.0.0.0 --port 8010`.
|
|
559
559
|
|
|
560
560
|
If `settings.py` is accidentally deleted, run `python lenora.py repair-settings` from the project directory. It recreates the generated defaults only when the file is missing and refuses to overwrite an existing settings file. The recreated file gets fresh `SECRET_KEY` and `API_KEY` values; review it before starting the app. The old `SECRET_KEY` cannot be recovered, so tokens signed with that key will no longer validate.
|
|
561
561
|
|
|
@@ -1121,9 +1121,9 @@ For example, a custom model with `email` and a hashed `password` can sign in usi
|
|
|
1121
1121
|
|
|
1122
1122
|
```python
|
|
1123
1123
|
from lenapi_bootstrap import create_app
|
|
1124
|
-
from lenapi import Depends, authentication
|
|
1125
1124
|
|
|
1126
|
-
app = create_app(
|
|
1125
|
+
app = create_app()
|
|
1126
|
+
from lenapi import Depends, authentication
|
|
1127
1127
|
from app.models import Customer
|
|
1128
1128
|
auth = authentication(
|
|
1129
1129
|
"jwt",
|
|
@@ -123,9 +123,8 @@ TOKEN = {
|
|
|
123
123
|
|
|
124
124
|
from lenapi_bootstrap import create_app
|
|
125
125
|
|
|
126
|
-
#
|
|
127
|
-
|
|
128
|
-
app = create_app(__file__, __package__)
|
|
126
|
+
# LenAPI discovers this project's settings and namespace before loading models.
|
|
127
|
+
app = create_app()
|
|
129
128
|
|
|
130
129
|
|
|
131
130
|
@app.get("/")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lenapi
|
|
3
|
-
Version: 0.1.4.
|
|
3
|
+
Version: 0.1.4.10
|
|
4
4
|
Summary: A modern ASGI framework with Pydantic validation, sync and async database access, WebSockets, authentication, and integrated API documentation.
|
|
5
5
|
Author: Maekandex Communication Limitation
|
|
6
6
|
Author-email: "Ifeanyi M. Onovo" <ifeanyi@maekandex.com.ng>
|
|
@@ -611,7 +611,7 @@ python lenora.py run
|
|
|
611
611
|
|
|
612
612
|
Use the installed `lenora` command to create the first project; `python lenora.py ...` commands are available after entering the generated project. The server listens on `127.0.0.1:8009` by default. The generated application contains `app/models.py`, `app/schemas.py`, `settings.py`, `main.py`, a `tests/` package, a project-local CLI launcher, `alembic.ini`, and a `migrations/` folder. The default `User` model and authentication implementation live in the framework. The initial migration includes the framework's `User` table automatically. `LENAPI()` sets up `app.authenticator` from `settings.AUTHENTICATION`, but route protection is opt-in: pass an authenticator to `LENAPI(auth=...)`, `Router(auth=...)`, or a route's `auth=` parameter. This keeps login and registration routes public unless you protect them too. The framework repository contains the installable `lenapi` package; create an application scaffold separately with `lenora startproject`.
|
|
613
613
|
|
|
614
|
-
Generated `main.py`
|
|
614
|
+
Generated `main.py` calls the framework's `create_app()` before importing project models or routers. LenAPI discovers the calling project module, loads its settings, and sets `PROJECT_NAMESPACE` before SQLAlchemy declares model tables. The generated app can run directly with Uvicorn, for example `uvicorn main:app --host 0.0.0.0 --port 8010`.
|
|
615
615
|
|
|
616
616
|
If `settings.py` is accidentally deleted, run `python lenora.py repair-settings` from the project directory. It recreates the generated defaults only when the file is missing and refuses to overwrite an existing settings file. The recreated file gets fresh `SECRET_KEY` and `API_KEY` values; review it before starting the app. The old `SECRET_KEY` cannot be recovered, so tokens signed with that key will no longer validate.
|
|
617
617
|
|
|
@@ -1177,9 +1177,9 @@ For example, a custom model with `email` and a hashed `password` can sign in usi
|
|
|
1177
1177
|
|
|
1178
1178
|
```python
|
|
1179
1179
|
from lenapi_bootstrap import create_app
|
|
1180
|
-
from lenapi import Depends, authentication
|
|
1181
1180
|
|
|
1182
|
-
app = create_app(
|
|
1181
|
+
app = create_app()
|
|
1182
|
+
from lenapi import Depends, authentication
|
|
1183
1183
|
from app.models import Customer
|
|
1184
1184
|
auth = authentication(
|
|
1185
1185
|
"jwt",
|
|
@@ -8,6 +8,7 @@ from __future__ import annotations
|
|
|
8
8
|
|
|
9
9
|
import importlib
|
|
10
10
|
import importlib.util
|
|
11
|
+
import inspect
|
|
11
12
|
import os
|
|
12
13
|
import re
|
|
13
14
|
import sys
|
|
@@ -53,13 +54,26 @@ def configure_project(source_file: str, package: str | None = None):
|
|
|
53
54
|
return settings
|
|
54
55
|
|
|
55
56
|
|
|
56
|
-
def create_app(source_file: str, package: str | None = None):
|
|
57
|
+
def create_app(source_file: str | None = None, package: str | None = None):
|
|
57
58
|
"""Create a configured app and import project models under its namespace.
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
Generated projects can call this without arguments from ``main.py``; the
|
|
61
|
+
framework infers that module's path and package. Explicit arguments remain
|
|
62
|
+
supported for applications that create the app from another module. Call
|
|
63
|
+
this before importing application routers or models so Uvicorn can load
|
|
61
64
|
``main:app`` directly without the ``lenora`` launcher.
|
|
62
65
|
"""
|
|
66
|
+
if source_file is None:
|
|
67
|
+
caller = inspect.currentframe().f_back
|
|
68
|
+
if caller is None or not caller.f_globals.get("__file__"):
|
|
69
|
+
raise RuntimeError(
|
|
70
|
+
"create_app() could not locate the calling project module; "
|
|
71
|
+
"pass its __file__ and __package__ explicitly"
|
|
72
|
+
)
|
|
73
|
+
source_file = caller.f_globals["__file__"]
|
|
74
|
+
if package is None:
|
|
75
|
+
package = caller.f_globals.get("__package__")
|
|
76
|
+
|
|
63
77
|
settings = configure_project(source_file, package)
|
|
64
78
|
model_module = f"{package}.app.models" if package else "app.models"
|
|
65
79
|
importlib.import_module(model_module)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "lenapi"
|
|
7
|
-
version = "0.1.4.
|
|
7
|
+
version = "0.1.4.10"
|
|
8
8
|
description = "A modern ASGI framework with Pydantic validation, sync and async database access, WebSockets, authentication, and integrated API documentation."
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Ifeanyi M. Onovo", email = "ifeanyi@maekandex.com.ng"},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|