Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies update #335

Merged
merged 8 commits into from
Jan 16, 2025
Merged
Changes from 1 commit
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
Next Next commit
feat: upgrade to python 3.12 and upgrade dependencies; use poetry
fivan999 authored and ArtemSBulgakov committed Jan 7, 2025
commit a5595f795c91ea0769a16b5b7e1e2a19aa02e7d5
9 changes: 5 additions & 4 deletions adminpage/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
ARG PYTHON_VERSION

FROM python:${PYTHON_VERSION}-slim
FROM python:${PYTHON_VERSION}-slim-bullseye
ENV PYTHONUNBUFFERED 1
ENV POETRY_VIRTUALENVS_CREATE=false
RUN mkdir /src
WORKDIR /src
COPY ./requirements.txt /src/
RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& apt-get install -y --no-install-recommends git libjpeg62-turbo-dev zlib1g-dev gcc python3-dev \
&& apt-get purge -y --auto-remove \
&& rm -rf /var/lib/apt/lists/*
RUN pip install -r /src/requirements.txt
COPY . /src
RUN pip install poetry
RUN poetry install --no-root
2 changes: 1 addition & 1 deletion adminpage/accounts/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib.auth.models import AbstractUser, BaseUserManager
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class UserManager(BaseUserManager):
2 changes: 1 addition & 1 deletion adminpage/api/crud/crud_attendance.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
from django.db.models import F, Value, BooleanField, Case, When, CharField, Sum, IntegerField, OuterRef
from django.db.models.functions import Concat, Coalesce
from django.db.models.expressions import Value, Case, When, Subquery, OuterRef, ExpressionWrapper
from typing_extensions import TypedDict
from typing import TypedDict

from django.db import connection

3 changes: 1 addition & 2 deletions adminpage/api/tests/api/test_attendance.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import unittest
from datetime import date, datetime, timedelta
from datetime import date, datetime, timedelta, timezone
from typing import Tuple

import pytest
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils import timezone
from rest_framework import status
from rest_framework.test import APIClient

1,255 changes: 1,255 additions & 0 deletions adminpage/poetry.lock

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions adminpage/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[tool.poetry]
name = "adminpage"
version = "0.1.0"
description = ""
authors = ["one_zero_eight"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
django = "5.1.3"
pyjwt = "2.4.0"
django-admin-autocomplete-filter = "^0.7.1"
drf-yasg = "^1.21.8"
openpyxl = "^3.1.5"
psycopg2-binary = "^2.9.10"
pytest = "^8.3.3"
pytest-django = "^4.9.0"
pytest-freezegun = { git = "https://github.com/oizik/pytest-freezegun.git", branch = "master" }
pillow = "9.5.0"
uvicorn = "^0.32.1"
django-import-export = "^4.3.1"
django-image-optimizer = "^1.0.3"
django-admin-rangefilter = "^0.13.2"
sentry-sdk = "^2.19.0"
django-revproxy = "^0.13.0"
django-sendfile2 = "^0.7.1"
django-prometheus = "^2.3.1"
beautifulsoup4 = "^4.12.3"
requests = "^2.32.3"
django-smartfields = { git = "https://github.com/ViniciusBernardo/django-smartfields.git", branch = "master" }
django-hijack = "^3.7.0"
django-tinymce = "^4.1.0"
django-auth-adfs = "^1.14.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
25 changes: 0 additions & 25 deletions adminpage/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion adminpage/sport/admin/attendanceAdmin.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
from django.urls import reverse
from django.utils.safestring import mark_safe
from openpyxl import Workbook
from rangefilter.filter import DateRangeFilter
from rangefilter.filters import DateRangeFilter

from sport.admin.utils import cache_filter, cache_dependent_filter, custom_order_filter, DefaultFilterMixIn
from sport.models import Attendance, Student, Semester
2 changes: 1 addition & 1 deletion adminpage/sport/admin/trainingAdmin.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ class TrainingFormWithCSV(forms.ModelForm):
queryset=Student.objects.exclude(medical_group__name='Medical checkup not passed'),
error_messages={'invalid_choice': 'The student has not passed medical check-up yet!'},
widget=AutocompleteSelectMultiple(
rel=AutocompleteStudent,
AutocompleteStudent,
admin_site=site,
attrs={'data-width': '50%'}
),
2 changes: 1 addition & 1 deletion adminpage/sport/admin/userAdmin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from hijack.contrib.admin import HijackUserAdminMixin

from .site import site
3 changes: 1 addition & 2 deletions adminpage/sport/tests/test_attendance_admin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from datetime import datetime, date
from datetime import datetime, date, timezone
from typing import Tuple, Iterable, Optional

import pytest
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.utils import timezone
from rest_framework.test import APIClient

from api.crud import mark_hours
2 changes: 1 addition & 1 deletion deploy/.env.example
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ TRAINING_EDITABLE_INTERVAL=14
# If production - comment the following line
DEBUG=1

PYTHON_VERSION=3.7
PYTHON_VERSION=3.12

oauth_appID=<your-app-id>
oauth_shared_secret=<your-app-secret>
2 changes: 1 addition & 1 deletion deploy/docker-compose.prod.yaml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ services:

db:
# See more: https://registry.hub.docker.com/_/postgres
image: "postgres:11-alpine"
image: "postgres:17.1-alpine"
restart: always
volumes:
- "db-data:/var/lib/postgresql/data"
6 changes: 4 additions & 2 deletions deploy/docker-compose.test.yaml
Original file line number Diff line number Diff line change
@@ -5,17 +5,19 @@ services:
build:
context: ../adminpage
args:
PYTHON_VERSION: 3.7
PYTHON_VERSION: 3.12
# Wait for postgres to startup before running server
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; python manage.py runserver 0.0.0.0:8000'
restart: unless-stopped
depends_on:
- db
env_file:
- .env.test
ports:
- 8000:8000

db:
image: postgres:11-alpine
image: postgres:17.1-alpine
restart: unless-stopped
env_file:
- .env.test
4 changes: 2 additions & 2 deletions deploy/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ services:
build:
context: ../adminpage
args:
- PYTHON_VERSION=3.7
- PYTHON_VERSION=3.12
# Wait for postgres to startup before running server
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; python manage.py runserver 0.0.0.0:8000'
restart: unless-stopped
@@ -38,7 +38,7 @@ services:

db:
# See more: https://registry.hub.docker.com/_/postgres
image: "postgres:11-alpine"
image: "postgres:17.1-alpine"
restart: unless-stopped
ports:
- "5432:5432"
Loading