kodit 0.1.1__py3-none-any.whl → 0.1.3__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.
Potentially problematic release.
This version of kodit might be problematic. Click here for more details.
- kodit/_version.py +2 -2
- kodit/alembic/env.py +3 -0
- kodit/config.py +5 -0
- kodit/database.py +6 -2
- kodit/sources/service.py +2 -1
- {kodit-0.1.1.dist-info → kodit-0.1.3.dist-info}/METADATA +1 -1
- {kodit-0.1.1.dist-info → kodit-0.1.3.dist-info}/RECORD +10 -9
- {kodit-0.1.1.dist-info → kodit-0.1.3.dist-info}/WHEEL +0 -0
- {kodit-0.1.1.dist-info → kodit-0.1.3.dist-info}/entry_points.txt +0 -0
- {kodit-0.1.1.dist-info → kodit-0.1.3.dist-info}/licenses/LICENSE +0 -0
kodit/_version.py
CHANGED
kodit/alembic/env.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import asyncio
|
|
5
5
|
|
|
6
|
+
import structlog
|
|
6
7
|
from alembic import context
|
|
7
8
|
from sqlalchemy import pool
|
|
8
9
|
from sqlalchemy.engine import Connection
|
|
@@ -65,6 +66,8 @@ async def run_async_migrations() -> None:
|
|
|
65
66
|
prefix="sqlalchemy.",
|
|
66
67
|
poolclass=pool.NullPool,
|
|
67
68
|
)
|
|
69
|
+
log = structlog.get_logger(__name__)
|
|
70
|
+
log.debug("Running migrations on %s", connectable.url)
|
|
68
71
|
|
|
69
72
|
async with connectable.connect() as connection:
|
|
70
73
|
await connection.run_sync(do_run_migrations)
|
kodit/config.py
ADDED
kodit/database.py
CHANGED
|
@@ -18,8 +18,10 @@ from sqlalchemy.ext.asyncio import (
|
|
|
18
18
|
)
|
|
19
19
|
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
|
20
20
|
|
|
21
|
+
from kodit import alembic
|
|
22
|
+
from kodit.config import DATA_DIR
|
|
23
|
+
|
|
21
24
|
# Constants
|
|
22
|
-
DATA_DIR = Path.cwd() / ".kodit"
|
|
23
25
|
DB_URL = f"sqlite+aiosqlite:///{DATA_DIR}/kodit.db"
|
|
24
26
|
|
|
25
27
|
# Create data directory if it doesn't exist
|
|
@@ -81,5 +83,7 @@ def with_session(func: Callable[..., T]) -> Callable[..., T]:
|
|
|
81
83
|
def configure_database() -> None:
|
|
82
84
|
"""Configure the database by initializing it and running any pending migrations."""
|
|
83
85
|
# Create Alembic configuration and run migrations
|
|
84
|
-
alembic_cfg = Config(
|
|
86
|
+
alembic_cfg = Config()
|
|
87
|
+
alembic_cfg.set_main_option("script_location", str(Path(alembic.__file__).parent))
|
|
88
|
+
alembic_cfg.set_main_option("sqlalchemy.url", DB_URL)
|
|
85
89
|
command.upgrade(alembic_cfg, "head")
|
kodit/sources/service.py
CHANGED
|
@@ -18,10 +18,11 @@ import structlog
|
|
|
18
18
|
from tqdm import tqdm
|
|
19
19
|
from uritools import isuri, urisplit
|
|
20
20
|
|
|
21
|
+
from kodit.config import DATA_DIR
|
|
21
22
|
from kodit.sources.models import File, Source
|
|
22
23
|
from kodit.sources.repository import SourceRepository
|
|
23
24
|
|
|
24
|
-
CLONE_DIR =
|
|
25
|
+
CLONE_DIR = DATA_DIR / "clones"
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
class SourceView(pydantic.BaseModel):
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
kodit/.gitignore,sha256=ztkjgRwL9Uud1OEi36hGQeDGk3OLK1NfDEO8YqGYy8o,11
|
|
2
2
|
kodit/__init__.py,sha256=aEKHYninUq1yh6jaNfvJBYg-6fenpN132nJt1UU6Jxs,59
|
|
3
|
-
kodit/_version.py,sha256=
|
|
3
|
+
kodit/_version.py,sha256=NIzzV8ZM0W-CSLuEs1weG4zPrn_-8yr1AwwI1iuS6yo,511
|
|
4
4
|
kodit/app.py,sha256=FBAeeOz2CICvVN_27iMq9wEF9y8d1IDl0WmkEnM_M_U,699
|
|
5
5
|
kodit/cli.py,sha256=2hNz05I6vryhkGqwMXlg_GKVAzhMmS_v8H2Nl6oxBZ4,5696
|
|
6
|
-
kodit/
|
|
6
|
+
kodit/config.py,sha256=Wq9MlxOnOA3p9mgIzsq-s7N57_GFVIOMML-4GFINmqE,104
|
|
7
|
+
kodit/database.py,sha256=ndStVWzR5XAiZ1JBu_NE4Nv-KLEZ3GQVLVjPIUmiRA4,2457
|
|
7
8
|
kodit/logging.py,sha256=dQr4YXVH8_B52V0wXbBrn_HvH4QpO-fsi0C3JPWzn0Y,5022
|
|
8
9
|
kodit/mcp.py,sha256=Sg7Waes9Z7HYzdglspG92dGhTVtb1lEaEKW-vlaUCXg,1488
|
|
9
10
|
kodit/middleware.py,sha256=NHLrqq20ZtPTE9esX9HD3z7EKi56_QTFxBlkdq0JDzQ,2138
|
|
10
11
|
kodit/sse.py,sha256=UgwXJUeFq5D5S9KYKVVg4m6P0-_QHnJOCRRQB8XNR-M,2259
|
|
11
12
|
kodit/alembic/README,sha256=ISVtAOvqvKk_5ThM5ioJE-lMkvf9IbknFUFVU_vPma4,58
|
|
12
13
|
kodit/alembic/__init__.py,sha256=lP5MuwlyWRMO6UcDWnQcQ3G-GYHcFb6rl9gYPHJ1sjo,40
|
|
13
|
-
kodit/alembic/env.py,sha256=
|
|
14
|
+
kodit/alembic/env.py,sha256=WnmwmN6wKEThI17b-VPDkRq-nKfmaT6nRLabc2VM1oM,2390
|
|
14
15
|
kodit/alembic/script.py.mako,sha256=zWziKtiwYKEWuwPV_HBNHwa9LCT45_bi01-uSNFaOOE,703
|
|
15
16
|
kodit/alembic/versions/85155663351e_initial.py,sha256=Cg7zlF871o9ShV5rQMQ1v7hRV7fI59veDY9cjtTrs-8,3306
|
|
16
17
|
kodit/alembic/versions/__init__.py,sha256=9-lHzptItTzq_fomdIRBegQNm4Znx6pVjwD4MiqRIdo,36
|
|
@@ -24,9 +25,9 @@ kodit/retreival/service.py,sha256=Iy9IBLhohQmypeOs0hDEjgr1hsr0xtaiMqjIzykFWrY,72
|
|
|
24
25
|
kodit/sources/__init__.py,sha256=1NTZyPdjThVQpZO1Mp1ColVsS7sqYanOVLqnoqV9Ipo,83
|
|
25
26
|
kodit/sources/models.py,sha256=xb42CaNDO1CUB8SIW-xXMrB6Ji8cFw-yeJ550xBEg9Q,2398
|
|
26
27
|
kodit/sources/repository.py,sha256=mGJrHWH6Uo8YABdoojHFbzaf_jW-2ywJpAHIa1gnc3U,3401
|
|
27
|
-
kodit/sources/service.py,sha256=
|
|
28
|
-
kodit-0.1.
|
|
29
|
-
kodit-0.1.
|
|
30
|
-
kodit-0.1.
|
|
31
|
-
kodit-0.1.
|
|
32
|
-
kodit-0.1.
|
|
28
|
+
kodit/sources/service.py,sha256=khrz3UH6hNTYwXMFosGc46trcb8Sm0dTPwvptbgRgwM,6722
|
|
29
|
+
kodit-0.1.3.dist-info/METADATA,sha256=1Q0EP_fo9liqZoW_3QGXMphCj05jtgYxfIwMb4o4e5c,2019
|
|
30
|
+
kodit-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
31
|
+
kodit-0.1.3.dist-info/entry_points.txt,sha256=hoTn-1aKyTItjnY91fnO-rV5uaWQLQ-Vi7V5et2IbHY,40
|
|
32
|
+
kodit-0.1.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
33
|
+
kodit-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|