Skip to content

Commit c843a10

Browse files
committed
fix all the imports, get it all working
1 parent d9c340c commit c843a10

File tree

14 files changed

+29
-26
lines changed

14 files changed

+29
-26
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
- DB_HOST=postgres
1212
- DB_PASSWORD=abc123
1313
volumes:
14-
- ./:/code
14+
- ./src:/src
1515
ports:
1616
- "5005:80"
1717

mypy.ini

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[mypy]
22
ignore_missing_imports = False
3+
mypy_path = ./src
34

4-
[mypy-pytest.*]
5+
[mypy-pytest.*,sqlalchemy.*]
56
ignore_missing_imports = True
6-
7-
[mypy-sqlalchemy.*]
8-
ignore_missing_imports = True
9-

src/allocation/adapters/orm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from sqlalchemy import Table, MetaData, Column, Integer, String, Date, ForeignKey
22
from sqlalchemy.orm import mapper, relationship
33

4-
from domain import model
4+
from allocation.domain import model
55

66

77
metadata = MetaData()

src/allocation/adapters/repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import abc
2-
from domain import model
2+
from allocation.domain import model
33

44

55
class AbstractRepository(abc.ABC):

src/allocation/entrypoints/flask_app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from sqlalchemy import create_engine
44
from sqlalchemy.orm import sessionmaker
55

6-
import config
7-
from domain import model
8-
from adapters import orm, repository
9-
from service_layer import services
6+
from allocation import config
7+
from allocation.domain import model
8+
from allocation.adapters import orm, repository
9+
from allocation.service_layer import services
1010

1111
orm.start_mappers()
1212
get_session = sessionmaker(bind=create_engine(config.get_postgres_uri()))

src/allocation/service_layer/services.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from typing import Optional
33
from datetime import date
44

5-
from domain import model
6-
from domain.model import OrderLine
7-
from adapters.repository import AbstractRepository
5+
from allocation.domain import model
6+
from allocation.domain.model import OrderLine
7+
from allocation.adapters.repository import AbstractRepository
88

99

1010
class InvalidSku(Exception):

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from sqlalchemy import create_engine
1010
from sqlalchemy.orm import sessionmaker, clear_mappers
1111

12-
from adapters.orm import metadata, start_mappers
13-
import config
12+
from allocation.adapters.orm import metadata, start_mappers
13+
from allocation import config
1414

1515

1616
@pytest.fixture
@@ -65,6 +65,6 @@ def postgres_session(postgres_db):
6565

6666
@pytest.fixture
6767
def restart_api():
68-
(Path(__file__).parent / "../entrypoints/flask_app.py").touch()
68+
(Path(__file__).parent / "../src/allocation/entrypoints/flask_app.py").touch()
6969
time.sleep(0.5)
7070
wait_for_webapp_to_come_up()

tests/e2e/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pytest
33
import requests
44

5-
import config
5+
from allocation import config
66

77

88
def random_suffix():

tests/integration/test_orm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from domain import model
1+
from allocation.domain import model
22
from datetime import date
33

44

tests/integration/test_repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pylint: disable=protected-access
2-
from domain import model
3-
from adapters import repository
2+
from allocation.domain import model
3+
from allocation.adapters import repository
44

55

66
def test_repository_can_save_a_batch(session):

0 commit comments

Comments
 (0)