Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ venv/
ENV/
env.bak/
venv.bak/
.envrc

# Spyder project settings
.spyderproject
Expand Down
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,32 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext, md]

# files
# files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-symlinks
- id: destroyed-symlinks
- id: fix-byte-order-marker

# git
# git
- id: check-added-large-files
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: no-commit-to-branch
- id: forbid-new-submodules

# python
# python
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: debug-statements
# - id: double-quote-string-fixer # conflicts with black
- id: fix-encoding-pragma
args: [--remove]
- id: name-tests-test
args: [--pytest-test-first]
# - id: requirements-txt-fixer # conflicts with poetry
- id: requirements-txt-fixer # conflicts with poetry

# security
# security
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ARG PIP_DISABLE_PIP_VERSION_CHECK=1 \
UV_NO_CACHE=1

# set up python
COPY --from=ghcr.io/astral-sh/uv:0.5.29 /uv /uvx /bin/
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY --chown=${USER}:${USER} pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv venv --seed ${VIRTUAL_ENV} && \
Expand Down Expand Up @@ -72,7 +72,6 @@ RUN --mount=type=cache,target=/root/.cache/uv \
chown -R ${USER}:${USER} ${VIRTUAL_ENV} && \
uv pip list

USER ${USER}
COPY --chown=${USER}:${USER} tests tests
COPY --chown=${USER}:${USER} Makefile Makefile

Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@ help: ## print help message

.PHONY: deps-install-python
deps-install-python:
poetry install
python -m pip list
uv sync
uv pip list

.PHONY: deps-install
deps-install: deps-install-python ## install dependencies
python -m pre_commit install --install-hooks
uvx pre-commit install --install-hooks

.PHONY: deps-update
deps-update:
poetry update
python -m pre_commit autoupdate
uv lock --upgrade
uvx pre-commit-update

## checks

.PHONY: format
format:
python -m ruff check --fix .
python -m ruff format .
uvx ruff check --fix .
uvx ruff format .

.PHONY: lint
lint:
python -m ruff check .
python -m ruff format .
uvx ruff check .
uvx ruff format .
python -m mypy $(SOURCE_DIR)

.PHONY: test
Expand All @@ -75,7 +75,7 @@ run: ## run main python app
dc-build: ## build app image
docker compose build app_dev app_ci app

.PHONY: dc-test
.PHONY: dc-ci
dc-ci:
docker compose run --build --rm app_ci

Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@ dependencies = ["fastapi[all]", "gunicorn", "loguru", "sqlmodel", "typer"]

[dependency-groups]
dev = [
"commitizen",
"mypy",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-env",
"pytest-mock",
"pytest-xdist",
"ruff",
]

[tool.isort]
Expand Down
Loading
Loading