Skip to content

Commit

Permalink
sync repo + add comments and docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ALittleMoron committed Apr 14, 2024
1 parent 136e421 commit 541b1eb
Show file tree
Hide file tree
Showing 13 changed files with 731 additions and 501 deletions.
14 changes: 5 additions & 9 deletions docker/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-slim-bookworm as development_build
FROM python:3.11-slim-bookworm as development_build

ARG YOUR_ENV

Expand All @@ -10,22 +10,18 @@ ENV YOUR_ENV=${YOUR_ENV} \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
# Poetry's configuration:
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
POETRY_HOME='/usr/local' \
POETRY_VERSION=1.8
PDM_CHECK_UPDATE=false

# System deps:
# RUN curl -sSL https://install.python-poetry.org | python3 -

# Copy only requirements to cache them in docker layer
WORKDIR /code
RUN pip install poetry
COPY ./poetry.lock ./pyproject.toml /code/
RUN pip install pdm
COPY ./pdm.lock ./pyproject.toml README.md /code/

# Project initialization:
RUN poetry install --no-root
RUN pdm install -G:all

# Creating folders, and files for a project:
COPY . /code
2 changes: 2 additions & 0 deletions docker/docker-compose-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ services:
dockerfile: ./docker/Dockerfile.test
command:
[
"pdm",
"run",
"pytest",
"./tests",
"--cov-report",
Expand Down
83 changes: 42 additions & 41 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 21 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.ruff]
select = [
lint.select = [
"A",
"B",
"D",
Expand Down Expand Up @@ -32,7 +32,7 @@ select = [
"TRY",
]
line-length = 100
show-source = true
output-format = "full"
exclude = [
".git",
"__pycache__",
Expand All @@ -45,19 +45,28 @@ exclude = [
"alembic",
"airich",
]
ignore = ["D100", "B008", "D104", "Q000", "S101", "PT016", "ANN101", "ANN102"]
lint.ignore = [
"D100",
"B008",
"D104",
"Q000",
"S101",
"PT016",
"ANN101",
"ANN102",
]

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
ignore-decorators = ["typing.overload"]

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 11

[tool.ruff.flake8-bugbear]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query"]

[tool.ruff.extend-per-file-ignores]
[tool.ruff.lint.extend-per-file-ignores]
"__init__.py" = ["F401"]
"*/migrations/versions/*" = ["D103"]
"src/app/main.py" = ["E402"]
Expand Down Expand Up @@ -148,13 +157,16 @@ dev = [

[project]
name = "sqlrepo"
version = "0.1.1"
version = "0.2.0"
description = "sqlalchemy repositories with crud operations and other utils for it."
authors = [{ name = "Dmitriy Lunev", email = "dima.lunev14@gmail.com" }]
requires-python = ">=3.11"
readme = "README.md"
license = { text = "MIT" }
dependencies = ["sqlalchemy>=2.0.29", "python-dev-utils[filtering]>=0.1.1"]
dependencies = [
"sqlalchemy>=2.0.29",
"python-dev-utils[sqlalchemy_filters]>=1.0.6",
]


[build-system]
Expand Down
2 changes: 1 addition & 1 deletion sqlrepo/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@


logging.config.dictConfig(LOGGER_CONFIG)
logger = logging.getLogger('sqlrepo')
logger = logging.getLogger("sqlrepo")
Loading

0 comments on commit 541b1eb

Please sign in to comment.