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

feat: initialize project structure with configuration, dependencies, and testing setup

parent 550ae1bc
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+11 −0
Changes for .gitignore: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Python
.venv/
.cache/
*.egg-info/
__pycache__/
*.py[cod]

# Local environment
.env
.env.*
!.env.example
 No newline at end of file
+34 −0
Changes for .pre-commit-config.yaml: 34 added lines, 0 removed lines.
Original line number Diff line number Diff line
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v6.0.0
  hooks:
    - id: check-yaml
      exclude: ^deployment/templates/
    - id: check-toml
    - id: end-of-file-fixer
    - id: trailing-whitespace
      args: [--markdown-linebreak-ext=md]

- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.15.6
  hooks:
    - id: ruff-check
      args: [--fix, --cache-dir, .cache/ruff]
    - id: ruff-format
      args: [--cache-dir, .cache/ruff]

- repo: https://github.com/pre-commit/mirrors-mypy
  rev: v1.19.1
  hooks:
    - id: mypy
      files: ^(src|tests)/
      args: [--strict, --ignore-missing-imports, --cache-dir, .cache/mypy]
      additional_dependencies: [
        "fastapi[standard]>=0.115.0",
        "httpx>=0.28.0",
        "pydantic-settings>=2.9.1",
        "PyJWT[cryptography]>=2.10.1",
        "pytest>=8.0.0",
        "pytest-asyncio>=0.25.0",
        "structlog>=25.0.0",
      ]

Makefile

0 → 100644
+50 −0
Changes for Makefile: 50 added lines, 0 removed lines.
Original line number Diff line number Diff line
.PHONY: install clean lint format type precommit test run

PIP := .venv/bin/pip
DEV ?= false

ifeq ($(DEV),true)
	EXTRAS := dev
else
	EXTRAS :=
endif

ifeq ($(EXTRAS),)
PIP_INSTALL = $(PIP) install -e .
else
PIP_INSTALL = $(PIP) install -e .[$(EXTRAS)]
endif

install:
	python3 -m venv .venv
	$(PIP) install --upgrade pip setuptools wheel
	$(PIP_INSTALL)

clean:
	rm -rf .venv
	rm -rf .cache
	rm -rf src/*.egg-info

lint:
	make install DEV=true
	.venv/bin/ruff check --fix

format:
	make install DEV=true
	.venv/bin/ruff format

type:
	make install DEV=true
	.venv/bin/mypy src/ tests/

precommit:
	make install DEV=true
	.venv/bin/pre-commit run --all-files

test:
	make install DEV=true
	.venv/bin/pytest

run:
	make install
	.venv/bin/uvicorn "portal_service.main:create_app" --factory --reload --port 8000

pyproject.toml

0 → 100644
+51 −0
Changes for pyproject.toml: 51 added lines, 0 removed lines.
Original line number Diff line number Diff line
[project]
name = "portal-backend"
description = "OOP Portal backend"
readme = "README.md"
authors = [
    {name = "OOP Team"},
]
dynamic = ["version"]
requires-python = "==3.12.*"
dependencies = [
    "fastapi[standard]>=0.115.0",
    "pydantic-settings>=2.9.1",
    "structlog>=25.0.0",
    "PyJWT[cryptography]>=2.10.1",
    "httpx>=0.28.0",
]

[project.optional-dependencies]
dev = [
    "import-linter>=2.11",
    "mypy>=1.15.0",
    "pre-commit>=4.5.0",
    "pytest>=8.0.0",
    "pytest-asyncio>=0.25.0",
    "ruff>=0.11.0",
]

[tool.ruff]
line-length = 100
target-version = "py312"
cache-dir = ".cache/ruff"

[tool.ruff.lint]
select = ["E", "W", "F", "FAST", "I"]
ignore = ["E3"]

[tool.ruff.format]
docstring-code-format = true

[tool.mypy]
python_version = "3.12"
cache_dir = ".cache/mypy"
strict = true
ignore_missing_imports = true

[tool.importlinter]
root_package = "src"

[tool.pytest.ini_options]
asyncio_mode = "auto"
cache_dir = ".cache/pytest"
+0 −0

Empty file added.

Loading