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 .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
ignore = DCO010, DCO023, DOC503, DOC602, DOC603, MDA002, E203, E501, E712, F401, F403, F821, W503
style = google
skip-checking-short-docstrings = False
exclude = .venv
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
open-pull-requests-limit: 10
interval: "daily"
open-pull-requests-limit: 20
26 changes: 10 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,16 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install pip
run: |
python -m pip install pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile)
- name: Install pipenv
run: |
PIPENV_VERSION=$(sed -nE 's/pipenv = "==(.*)"/\1/p' Pipfile)
python -m pip install pipenv==$PIPENV_VERSION
- name: Install from pipfile
run: |
pipenv install --system
- name: Install uv
run: python -m pip install --upgrade uv
- name: Sync dependencies
run: uv sync --frozen --all-extras
- name: Analysing the code with black
run: |
black $(git rev-parse --show-toplevel) --check
uv run black $(git rev-parse --show-toplevel) --check
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
uv run pylint $(git ls-files '*.py')
- name: Check for CRLF line endings
run: |
for file in $(git ls-files); do
Expand All @@ -44,14 +38,14 @@ jobs:
fi
- name: Analysing the code with flake8
run: |
flake8 $(git rev-parse --show-toplevel)
uv run flake8 $(git rev-parse --show-toplevel)
- name: Analysing the code with isort
run: |
isort --check-only $(git rev-parse --show-toplevel)/ --profile black
uv run isort --check-only $(git rev-parse --show-toplevel)/ --profile black
- name: Running pytest
working-directory: techsupport_bot
run: |
cd techsupport_bot
python3.11 -m pytest tests/ -p no:warnings
PYTHONPATH=. uv run pytest tests/ -p no:warnings

containerBuild:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ persistent=yes
# Specify a configuration file.
#rcfile=

# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes

# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
Expand Down
29 changes: 20 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
FROM python:3.11-alpine
FROM python:3.11-slim

RUN apk update
RUN apk add --no-cache postgresql-dev gcc musl-dev libpq git
# Install OS dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
git \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*

# Install uv
RUN pip install --no-cache-dir uv

# App directory
WORKDIR /var/TechSupportBot

COPY Pipfile .
COPY Pipfile.lock .
# Copy dependency files first for Docker layer caching
COPY pyproject.toml uv.lock ./

RUN pip install --no-cache-dir pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile)
RUN pip install --no-cache-dir pipenv==$(sed -nE 's/pipenv = "==(.*)"/\1/p' Pipfile)
RUN pipenv install --system
# Install dependencies into project venv
RUN uv sync --frozen --no-dev

# Copy project files
COPY . .

# Move into bot directory
WORKDIR /var/TechSupportBot/techsupport_bot

CMD python3 -u main.py
# Run bot
CMD ["uv", "run", "--", "python3", "-u", "main.py"]
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ else
endif

make sync:
python3 -m pipenv sync -d
uv lock
uv sync --frozen

check-format:
black --check ./
Expand Down
40 changes: 0 additions & 40 deletions Pipfile

This file was deleted.

Loading
Loading