Skip to content

Commit

Permalink
Fix package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Micah Fitzgerald committed Aug 21, 2024
1 parent fd089b6 commit 1ff18a7
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ backend/convoy.db
**/.pytest_cache

backend/convoy.db
backend/src/__pycache__/*
backend/src/__pycache__/exceptions.cpython-311.pyc
backend/src/__pycache__/main.cpython-311.pyc
backend/main/__pycache__/*
backend/convoy.db
backend/tests/__pycache__/*
Empty file added backend/main/__init__.py
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from service import ConvoyService, convoy_service
from .service import ConvoyService, convoy_service


def get_service() -> ConvoyService:
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions backend/src/main.py → backend/main/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from contextlib import asynccontextmanager
from utils import (
from .utils import (
custom_generate_unique_id,
)
from fastapi import FastAPI

from service import convoy_service
from router import router
from .service import convoy_service
from .router import router



Expand Down
2 changes: 1 addition & 1 deletion backend/src/models.py → backend/main/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
from typing import Optional, List
from pydantic import BaseModel, ConfigDict, computed_field, field_serializer, field_validator, Field
from utils import parse_date, parse_timestamp, uuid_gen
from .utils import parse_date, parse_timestamp, uuid_gen
from sqlalchemy import CheckConstraint, ForeignKey, Numeric
from sqlalchemy import String
from sqlalchemy.orm import DeclarativeBase
Expand Down
8 changes: 4 additions & 4 deletions backend/src/router.py → backend/main/router.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import List

from utils import setup_logger
from dependencies import get_service
from service import ConvoyService
from .utils import setup_logger
from .dependencies import get_service
from .service import ConvoyService

from models import Machine, MachineSchema, MachineUpdateSchema, MeterReading, MeterReadingSchema, SupplySchema, Task, TaskCompleteSchema, TaskCreateSchema, TaskSchema
from .models import Machine, MachineSchema, MachineUpdateSchema, MeterReading, MeterReadingSchema, SupplySchema, Task, TaskCompleteSchema, TaskCreateSchema, TaskSchema
from fastapi import Depends

from fastapi import APIRouter
Expand Down
6 changes: 3 additions & 3 deletions backend/src/service.py → backend/main/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import requests
from sqlalchemy import select, update
from exceptions import MachineNotFound, TaskNotFound
from utils import LogRetry, setup_logger
from models import Base, Machine, MeterReading, Supply, Task
from .exceptions import MachineNotFound, TaskNotFound
from .utils import LogRetry, setup_logger
from .models import Base, Machine, MeterReading, Supply, Task
from todoist_api_python.api_async import TodoistAPIAsync
from todoist_api_python.models import Task as TDTask

Expand Down
File renamed without changes.
Empty file added backend/tests/__init__.py
Empty file.
6 changes: 3 additions & 3 deletions backend/src/test_main.py → backend/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import logging
from pydantic import ValidationError
import pytest
from service import convoy_service as service
from models import Machine, MeterReading, MeterReadingSchema, Task, MachineSchema, TaskSchema
from main import app
from ..main.service import convoy_service as service
from ..main.models import Machine, MeterReading, MeterReadingSchema, Task, MachineSchema, TaskSchema
from ..main.main import app
from httpx import ASGITransport, AsyncClient
from fastapi.testclient import TestClient
import os
Expand Down

0 comments on commit 1ff18a7

Please sign in to comment.