Commit c3bd79b8 authored by Dimitrios Gogos's avatar Dimitrios Gogos
Browse files

refactor: change project structure

parent 3e1e1f75
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# Copy this file to .env and adjust as needed. Every value below is optional
# -- open_exposure_gateway/app/core/config.py already has a working default
# -- src/open_exposure_gateway/core/config.py already has a working default
# for each one, shown here. Uncomment and edit only what you need to change.

# APP_NAME="Open Exposure Gateway"
+2 −2
Original line number Diff line number Diff line
@@ -24,12 +24,12 @@ htmlcov/
.mypy_cache/
.pytest_cache/
.ruff_cache/
.cache/
.hypothesis/
.idea/
.coverage
.python_version
coverage.xml
uv.lock

# Runtime scratch files
.tmp/
+7 −6
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ variables:
type:
  stage: type
  script:
    - mypy open_exposure_gateway/app/ open_exposure_gateway/test/
    - mypy src/ tests/

architecture:
  stage: architecture
@@ -37,12 +37,12 @@ architecture:
lint:
  stage: lint
  script:
    - ruff check open_exposure_gateway/
    - ruff check src/ tests/

format:
  stage: format
  script:
    - ruff format --check open_exposure_gateway/
    - ruff format --check src/ tests/

test:
  stage: test
@@ -52,13 +52,14 @@ test:
  # module-level schemathesis schema loading is expensive — collecting it here
  # would cost minutes on every pipeline even though none of its tests run.
  script:
    - pytest open_exposure_gateway/test/unit || [ $? -eq 5 ] #bypass no tests found error.
    - pytest tests/unit --cov=src/open_exposure_gateway --cov-branch --cov-report=term-missing || [ $? -eq 5 ] #bypass no tests found error.
  coverage: '/TOTAL.+ ([0-9]{1,3}(?:\.[0-9]+)?%)/'

conformance:
  stage: test
  allow_failure: true
  script:
    - pytest open_exposure_gateway/test/conformance
    - pytest tests/conformance

build:
  stage: build
+2 −4
Original line number Diff line number Diff line
@@ -14,15 +14,13 @@ repos:
  hooks:
    # Run the linter.
    - id: ruff-check
      args: ["--cache-dir", "open_exposure_gateway/.cache/ruff"]
    # Run the formatter.
    - id: ruff-format
      args: ["--cache-dir", "open_exposure_gateway/.cache/ruff"]

- repo: https://github.com/pre-commit/mirrors-mypy
  rev: v1.19.1  # Use the sha / tag you want to point at
  hooks:
    - id: mypy
      files: ^open_exposure_gateway/app/|^open_exposure_gateway/test/
      args: [--strict, --ignore-missing-imports, --cache-dir, open_exposure_gateway/.cache/mypy]
      files: ^src/open_exposure_gateway/|^tests/
      args: [--strict, --ignore-missing-imports, --cache-dir, .cache/mypy]
      additional_dependencies: ["fastapi[standard]>=0.135.1", "pydantic>=2.0", "pydantic-settings>=2.0", "httpx>=0.27", "pytest>=9.0.2", "sqlalchemy>=2.0.48", "pytest-asyncio>=0.24", "testcontainers>=4.0.0"] #TODO, always add necessary
+3 −3
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ ENV PIP_DEFAULT_TIMEOUT=120

COPY pyproject.toml ./
COPY README.md ./
COPY open_exposure_gateway/ ./open_exposure_gateway/
COPY src/ ./src/

RUN python -m venv .venv && \
    .venv/bin/pip install \
@@ -46,7 +46,7 @@ FROM python:3.12-slim AS runtime
WORKDIR /app

COPY --from=builder /app/.venv /app/.venv
COPY open_exposure_gateway/ ./open_exposure_gateway/
COPY src/ ./src/

ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/app"
@@ -55,4 +55,4 @@ ENV PYTHONDONTWRITEBYTECODE=1

EXPOSE 8080

CMD ["uvicorn", "open_exposure_gateway.app.main:app", "--host", "0.0.0.0", "--port", "8080"]
 No newline at end of file
CMD ["uvicorn", "open_exposure_gateway.main:app", "--host", "0.0.0.0", "--port", "8080"]
Loading