Skip to content

Commit

Permalink
Merge pull request #1319 from watchdogpolska/dev
Browse files Browse the repository at this point in the history
v1.1.15: Dependencies update
  • Loading branch information
PiotrIw authored Dec 5, 2023
2 parents 82d6399 + 509c614 commit 09f2de6
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 44 deletions.
9 changes: 5 additions & 4 deletions .contrib/docker/Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ WORKDIR /code
ENV PYTHONUNBUFFERED 1
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
default-libmysqlclient-dev \
python3-dev default-libmysqlclient-dev build-essential \
default-mysql-client libssl-dev pkg-config \
gcc \
build-essential \
git \
curl \
gettext libgettextpo-dev wait-for-it \
&& rm -rf /var/lib/apt/lists/*
nano \
htop \
gettext libgettextpo-dev wait-for-it
COPY requirements/*.txt ./requirements/
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements/dev.txt
Expand Down
38 changes: 19 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@ default_language_version:
minimum_pre_commit_version: "1.20.0"
repos:
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.13.0
rev: 1.15.0
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
- id: django-upgrade
args: [--target-version, "3.2"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py3-only
- id: pyupgrade
args:
- --py3-only
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.22.0
rev: 0.27.0
hooks:
- id: check-github-workflows
- id: check-readthedocs
- repo: https://github.com/adrienverge/yamllint
rev: v1.31.0
- repo: https://github.com/adrienverge/yamllint
rev: v1.33.0
hooks:
- id: yamllint
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.11.0
hooks:
- id: black
args:
- --config
- ./pyproject.toml
- id: black
args:
- --config
- ./pyproject.toml
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
args:
- --config=./setup.cfg
- id: flake8
args:
- --config=./setup.cfg
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ sphinx:
configuration: docs/conf.py
formats: all

build:
os: ubuntu-22.04
tools:
python: "3.10"

python:
version: '3.7'
install:
- requirements: requirements/dev.txt
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ TEST=
db:
docker-compose up -d --remove-orphans db

up:
start: wait_mysql
docker-compose up

start:
run-background: wait_mysql
docker-compose up -d

stop:
Expand Down
9 changes: 6 additions & 3 deletions config/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,13 @@
DATABASES = {"default": env.db(default="mysql:///porady")}

DATABASES["default"]["TEST"] = {
"CHARSET": "utf8mb4",
"COLLATION": "utf8mb4_unicode_520_ci",
# "CHARSET": "utf8mb4",
# "COLLATION": "utf8mb4_unicode_520_ci",
"CHARSET": "utf8",
"COLLATION": "utf8_polish_ci",
}
DATABASES["default"]["CHARSET"] = "utf8mb4"
# DATABASES["default"]["CHARSET"] = "utf8mb4"
DATABASES["default"]["CHARSET"] = "utf"

# END DATABASE CONFIGURATION

Expand Down
14 changes: 11 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
---
# yamllint disable-line-length
version: '2.1'
# This is application’s services configuration for development purposes only.

services:
db:
image: mysql:5.7
image: mariadb:10.1
command: >-
--character-set-server=utf8
--collation-server=utf8_polish_ci
--max_allowed_packet=1024M
--sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
--innodb_large_prefix=ON
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: "password"
volumes:
- ./.contrib/docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
- mysql_db:/var/lib/mysql
- mariadb-data-03:/var/lib/mysql

gulp:
build:
Expand Down Expand Up @@ -77,5 +85,5 @@ services:
# - imap-to-webhook-url.env

volumes:
mysql_db:
mariadb-data-03:
maildump_data:
2 changes: 1 addition & 1 deletion poradnia/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.1.13"
__version__ = "1.1.15"


# Compatibility to eg. django-rest-framework
Expand Down
9 changes: 8 additions & 1 deletion poradnia/judgements/parsers/nsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@ class NSAETRParser(BaseParser):
"sygnatura": "",
"symbol": "",
"wydzial": "",
"typ": "",
}
HEADERS = {
"User-Agent": (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
" (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
)
}

def get_content(self):
response = requests.post(self.URL, data=self.POST_DATA)
response = requests.post(self.URL, data=self.POST_DATA, headers=self.HEADERS)
response.raise_for_status()
return response.text

Expand Down
7 changes: 2 additions & 5 deletions poradnia/judgements/tests/test_commands.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from io import StringIO

from django.core.management import call_command
from django.test import TestCase

from poradnia.judgements.factories import CourtFactory

try:
from StringIO import StringIO
except ImportError:
from io import StringIO


class RunCourtSessionParserTestCase(TestCase):
def test_run_command_basic(self):
Expand Down
2 changes: 1 addition & 1 deletion poradnia/letters/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get_html_from_eml_file(eml_file=None):
decoded_part = part.get_payload()

# Decode the part based on the content type and add it to the content
if type(decoded_part) == bytes:
if type(decoded_part) is bytes:
codec_map = {
None: "utf-8",
"windows-1252": "cp1252",
Expand Down
6 changes: 3 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django==3.2.18
Django==3.2.23

# Configuration
django-environ==0.10.0
Expand All @@ -21,7 +21,7 @@ sorl-thumbnail==12.9.0
django-allauth==0.54.0

# For the persistance stores
mysqlclient==2.1.1
mysqlclient==2.2.0

# Unicode slugification
unicode-slugify==0.1.5
Expand Down Expand Up @@ -53,7 +53,7 @@ sentry-sdk==1.21.0
python-dateutil==2.8.2
django-github-revision==0.0.3
zipstream-new==1.1.8
django-teryt-tree==0.17.0
django-teryt-tree==0.18.4
django-mptt==0.14.0
mistune==2.0.5
django-rosetta==0.9.9
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Local development dependencies go here
-r base.txt
Sphinx==6.2.1
Sphinx==7.2.6

# django-debug-toolbar that works with Django 1.5+
django-debug-toolbar==4.0.0
Expand Down

0 comments on commit 09f2de6

Please sign in to comment.