Skip to content

Commit

Permalink
Upgrade project
Browse files Browse the repository at this point in the history
  • Loading branch information
manti-by committed Apr 1, 2024
1 parent c6f05f7 commit 2eda639
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 27 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"

- name: Cache pip
uses: actions/cache@v3
Expand Down Expand Up @@ -62,3 +62,7 @@ jobs:
- name: Run Pytest suite
run: |
pytest --create-db --disable-warnings --ds=semkov.settings.test semkov/
- name: Build docker image
run: |
docker build -t mantiby/semkov:latest .
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py311-plus]
args: [--py312-plus]

- repo: local
hooks:
Expand All @@ -43,5 +43,5 @@ repos:
- id: curlylint
types: [ file ]
files: \.(html|sls)$
language_version: python3.11
language_version: python3.12
additional_dependencies: ['click<8.1']
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim
FROM python:3.12-slim

# Add directories
RUN mkdir -p /srv/semkov/src/ && \
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ restore:
docker cp database.sql semkov-postgres:/tmp/database.sql
docker exec -it semkov-postgres psql -U semkov semkov -f /tmp/database.sql

update-requirements:
pcu requirements.txt -u

update-data:
./manage.py update_transport
./manage.py update_positions

update-requirements:
pcu requirements.txt -u
pre-commit autoupdate

pip:
pip install -r requirements.txt

test:
pytest --create-db --disable-warnings --ds=semkov.settings.test semkov/

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ norecursedirs = '''

[tool.black]
line-length = 120
target_version = ['py311']
target_version = ['py312']
include = '\.pyi?$'
exclude = '''
/(
Expand Down
15 changes: 7 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
wagtail==5.2.2
wagtail==6.0.1
pillow==10.2.0
twilio==8.13.0
gunicorn==21.2.0
psycopg2_binary==2.9.9
requests==2.31.0

pytest>=8.0.0
pytest>=8.1.1
pytest-django>=4.8.0

pre_commit>=3.6.1
pre_commit>=3.7.0
isort>=5.13.2
pyupgrade>=3.15.0
black>=24.1.1
pyupgrade>=3.15.2
black>=24.3.0
prospector>=1.10.3
bandit>=1.7.7
pip-check-updates>=0.23.1
bandit>=1.7.8
pip-check-updates>=0.26.1
2 changes: 1 addition & 1 deletion semkov/apps/search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.shortcuts import render

from wagtail.models import Page
from wagtail.search.models import Query
from wagtail.contrib.search_promotions.models import Query


def search(request):
Expand Down
15 changes: 6 additions & 9 deletions semkov/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@
}
}


# Models settings

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"


# Cache backend
# https://docs.djangoproject.com/en/2.1/topics/cache/

Expand Down Expand Up @@ -196,15 +202,6 @@
DEFAULT_FROM_EMAIL = "no-reply@manti.by"
DEFAULT_TO_EMAIL = "manti.by@gmail.com"

# Twilio account

TWILIO_FROM_NUMBER = None
TWILIO_ACCOUNT_SID = None
TWILIO_AUTH_TOKEN = None


DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

# Scrappers

POSITION_PAGE_SLUG = os.environ.get("POSITION_PAGE_SLUG", "ispolkom")
Expand Down

0 comments on commit 2eda639

Please sign in to comment.