diff --git a/.env.sample b/.env.sample index ee036db..aa26934 100644 --- a/.env.sample +++ b/.env.sample @@ -1,4 +1,7 @@ TEST_ENVIRONMENT=False +DJANGO_DEBUG=True +DJANGO_ALLOWED_HOSTS=localhost +DJANGO_SECRET_KEY= LITELLM_MASTER_KEY= LITELLM_API_KEY= diff --git a/Makefile b/Makefile index 233ab62..e17da72 100644 --- a/Makefile +++ b/Makefile @@ -81,4 +81,13 @@ help: @python -c "${PRINT_HELP_PYSCRIPT}" < $(MAKEFILE_LIST) api: - fastapi dev labs/api/main.py + fastapi dev labs/api/main.py + +runserver: + poetry run python manage.py runserver + +asgi_api: + poetry run uvicorn asgi_app:app --reload --port 8000 + +load_fixtures: + python manage.py loaddata $(wildcard config/fixtures/*.json) diff --git a/asgi_app.py b/asgi_app.py new file mode 100644 index 0000000..37ebeda --- /dev/null +++ b/asgi_app.py @@ -0,0 +1,28 @@ +import os +import django +from fastapi import FastAPI +from django.core.asgi import get_asgi_application +from labs.api import codemonkey_endpoints, github_endpoints + +# Set the DJANGO_SETTINGS_MODULE environment variable to point to your Django project's settings +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") + +# Initialize Django settings +django.setup() + +# Load Django ASGI application +django_app = get_asgi_application() + +# Create FastAPI app +fastapi_app = FastAPI() + +# include codemonkey and github into fastapi +fastapi_app.include_router(codemonkey_endpoints.router) +fastapi_app.include_router(github_endpoints.router) + +# ASGI application to route to Django or FastAPI +async def app(scope, receive, send): + if scope["type"] == "http" and scope["path"].startswith("/admin"): + await django_app(scope, receive, send) + else: + await fastapi_app(scope, receive, send) diff --git a/labs/config/__init__.py b/config/__init__.py similarity index 100% rename from labs/config/__init__.py rename to config/__init__.py diff --git a/config/admin.py b/config/admin.py new file mode 100644 index 0000000..e2cbd44 --- /dev/null +++ b/config/admin.py @@ -0,0 +1,7 @@ +from django.contrib import admin +from .models import Config + +@admin.register(Config) +class ConfigAdmin(admin.ModelAdmin): + list_display = ('llm_model', 'key', 'value', 'type', 'created_at', 'updated_at') + search_fields = (['key', 'llm_model']) diff --git a/config/asgi.py b/config/asgi.py new file mode 100644 index 0000000..19b90e3 --- /dev/null +++ b/config/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for config project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") + +application = get_asgi_application() diff --git a/labs/config/settings.py b/config/configuration_variables.py similarity index 100% rename from labs/config/settings.py rename to config/configuration_variables.py diff --git a/labs/config/litellm.yaml b/config/litellm.yaml similarity index 100% rename from labs/config/litellm.yaml rename to config/litellm.yaml diff --git a/config/migrations/0001_initial.py b/config/migrations/0001_initial.py new file mode 100644 index 0000000..58ea254 --- /dev/null +++ b/config/migrations/0001_initial.py @@ -0,0 +1,42 @@ +# Generated by Django 5.1.2 on 2024-10-18 14:13 + +import django.utils.timezone +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [] + + operations = [ + migrations.CreateModel( + name="Config", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("llm_model", models.TextField(blank=True, null=True)), + ("key", models.TextField(unique=True)), + ("value", models.TextField(blank=True, null=True)), + ("type", models.TextField(blank=True, null=True)), + ("created_at", models.DateTimeField(default=django.utils.timezone.now)), + ("updated_at", models.DateTimeField(auto_now=True)), + ], + options={ + "indexes": [ + models.Index( + fields=["key", "llm_model"], + name="config_conf_config__4d9363_idx", + ) + ], + }, + ), + ] diff --git a/config/migrations/__init__.py b/config/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/config/models/__init__.py b/config/models/__init__.py new file mode 100644 index 0000000..887253a --- /dev/null +++ b/config/models/__init__.py @@ -0,0 +1 @@ +from .config import Config as Config diff --git a/config/models/config.py b/config/models/config.py new file mode 100644 index 0000000..0e6f824 --- /dev/null +++ b/config/models/config.py @@ -0,0 +1,18 @@ +from django.db import models +from django.utils import timezone + +class Config(models.Model): + llm_model = models.TextField(blank=True, null=True) + key = models.TextField(unique=True) + value = models.TextField(blank=True, null=True) + type = models.TextField(blank=True, null=True) + created_at = models.DateTimeField(default=timezone.now) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return f"{self.key}: {self.value}" + + class Meta: + indexes = [ + models.Index(fields=['key', 'llm_model']) + ] diff --git a/config/settings.py b/config/settings.py new file mode 100644 index 0000000..c024b3f --- /dev/null +++ b/config/settings.py @@ -0,0 +1,127 @@ +""" +Django settings for config project. + +Generated by 'django-admin startproject' using Django 5.1.2. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/ref/settings/ +""" +import os +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', '') + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = os.environ.get('DJANGO_DEBUG', "True") == "True" + +ALLOWED_HOSTS = [s.strip() for s in os.environ.get("DJANGO_ALLOWED_HOSTS", []).split(",")] + + +# Application definition + +INSTALLED_APPS = [ + "config", + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", +] + +MIDDLEWARE = [ + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", +] + +ROOT_URLCONF = "config.urls" + +TEMPLATES = [ + { + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", + ], + }, + }, +] + +WSGI_APPLICATION = "config.wsgi.application" + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + "default": { + "ENGINE": "django.db.backends.postgresql", + "NAME": os.environ.get("DATABASE_NAME", "postgres"), + "USER": os.environ.get("DATABASE_USER", "postgres"), + "PASSWORD": os.environ.get("DATABASE_PASS", "postgres"), + "HOST": os.environ.get("DATABASE_HOST", "localhost"), + "PORT": os.environ.get("DATABASE_PORT", "5432"), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/5.1/topics/i18n/ + +LANGUAGE_CODE = "en-us" + +TIME_ZONE = "UTC" + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.1/howto/static-files/ + +STATIC_URL = "static/" + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/config/urls.py b/config/urls.py new file mode 100644 index 0000000..0db52d5 --- /dev/null +++ b/config/urls.py @@ -0,0 +1,22 @@ +""" +URL configuration for config project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path("admin/", admin.site.urls), +] diff --git a/config/wsgi.py b/config/wsgi.py new file mode 100644 index 0000000..b2bb19f --- /dev/null +++ b/config/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for config project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") + +application = get_wsgi_application() diff --git a/labs/celery.py b/labs/celery.py index 6eb3acc..67f61c8 100644 --- a/labs/celery.py +++ b/labs/celery.py @@ -3,7 +3,7 @@ from kombu import Queue from redbeat import RedBeatSchedulerEntry, schedulers import redis -from labs.config import settings +from config import configuration_variables as settings import logging @@ -14,7 +14,9 @@ LOW_PRIORITY_QUEUE_NAME = f"{CELERY_QUEUE_PREFIX}-low" HIGH_PRIORITY_QUEUE_NAME = f"{CELERY_QUEUE_PREFIX}-high" -redis_client = redis.StrictRedis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=0, decode_responses=True) +redis_client = redis.StrictRedis( + host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=0, decode_responses=True +) app = Celery( diff --git a/labs/database/connect.py b/labs/database/connect.py index ddfdca3..e805c7c 100644 --- a/labs/database/connect.py +++ b/labs/database/connect.py @@ -1,4 +1,4 @@ -from labs.config import settings +from config import configuration_variables as settings from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker, declarative_base import logging diff --git a/labs/database/vectorize/chunk_vectorizer.py b/labs/database/vectorize/chunk_vectorizer.py index 65e18f4..36540bf 100644 --- a/labs/database/vectorize/chunk_vectorizer.py +++ b/labs/database/vectorize/chunk_vectorizer.py @@ -9,7 +9,7 @@ import logging -from labs.config import settings +from config import configuration_variables as settings from labs.database.embeddings import reembed_code diff --git a/labs/database/vectorize/python_vectorizer.py b/labs/database/vectorize/python_vectorizer.py index c3b7079..b134542 100644 --- a/labs/database/vectorize/python_vectorizer.py +++ b/labs/database/vectorize/python_vectorizer.py @@ -9,7 +9,7 @@ import logging -from labs.config import settings +from config import configuration_variables as settings from labs.database.embeddings import reembed_code from labs.parsers.python import get_lines_code, parse_python_file diff --git a/labs/github/github.py b/labs/github/github.py index c82ace0..7f1b38b 100644 --- a/labs/github/github.py +++ b/labs/github/github.py @@ -1,7 +1,7 @@ import base64 import requests from dataclasses import dataclass -from labs.config import settings +from config import configuration_variables as settings import git import os import logging diff --git a/labs/litellm_service/local.py b/labs/litellm_service/local.py index 5e60e4d..e7764b0 100644 --- a/labs/litellm_service/local.py +++ b/labs/litellm_service/local.py @@ -1,6 +1,6 @@ from ollama import Client -from labs.config import settings +from config import configuration_variables as settings class RequestLocalLLM: diff --git a/labs/litellm_service/request.py b/labs/litellm_service/request.py index 1d64048..8ac949b 100644 --- a/labs/litellm_service/request.py +++ b/labs/litellm_service/request.py @@ -1,6 +1,6 @@ from litellm import completion from pydantic import BaseModel -from labs.config import settings +from config import configuration_variables as settings class Step(BaseModel): diff --git a/labs/llm.py b/labs/llm.py index 2c8ad86..0d7e82a 100644 --- a/labs/llm.py +++ b/labs/llm.py @@ -1,6 +1,6 @@ from labs.decorators import time_and_log_function import logging -from labs.config import settings +from config import configuration_variables as settings from labs.litellm_service.local import RequestLocalLLM from labs.litellm_service.request import RequestLiteLLM from labs.database.embeddings import find_similar_embeddings @@ -48,7 +48,9 @@ def prepare_context(context, prompt): def check_length_issue(llm_response): - finish_reason = getattr(llm_response["choices"][0]["message"], "finish_reason", None) + finish_reason = getattr( + llm_response["choices"][0]["message"], "finish_reason", None + ) if finish_reason == "length": return ( True, @@ -58,7 +60,9 @@ def check_length_issue(llm_response): def check_content_filter(llm_response): - finish_reason = getattr(llm_response["choices"][0]["message"], "finish_reason", None) + finish_reason = getattr( + llm_response["choices"][0]["message"], "finish_reason", None + ) if finish_reason == "content_filter": return ( True, @@ -111,7 +115,9 @@ def get_llm_response(prepared_context): while redo and retries < max_retries: try: - llm_response = litellm_requests.completion_without_proxy(prepared_context, model=settings.LLM_MODEL_NAME) + llm_response = litellm_requests.completion_without_proxy( + prepared_context, model=settings.LLM_MODEL_NAME + ) logger.debug(f"LLM Response: {llm_response}") redo, redo_reason = validate_llm_response(llm_response) except Exception: @@ -141,6 +147,8 @@ def call_llm_with_context(repo_destination, issue_summary): prompt = get_prompt(issue_summary) prepared_context = prepare_context(context, prompt) - logger.debug(f"Issue Summary: {issue_summary} - LLM Model: {settings.LLM_MODEL_NAME}") + logger.debug( + f"Issue Summary: {issue_summary} - LLM Model: {settings.LLM_MODEL_NAME}" + ) return get_llm_response(prepared_context) diff --git a/labs/repo.py b/labs/repo.py index 98d14b0..b8e71f3 100644 --- a/labs/repo.py +++ b/labs/repo.py @@ -16,15 +16,35 @@ def clone_repository(repo_url, local_path): @time_and_log_function def get_issue(token, repo_owner, repo_name, username, issue_number): - github_request = GithubRequests(github_token=token, repo_owner=repo_owner, repo_name=repo_name, username=username) + github_request = GithubRequests( + github_token=token, + repo_owner=repo_owner, + repo_name=repo_name, + username=username, + ) return github_request.get_issue(issue_number) @time_and_log_function -def create_branch(token, repo_owner, repo_name, username, issue_number, issue_title, original_branch="main"): - github_request = GithubRequests(github_token=token, repo_owner=repo_owner, repo_name=repo_name, username=username) +def create_branch( + token, + repo_owner, + repo_name, + username, + issue_number, + issue_title, + original_branch="main", +): + github_request = GithubRequests( + github_token=token, + repo_owner=repo_owner, + repo_name=repo_name, + username=username, + ) branch_name = f"{issue_number}-{issue_title}" - github_request.create_branch(branch_name=branch_name, original_branch=original_branch) + github_request.create_branch( + branch_name=branch_name, original_branch=original_branch + ) return branch_name @@ -35,13 +55,27 @@ def change_issue_to_in_progress(): @time_and_log_function def commit_changes(token, repo_owner, repo_name, username, branch_name, file_list): - github_request = GithubRequests(github_token=token, repo_owner=repo_owner, repo_name=repo_name, username=username) - return github_request.commit_changes("fix", branch_name=branch_name, files=file_list) + github_request = GithubRequests( + github_token=token, + repo_owner=repo_owner, + repo_name=repo_name, + username=username, + ) + return github_request.commit_changes( + "fix", branch_name=branch_name, files=file_list + ) @time_and_log_function -def create_pull_request(token, repo_owner, repo_name, username, original_branch, branch_name): - github_request = GithubRequests(github_token=token, repo_owner=repo_owner, repo_name=repo_name, username=username) +def create_pull_request( + token, repo_owner, repo_name, username, original_branch, branch_name +): + github_request = GithubRequests( + github_token=token, + repo_owner=repo_owner, + repo_name=repo_name, + username=username, + ) return github_request.create_pull_request(branch_name, base=original_branch) diff --git a/labs/run.py b/labs/run.py index 2a424f9..d101e77 100644 --- a/labs/run.py +++ b/labs/run.py @@ -2,7 +2,7 @@ from labs.decorators import time_and_log_function from labs.llm import call_llm_with_context -from labs.config import settings +from config import configuration_variables as settings from labs.repo import ( commit_changes, create_branch, @@ -17,12 +17,22 @@ @time_and_log_function -def run_on_repo(token, repo_owner, repo_name, username, issue_number, original_branch="main"): +def run_on_repo( + token, repo_owner, repo_name, username, issue_number, original_branch="main" +): issue = get_issue(token, repo_owner, repo_name, username, issue_number) issue_title = issue["title"].replace(" ", "-") issue_summary = issue["body"] - branch_name = create_branch(token, repo_owner, repo_name, username, issue_number, issue_title, original_branch) + branch_name = create_branch( + token, + repo_owner, + repo_name, + username, + issue_number, + issue_title, + original_branch, + ) repo_url = f"https://github.com/{repo_owner}/{repo_name}" logger.debug(f"Cloning repo from {repo_url}") @@ -35,7 +45,9 @@ def run_on_repo(token, repo_owner, repo_name, username, issue_number, original_b logger.error("Failed to get a response from LLM, aborting run.") return - response_output = call_agent_to_apply_code_changes(llm_response[1].choices[0].message.content) + response_output = call_agent_to_apply_code_changes( + llm_response[1].choices[0].message.content + ) commit_changes(token, repo_owner, repo_name, username, branch_name, response_output) create_pull_request(token, repo_owner, repo_name, username, branch_name) @@ -48,5 +60,7 @@ def run_on_local_repo(repo_path, issue_text): logger.error("Failed to get a response from LLM, aborting run.") return - response_output = call_agent_to_apply_code_changes(llm_response[1].choices[0].message.content) + response_output = call_agent_to_apply_code_changes( + llm_response[1].choices[0].message.content + ) return True, response_output diff --git a/labs/tasks/llm.py b/labs/tasks/llm.py index ad57346..f700fdf 100644 --- a/labs/tasks/llm.py +++ b/labs/tasks/llm.py @@ -1,5 +1,5 @@ import redis -from labs.config import settings +from config import configuration_variables as settings import logging import json diff --git a/labs/tasks/repo.py b/labs/tasks/repo.py index 5961ee8..615fc16 100644 --- a/labs/tasks/repo.py +++ b/labs/tasks/repo.py @@ -1,5 +1,5 @@ import redis -from labs.config import settings +from config import configuration_variables as settings import logging import json from labs.celery import app diff --git a/labs/tasks/run.py b/labs/tasks/run.py index 2335967..82b19dd 100644 --- a/labs/tasks/run.py +++ b/labs/tasks/run.py @@ -12,7 +12,7 @@ prepare_prompt_and_context_task, vectorize_repo_to_database_task, ) -from labs.config import settings +from config import configuration_variables as settings import logging from labs.celery import app diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..d28672e --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == "__main__": + main() diff --git a/notebooks/embeddings.ipynb b/notebooks/embeddings.ipynb index beec85e..941aa0f 100644 --- a/notebooks/embeddings.ipynb +++ b/notebooks/embeddings.ipynb @@ -48,7 +48,7 @@ "outputs": [], "source": [ "from importlib import reload\n", - "from labs.config import settings\n", + "from config import configuration_variables as settings\n", "\n", "reload(settings)\n", "\n", diff --git a/poetry.lock b/poetry.lock index be14bde..22340a6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -268,6 +268,20 @@ types-python-dateutil = ">=2.8.10" doc = ["doc8", "sphinx (>=7.0.0)", "sphinx-autobuild", "sphinx-autodoc-typehints", "sphinx_rtd_theme (>=1.3.0)"] test = ["dateparser (==1.*)", "pre-commit", "pytest", "pytest-cov", "pytest-mock", "pytz (==2021.1)", "simplejson (==3.*)"] +[[package]] +name = "asgiref" +version = "3.8.1" +description = "ASGI specs, helper code, and adapters" +optional = false +python-versions = ">=3.8" +files = [ + {file = "asgiref-3.8.1-py3-none-any.whl", hash = "sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47"}, + {file = "asgiref-3.8.1.tar.gz", hash = "sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590"}, +] + +[package.extras] +tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] + [[package]] name = "asttokens" version = "2.4.1" @@ -833,6 +847,26 @@ files = [ {file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"}, ] +[[package]] +name = "django" +version = "5.1.2" +description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." +optional = false +python-versions = ">=3.10" +files = [ + {file = "Django-5.1.2-py3-none-any.whl", hash = "sha256:f11aa87ad8d5617171e3f77e1d5d16f004b79a2cf5d2e1d2b97a6a1f8e9ba5ed"}, + {file = "Django-5.1.2.tar.gz", hash = "sha256:bd7376f90c99f96b643722eee676498706c9fd7dc759f55ebfaf2c08ebcdf4f0"}, +] + +[package.dependencies] +asgiref = ">=3.8.1,<4" +sqlparse = ">=0.3.1" +tzdata = {version = "*", markers = "sys_platform == \"win32\""} + +[package.extras] +argon2 = ["argon2-cffi (>=19.1.0)"] +bcrypt = ["bcrypt"] + [[package]] name = "dnspython" version = "2.6.1" @@ -4357,6 +4391,21 @@ postgresql-psycopgbinary = ["psycopg[binary] (>=3.0.7)"] pymysql = ["pymysql"] sqlcipher = ["sqlcipher3_binary"] +[[package]] +name = "sqlparse" +version = "0.5.1" +description = "A non-validating SQL parser." +optional = false +python-versions = ">=3.8" +files = [ + {file = "sqlparse-0.5.1-py3-none-any.whl", hash = "sha256:773dcbf9a5ab44a090f3441e2180efe2560220203dc2f8c0b0fa141e18b505e4"}, + {file = "sqlparse-0.5.1.tar.gz", hash = "sha256:bb6b4df465655ef332548e24f08e205afc81b9ab86cb1c45657a7ff173a3a00e"}, +] + +[package.extras] +dev = ["build", "hatch"] +doc = ["sphinx"] + [[package]] name = "stack-data" version = "0.6.3" @@ -4836,13 +4885,13 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "uvicorn" -version = "0.30.6" +version = "0.32.0" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" files = [ - {file = "uvicorn-0.30.6-py3-none-any.whl", hash = "sha256:65fd46fe3fda5bdc1b03b94eb634923ff18cd35b2f084813ea79d1f103f711b5"}, - {file = "uvicorn-0.30.6.tar.gz", hash = "sha256:4b15decdda1e72be08209e860a1e10e92439ad5b97cf44cc945fcbee66fc5788"}, + {file = "uvicorn-0.32.0-py3-none-any.whl", hash = "sha256:60b8f3a5ac027dcd31448f411ced12b5ef452c646f76f02f8cc3f25d8d26fd82"}, + {file = "uvicorn-0.32.0.tar.gz", hash = "sha256:f78b36b143c16f54ccdb8190d0a26b5f1901fe5a3c777e1ab29f26391af8551e"}, ] [package.dependencies] @@ -5414,4 +5463,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.11.7" -content-hash = "0dd08082e758631b63a02067838034d1dde1fcc5645eb834d3bedce715f27b3f" +content-hash = "631613defed221cf7ed749dcacc992624ff8c569a6401f2d206cd625fb00846f" diff --git a/pyproject.toml b/pyproject.toml index 4decc85..4fe4beb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,8 @@ celery = "^5.4.0" celery-redbeat = "^2.2.0" redis = "^5.1.0" ollama = "^0.3.3" +uvicorn = "^0.32.0" +django = "^5.1.2" [tool.poetry.group.dev.dependencies] pre-commit = "^3.8.0" diff --git a/tests/conftest.py b/tests/conftest.py index bc7da3e..5dd479f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ import random import pytest -from labs.config import settings +from config import configuration_variables as settings from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker, declarative_base diff --git a/tests/database/conftest.py b/tests/database/conftest.py index ad367d4..65a54f0 100644 --- a/tests/database/conftest.py +++ b/tests/database/conftest.py @@ -1,6 +1,6 @@ import random import pytest -from labs.config import settings +from config import configuration_variables as settings from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker, declarative_base