Skip to content

Commit f73548d

Browse files
committed
Move implementation into src directory
Signed-off-by: Federico Busetti <[email protected]>
1 parent d540ac1 commit f73548d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+61
-83
lines changed

.idea/bootstrap-fastapi-service.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ install-dependencies:
3636
poetry install --no-root --with http,grpc
3737

3838
dev-dependencies:
39-
poetry install --no-root --with http,grpc,dev
39+
poetry install --with http,grpc,dev
4040

4141
update-dependencies:
4242
poetry update --with http,grpc,dev

alembic.ini

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[alembic]
44
# path to migration scripts
5-
script_location = alembic
5+
script_location = src/alembic
66

77
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
88
# Uncomment the line below if you want the files to be prepended with date and time
@@ -12,7 +12,7 @@ file_template = %%(year)d-%%(month).2d-%%(day).2d-%%(hour).2d%%(minute).2d%%(sec
1212

1313
# sys.path path, will be prepended to sys.path if present.
1414
# defaults to the current working directory.
15-
prepend_sys_path = .
15+
#prepend_sys_path = .
1616

1717
# timezone to use when rendering the date within the migration file
1818
# as well as the filename.
@@ -56,13 +56,6 @@ version_path_separator = os # Use os.pathsep. Default configuration used for ne
5656
# output_encoding = utf-8
5757

5858
# We inject db names and config using env.py in alembic directory
59-
#databases = engine1, engine2
60-
61-
#[engine1]
62-
#sqlalchemy.url = driver://user:pass@localhost/dbname
63-
64-
#[engine2]
65-
#sqlalchemy.url = driver://user:pass@localhost/dbname2
6659

6760
[post_write_hooks]
6861
# post_write_hooks defines scripts or Python functions that are run

http_app/templates.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

pyproject.toml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ version = "0.1.0"
44
description = ""
55
authors = ["Federico Busetti <[email protected]>"]
66
readme = "README.md"
7+
packages = [
8+
{ include = "**/*.py", from = "src" }
9+
]
710

811
[build-system]
912
requires = ["poetry-core"]
@@ -83,17 +86,11 @@ pymdown-extensions = "*"
8386

8487
[tool.coverage.run]
8588
branch = true
86-
source = [
87-
"http_app",
88-
"grpc_app",
89-
"domains",
90-
"gateways",
91-
"celery_worker",
92-
"common",
93-
]
89+
source = ["src"]
9490
omit = [
95-
"grpc_app/generated/*",
96-
"common/config.py",
91+
"src/alembic/*",
92+
"src/common/config.py",
93+
"src/grpc_app/generated/*",
9794
]
9895
# It's not necessary to configure concurrency here
9996
# because pytest-cov takes care of that
@@ -107,14 +104,8 @@ exclude_also = [
107104
]
108105

109106
[tool.mypy]
110-
files = [
111-
"domains",
112-
"grpc_app",
113-
"http_app",
114-
"gateways",
115-
"tests",
116-
"common",
117-
]
107+
files = ["src", "tests"]
108+
exclude = ["alembic"]
118109
plugins = "pydantic.mypy,strawberry.ext.mypy_plugin"
119110

120111
# We can remove celery by installing `celery-types` but needs
@@ -136,7 +127,7 @@ testpaths = [
136127
[tool.ruff]
137128
target-version = "py39"
138129
extend-exclude = [
139-
"grpc_app/generated",
130+
"src/grpc_app/generated",
140131
"docs",
141132
]
142133

@@ -172,4 +163,4 @@ ignore = [
172163
[tool.ruff.lint.per-file-ignores]
173164
"__init__.py" = ["F401"] # Ignore unused imports on init files
174165
"tests/**/*.py" = ["S101"] # Allow assert usage on tests
175-
"grpc_app/**/*.py" = ["N802"] # Function name lowercase
166+
"src/grpc_app/**/*.py" = ["N802"] # Function name lowercase

src/alembic.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copy of alembic.ini used to run migrations inside the container
2+
3+
[alembic]
4+
script_location = alembic
5+
prepend_sys_path = .
6+
file_template = %%(year)d-%%(month).2d-%%(day).2d-%%(hour).2d%%(minute).2d%%(second).2d-%%(rev)s_%%(slug)s
7+
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
File renamed without changes.
File renamed without changes.

alembic/env.py renamed to src/alembic/env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import logging
22
from asyncio import get_event_loop
33

4+
from common.bootstrap import application_init
5+
from common.config import AppConfig
46
from sqlalchemy.ext.asyncio import AsyncEngine
57

68
from alembic import context
7-
from common.bootstrap import application_init
8-
from common.config import AppConfig
99

1010
USE_TWOPHASE = False
1111

File renamed without changes.

0 commit comments

Comments
 (0)