Skip to content

Commit 5721df4

Browse files
committed
Merge branch 'main' of github.com:r-Techsupport/TechSupportBot into patch-warn-ban-message
2 parents 2ac5107 + 1d58096 commit 5721df4

190 files changed

Lines changed: 9993 additions & 6935 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Temp files, cache files, etc that we do not need in the container
2+
.venv
3+
*.pyc
4+
.vscode
5+
__pycache__
6+
.pytest_cache
7+
.coverage
8+
.hypothesis
9+
.idea/
10+
11+
# Folders that contain important information in the repo, but are not used to run the bot itself
12+
.github/
13+
DBs/
14+
documentation/
15+
tests/
16+
17+
# Files that contain information not relevant to running the code itself
18+
.dockerignore
19+
.flake8
20+
.gitignore
21+
.pylintrc
22+
changelog.md
23+
config.default.yml
24+
default.env
25+
docker-compose.yml
26+
Dockerfile
27+
LICENSE
28+
Makefile
29+
README.md

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
ignore = DCO010, DCO023, DOC503, DOC602, DOC603, MDA002, E203, E501, E712, F401, F403, F821, W503
33
style = google
44
skip-checking-short-docstrings = False
5+
exclude = .venv

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "pip" # See documentation for possible values
8+
- package-ecosystem: "uv" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
11-
interval: "weekly"
12-
open-pull-requests-limit: 10
11+
interval: "daily"
12+
open-pull-requests-limit: 20

.github/workflows/ci.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,16 @@ jobs:
1515
uses: actions/setup-python@v3
1616
with:
1717
python-version: 3.11
18-
- name: Install pip
19-
run: |
20-
python -m pip install pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile)
21-
- name: Install pipenv
22-
run: |
23-
PIPENV_VERSION=$(sed -nE 's/pipenv = "==(.*)"/\1/p' Pipfile)
24-
python -m pip install pipenv==$PIPENV_VERSION
25-
- name: Install from pipfile
26-
run: |
27-
pipenv install --system
18+
- name: Install uv
19+
run: python -m pip install --upgrade uv
20+
- name: Sync dependencies
21+
run: uv sync --frozen --all-extras
2822
- name: Analysing the code with black
2923
run: |
30-
black $(git rev-parse --show-toplevel) --check
24+
uv run black $(git rev-parse --show-toplevel) --check
3125
- name: Analysing the code with pylint
3226
run: |
33-
pylint $(git ls-files '*.py')
27+
uv run pylint $(git ls-files '*.py')
3428
- name: Check for CRLF line endings
3529
run: |
3630
for file in $(git ls-files); do
@@ -44,14 +38,13 @@ jobs:
4438
fi
4539
- name: Analysing the code with flake8
4640
run: |
47-
flake8 $(git rev-parse --show-toplevel)
41+
uv run flake8 $(git rev-parse --show-toplevel)
4842
- name: Analysing the code with isort
4943
run: |
50-
isort --check-only $(git rev-parse --show-toplevel)/ --profile black
44+
uv run isort --check-only $(git rev-parse --show-toplevel)/ --profile black
5145
- name: Running pytest
5246
run: |
53-
cd techsupport_bot
54-
python3.11 -m pytest tests/ -p no:warnings
47+
PYTHONPATH=. uv run pytest tests/ -p no:warnings
5548
5649
containerBuild:
5750
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.env
2+
.venv
23
config.yml
34
*.pyc
45
.vscode
@@ -8,3 +9,4 @@ __pycache__
89
.coverage
910
.hypothesis
1011
.idea/
12+
configuration/guild_configs

.pylintrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ persistent=yes
3636
# Specify a configuration file.
3737
#rcfile=
3838

39-
# When enabled, pylint would attempt to guess common misconfiguration and emit
40-
# user-friendly hints instead of false-positive error messages.
41-
suggestion-mode=yes
42-
4339
# Allow loading of arbitrary C extensions. Extensions are imported into the
4440
# active Python interpreter and may run arbitrary code.
4541
unsafe-load-any-extension=no

Dockerfile

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1-
FROM python:3.11-alpine
1+
FROM python:3.11-slim
22

3-
RUN apk update
4-
RUN apk add --no-cache postgresql-dev gcc musl-dev libpq git
3+
# Install OS dependencies
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
build-essential \
6+
gcc \
7+
git \
8+
libpq-dev \
9+
&& rm -rf /var/lib/apt/lists/*
510

11+
# Install uv
12+
RUN pip install --no-cache-dir uv
13+
14+
# App directory
615
WORKDIR /var/TechSupportBot
716

8-
COPY Pipfile .
9-
COPY Pipfile.lock .
17+
# Copy dependency files first for Docker layer caching
18+
COPY pyproject.toml uv.lock ./
1019

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

23+
# Copy project files
1524
COPY . .
1625

17-
WORKDIR /var/TechSupportBot/techsupport_bot
26+
# Move into bot directory
27+
WORKDIR /var/TechSupportBot
1828

19-
CMD python3 -u main.py
29+
# Run bot
30+
CMD ["uv", "run", "--", "python3", "-u", "main.py"]

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
image = rtechsupport/techsupport-bot
22
full-image = $(image):prod
3-
main_dir = techsupport_bot
43

54
ifeq ($(shell docker-compose -v > /dev/null 2>&1; echo $$?), 0)
65
DOCKER_COMPOSE_CMD := docker-compose
@@ -9,7 +8,8 @@ else
98
endif
109

1110
make sync:
12-
python3 -m pipenv sync -d
11+
uv lock
12+
uv sync --frozen
1313

1414
check-format:
1515
black --check ./
@@ -23,7 +23,7 @@ lint:
2323
pylint $(shell git ls-files '*.py')
2424

2525
test:
26-
PYTHONPATH=./techsupport_bot pytest techsupport_bot/tests/ -p no:warnings
26+
PYTHONPATH=./ pytest ./tests/ -p no:warnings
2727

2828
build:
2929
make establish_config

Pipfile

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)