Skip to content

Commit c13470b

Browse files
refactor: migrate make (#108)
* Update Dockerfile * Update Makefile * migrate all make --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c40fb5d commit c13470b

File tree

6 files changed

+17
-274
lines changed

6 files changed

+17
-274
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ venv/
127127
ENV/
128128
env.bak/
129129
venv.bak/
130+
.envrc
130131

131132
# Spyder project settings
132133
.spyderproject

.pre-commit-config.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,32 @@ repos:
2525
- id: trailing-whitespace
2626
args: [--markdown-linebreak-ext, md]
2727

28-
# files
28+
# files
2929
- id: check-case-conflict
3030
- id: check-executables-have-shebangs
3131
- id: check-symlinks
3232
- id: destroyed-symlinks
3333
- id: fix-byte-order-marker
3434

35-
# git
35+
# git
3636
- id: check-added-large-files
3737
- id: check-merge-conflict
3838
- id: check-vcs-permalinks
3939
- id: no-commit-to-branch
4040
- id: forbid-new-submodules
4141

42-
# python
42+
# python
4343
- id: check-ast
4444
- id: check-builtin-literals
4545
- id: check-docstring-first
4646
- id: debug-statements
47-
# - id: double-quote-string-fixer # conflicts with black
4847
- id: fix-encoding-pragma
4948
args: [--remove]
5049
- id: name-tests-test
5150
args: [--pytest-test-first]
52-
# - id: requirements-txt-fixer # conflicts with poetry
51+
- id: requirements-txt-fixer # conflicts with poetry
5352

54-
# security
53+
# security
5554
- id: detect-aws-credentials
5655
args: [--allow-missing-credentials]
5756
- id: detect-private-key

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ARG PIP_DISABLE_PIP_VERSION_CHECK=1 \
4141
UV_NO_CACHE=1
4242

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

75-
USER ${USER}
7675
COPY --chown=${USER}:${USER} tests tests
7776
COPY --chown=${USER}:${USER} Makefile Makefile
7877

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,29 @@ help: ## print help message
2727

2828
.PHONY: deps-install-python
2929
deps-install-python:
30-
poetry install
31-
python -m pip list
30+
uv sync
31+
uv pip list
3232

3333
.PHONY: deps-install
3434
deps-install: deps-install-python ## install dependencies
35-
python -m pre_commit install --install-hooks
35+
uvx pre-commit install --install-hooks
3636

3737
.PHONY: deps-update
3838
deps-update:
39-
poetry update
40-
python -m pre_commit autoupdate
39+
uv lock --upgrade
40+
uvx pre-commit-update
4141

4242
## checks
4343

4444
.PHONY: format
4545
format:
46-
python -m ruff check --fix .
47-
python -m ruff format .
46+
uvx ruff check --fix .
47+
uvx ruff format .
4848

4949
.PHONY: lint
5050
lint:
51-
python -m ruff check .
52-
python -m ruff format .
51+
uvx ruff check .
52+
uvx ruff format .
5353
python -m mypy $(SOURCE_DIR)
5454

5555
.PHONY: test
@@ -75,7 +75,7 @@ run: ## run main python app
7575
dc-build: ## build app image
7676
docker compose build app_dev app_ci app
7777

78-
.PHONY: dc-test
78+
.PHONY: dc-ci
7979
dc-ci:
8080
docker compose run --build --rm app_ci
8181

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ dependencies = ["fastapi[all]", "gunicorn", "loguru", "sqlmodel", "typer"]
1313

1414
[dependency-groups]
1515
dev = [
16-
"commitizen",
1716
"mypy",
18-
"pre-commit",
1917
"pytest",
2018
"pytest-cov",
2119
"pytest-env",
2220
"pytest-mock",
2321
"pytest-xdist",
24-
"ruff",
2522
]
2623

2724
[tool.isort]

0 commit comments

Comments
 (0)