From dbb7746c2423358b4b59d1872fa4a6d72ec4c90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=93=D0=BE=D0=B2=D0=BE=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D1=81=D0=BA=D0=B8=D0=B9?= Date: Tue, 8 Oct 2024 21:45:23 +0500 Subject: [PATCH] remove yadisk --- .../core/config/base_settings.py | 1 - adaptive_hockey_federation/core/constants.py | 10 --- adaptive_hockey_federation/core/urls.py | 17 ---- adaptive_hockey_federation/core/validators.py | 8 -- poetry.lock | 79 +------------------ pyproject.toml | 2 - requirements/develop.txt | 5 -- requirements/production.txt | 70 ---------------- 8 files changed, 1 insertion(+), 191 deletions(-) diff --git a/adaptive_hockey_federation/core/config/base_settings.py b/adaptive_hockey_federation/core/config/base_settings.py index a302f32c..1111277c 100644 --- a/adaptive_hockey_federation/core/config/base_settings.py +++ b/adaptive_hockey_federation/core/config/base_settings.py @@ -30,7 +30,6 @@ EXTERNAL_APPS = [ "phonenumber_field", "rest_framework", - "drf_yasg", ] LOCAL_APPS = [ diff --git a/adaptive_hockey_federation/core/constants.py b/adaptive_hockey_federation/core/constants.py index edc76084..63726c55 100644 --- a/adaptive_hockey_federation/core/constants.py +++ b/adaptive_hockey_federation/core/constants.py @@ -183,13 +183,3 @@ class Directory: GAMES = "games" PLAYER_VIDEO_DIR = "player_video" UNLOAD_DIR = "unloads_data" - - -class YadiskDirectory(StrEnum): - """Директории на Яндекс.Диске.""" - - GAMES = "games" - PLAYER_GAMES = "player_games" - - -PLAYER_GAME_NAME = "{surname}_{name[0]}_{patronymic[0]}_{game_name}.mp4" diff --git a/adaptive_hockey_federation/core/urls.py b/adaptive_hockey_federation/core/urls.py index ee983117..9bb66996 100644 --- a/adaptive_hockey_federation/core/urls.py +++ b/adaptive_hockey_federation/core/urls.py @@ -2,27 +2,10 @@ from django.conf.urls.static import static from django.contrib import admin from django.urls import include, path -from drf_yasg import openapi -from drf_yasg.views import get_schema_view -from rest_framework import permissions -schema_view = get_schema_view( - openapi.Info( - title="API", - default_version="v1", - description="API для управления данными игроков и игр", - ), - public=True, - permission_classes=(permissions.AllowAny,), -) urlpatterns = [ path("admin/", admin.site.urls), - path( - "api/docs/", - schema_view.with_ui("swagger", cache_timeout=0), - name="schema-swagger-ui", - ), path("", include("main.urls", namespace="main")), path("", include("users.urls", namespace="users")), path("", include("competitions.urls", namespace="competitions")), diff --git a/adaptive_hockey_federation/core/validators.py b/adaptive_hockey_federation/core/validators.py index cfecf8b0..4ea233b5 100644 --- a/adaptive_hockey_federation/core/validators.py +++ b/adaptive_hockey_federation/core/validators.py @@ -3,7 +3,6 @@ from core.constants import AgeLimits from django.core.exceptions import ValidationError from django.core.validators import RegexValidator -from django.utils.timezone import now as django_now def fio_validator() -> RegexValidator: @@ -40,10 +39,3 @@ def validate_date_birth(value: datetime.date): f"Возраст должен быть от {AgeLimits.MIN_AGE_PLAYER}" f"до {AgeLimits.MAX_AGE_PLAYER} лет", ) - - -def validate_game_date(date: datetime.date) -> datetime.date: - """Проверка валидности даты игры. Дата не должна быть больше текущей.""" - if date > django_now(): - raise ValidationError("Игра не может проходить в будущем") - return date diff --git a/poetry.lock b/poetry.lock index cd25d711..fdefc695 100644 --- a/poetry.lock +++ b/poetry.lock @@ -375,30 +375,6 @@ idna = ["idna (>=3.6)"] trio = ["trio (>=0.23)"] wmi = ["wmi (>=1.5.1)"] -[[package]] -name = "drf-yasg" -version = "1.21.7" -description = "Automated generation of real Swagger/OpenAPI 2.0 schemas from Django Rest Framework code." -optional = false -python-versions = ">=3.6" -files = [ - {file = "drf-yasg-1.21.7.tar.gz", hash = "sha256:4c3b93068b3dfca6969ab111155e4dd6f7b2d680b98778de8fd460b7837bdb0d"}, - {file = "drf_yasg-1.21.7-py3-none-any.whl", hash = "sha256:f85642072c35e684356475781b7ecf5d218fff2c6185c040664dd49f0a4be181"}, -] - -[package.dependencies] -django = ">=2.2.16" -djangorestframework = ">=3.10.3" -inflection = ">=0.3.1" -packaging = ">=21.0" -pytz = ">=2021.1" -pyyaml = ">=5.1" -uritemplate = ">=3.0.0" - -[package.extras] -coreapi = ["coreapi (>=2.3.3)", "coreschema (>=0.0.4)"] -validation = ["swagger-spec-validator (>=2.1.0)"] - [[package]] name = "email-validator" version = "2.2.0" @@ -666,17 +642,6 @@ files = [ {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, ] -[[package]] -name = "inflection" -version = "0.5.1" -description = "A port of Ruby on Rails inflector to Python" -optional = false -python-versions = ">=3.5" -files = [ - {file = "inflection-0.5.1-py2.py3-none-any.whl", hash = "sha256:f38b2b640938a4f35ade69ac3d053042959b62a0f1076a5bbaa1b9526605a8a2"}, - {file = "inflection-0.5.1.tar.gz", hash = "sha256:1a29730d366e996aaacffb2f1f1cb9593dc38e2ddd30c91250c6dde09ea9b417"}, -] - [[package]] name = "iniconfig" version = "2.0.0" @@ -1631,17 +1596,6 @@ files = [ [package.extras] dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatch", "invoke (==2.2.0)", "more-itertools (==10.2.0)", "pbr (==6.0.0)", "pluggy (==1.4.0)", "py (==1.11.0)", "pytest (==8.0.0)", "pytest-cov (==4.1.0)", "pytest-timeout (==2.2.0)", "pyyaml (==6.0.1)", "ruff (==0.2.1)"] -[[package]] -name = "pytz" -version = "2024.1" -description = "World timezone definitions, modern and historical" -optional = false -python-versions = "*" -files = [ - {file = "pytz-2024.1-py2.py3-none-any.whl", hash = "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"}, - {file = "pytz-2024.1.tar.gz", hash = "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812"}, -] - [[package]] name = "pyyaml" version = "6.0.1" @@ -1941,17 +1895,6 @@ files = [ {file = "tzdata-2024.1.tar.gz", hash = "sha256:2674120f8d891909751c38abcdfd386ac0a5a1127954fbc332af6b5ceae07efd"}, ] -[[package]] -name = "uritemplate" -version = "4.1.1" -description = "Implementation of RFC 6570 URI Templates" -optional = false -python-versions = ">=3.6" -files = [ - {file = "uritemplate-4.1.1-py2.py3-none-any.whl", hash = "sha256:830c08b8d99bdd312ea4ead05994a38e8936266f84b9a7878232db50b044e02e"}, - {file = "uritemplate-4.1.1.tar.gz", hash = "sha256:4346edfc5c3b79f694bccd6d6099a322bbeb628dbf2cd86eea55a456ce5124f0"}, -] - [[package]] name = "urllib3" version = "2.2.2" @@ -2317,27 +2260,7 @@ files = [ {file = "wrapt-1.16.0.tar.gz", hash = "sha256:5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d"}, ] -[[package]] -name = "yadisk" -version = "3.1.0" -description = "Библиотека-клиент REST API Яндекс.Диска / Yandex.Disk REST API client library" -optional = false -python-versions = ">=3.8" -files = [ - {file = "yadisk-3.1.0-py3-none-any.whl", hash = "sha256:cddc3a07f541bb005f135e8fbeff6980797494e54b6703c26830ca64d38e00e1"}, - {file = "yadisk-3.1.0.tar.gz", hash = "sha256:7228fad42007e1ff8becc48ca9bfa357398f68fa50fe597672d4bf92d99e6685"}, -] - -[package.extras] -aiohttp = ["aiohttp"] -async-defaults = ["aiofiles", "httpx"] -async-files = ["aiofiles"] -httpx = ["httpx"] -pycurl = ["pycurl"] -requests = ["requests"] -sync-defaults = ["requests"] - [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "b99147fc299b35960293efae5d15509d6f1a341dd16aa51a60bd3a2552d8f356" +content-hash = "2cae052e40f8b35f5e50005033667dadfceb25fb7bd46b4cc0706e15d670ec3d" diff --git a/pyproject.toml b/pyproject.toml index ac25ba25..f0b6556a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,9 +24,7 @@ types-python-dateutil = "^2.8.19.20240106" pytest-subtests = "^0.12.1" djangorestframework = "^3.15.1" -drf-yasg = "^1.21.7" -yadisk = "^3.1.0" [tool.poetry.group.dev.dependencies] setuptools = "^70.0.0" ruff = "^0.4.5" diff --git a/requirements/develop.txt b/requirements/develop.txt index f83ebd67..8fa0fc9a 100644 --- a/requirements/develop.txt +++ b/requirements/develop.txt @@ -14,7 +14,6 @@ django-phonenumber-field[phonenumbers]==7.3.0 ; python_version >= "3.11" and pyt django==4.2.13 ; python_version >= "3.11" and python_version < "4.0" djangorestframework==3.15.2 ; python_version >= "3.11" and python_version < "4.0" dnspython==2.6.1 ; python_version >= "3.11" and python_version < "4.0" -drf-yasg==1.21.7 ; python_version >= "3.11" and python_version < "4.0" email-validator==2.2.0 ; python_version >= "3.11" and python_version < "4.0" et-xmlfile==1.1.0 ; python_version >= "3.11" and python_version < "4.0" factory-boy==3.3.0 ; python_version >= "3.11" and python_version < "4.0" @@ -29,7 +28,6 @@ httptools==0.6.1 ; python_version >= "3.11" and python_version < "4.0" httpx==0.27.0 ; python_version >= "3.11" and python_version < "4.0" identify==2.5.36 ; python_version >= "3.11" and python_version < "4.0" idna==3.7 ; python_version >= "3.11" and python_version < "4.0" -inflection==0.5.1 ; python_version >= "3.11" and python_version < "4.0" iniconfig==2.0.0 ; python_version >= "3.11" and python_version < "4.0" jinja2==3.1.4 ; python_version >= "3.11" and python_version < "4.0" markdown-it-py==3.0.0 ; python_version >= "3.11" and python_version < "4.0" @@ -58,7 +56,6 @@ pytest==8.2.2 ; python_version >= "3.11" and python_version < "4.0" python-dateutil==2.9.0.post0 ; python_version >= "3.11" and python_version < "4.0" python-dotenv==1.0.1 ; python_version >= "3.11" and python_version < "4.0" python-multipart==0.0.9 ; python_version >= "3.11" and python_version < "4.0" -pytz==2024.1 ; python_version >= "3.11" and python_version < "4.0" pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "4.0" rich==13.7.1 ; python_version >= "3.11" and python_version < "4.0" ruff==0.4.10 ; python_version >= "3.11" and python_version < "4.0" @@ -74,11 +71,9 @@ types-pillow==10.2.0.20240520 ; python_version >= "3.11" and python_version < "4 types-python-dateutil==2.9.0.20240316 ; python_version >= "3.11" and python_version < "4.0" typing-extensions==4.12.2 ; python_version >= "3.11" and python_version < "4.0" tzdata==2024.1 ; python_version >= "3.11" and python_version < "4.0" and sys_platform == "win32" -uritemplate==4.1.1 ; python_version >= "3.11" and python_version < "4.0" uvicorn[standard]==0.30.5 ; python_version >= "3.11" and python_version < "4.0" uvloop==0.19.0 ; (sys_platform != "win32" and sys_platform != "cygwin") and platform_python_implementation != "PyPy" and python_version >= "3.11" and python_version < "4.0" virtualenv==20.26.3 ; python_version >= "3.11" and python_version < "4.0" watchfiles==0.23.0 ; python_version >= "3.11" and python_version < "4.0" websockets==12.0 ; python_version >= "3.11" and python_version < "4.0" wrapt==1.16.0 ; python_version >= "3.11" and python_version < "4.0" -yadisk==3.1.0 ; python_version >= "3.11" and python_version < "4.0" diff --git a/requirements/production.txt b/requirements/production.txt index 2ffd0322..a8be9bf4 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -1,100 +1,30 @@ - -amqp==5.2.0 ; python_version >= "3.11" and python_version < "4.0" -annotated-types==0.7.0 ; python_version >= "3.11" and python_version < "4.0" -anyio==4.4.0 ; python_version >= "3.11" and python_version < "4.0" asgiref==3.8.1 ; python_version >= "3.11" and python_version < "4.0" attrs==23.2.0 ; python_version >= "3.11" and python_version < "4.0" -billiard==4.2.0 ; python_version >= "3.11" and python_version < "4.0" -certifi==2024.6.2 ; python_version >= "3.11" and python_version < "4.0" -cfgv==3.4.0 ; python_version >= "3.11" and python_version < "4.0" -click-didyoumean==0.3.1 ; python_version >= "3.11" and python_version < "4.0" -click-plugins==1.1.1 ; python_version >= "3.11" and python_version < "4.0" -click-repl==0.3.0 ; python_version >= "3.11" and python_version < "4.0" click==8.1.7 ; python_version >= "3.11" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32") -distlib==0.3.8 ; python_version >= "3.11" and python_version < "4.0" -django-debug-toolbar==4.4.2 ; python_version >= "3.11" and python_version < "4.0" django-environ==0.11.2 ; python_version >= "3.11" and python_version < "4" django-extensions==3.2.3 ; python_version >= "3.11" and python_version < "4.0" django-phonenumber-field[phonenumbers]==7.3.0 ; python_version >= "3.11" and python_version < "4.0" django==4.2.13 ; python_version >= "3.11" and python_version < "4.0" djangorestframework==3.15.2 ; python_version >= "3.11" and python_version < "4.0" -dnspython==2.6.1 ; python_version >= "3.11" and python_version < "4.0" -drf-yasg==1.21.7 ; python_version >= "3.11" and python_version < "4.0" -email-validator==2.2.0 ; python_version >= "3.11" and python_version < "4.0" et-xmlfile==1.1.0 ; python_version >= "3.11" and python_version < "4.0" -factory-boy==3.3.0 ; python_version >= "3.11" and python_version < "4.0" -faker==26.0.0 ; python_version >= "3.11" and python_version < "4.0" -fastapi-cli[standard]==0.0.5 ; python_version >= "3.11" and python_version < "4.0" -fastapi[standard]==0.112.0 ; python_version >= "3.11" and python_version < "4.0" -filelock==3.15.4 ; python_version >= "3.11" and python_version < "4.0" gunicorn==21.2.0 ; python_version >= "3.11" and python_version < "4.0" -h11==0.14.0 ; python_version >= "3.11" and python_version < "4.0" -httpcore==1.0.5 ; python_version >= "3.11" and python_version < "4.0" -httptools==0.6.1 ; python_version >= "3.11" and python_version < "4.0" -httpx==0.27.0 ; python_version >= "3.11" and python_version < "4.0" -humanize==4.9.0 ; python_version >= "3.11" and python_version < "4.0" -identify==2.5.36 ; python_version >= "3.11" and python_version < "4.0" -idna==3.7 ; python_version >= "3.11" and python_version < "4.0" -inflection==0.5.1 ; python_version >= "3.11" and python_version < "4.0" iniconfig==2.0.0 ; python_version >= "3.11" and python_version < "4.0" -jinja2==3.1.4 ; python_version >= "3.11" and python_version < "4.0" -kombu==5.3.7 ; python_version >= "3.11" and python_version < "4.0" -markdown-it-py==3.0.0 ; python_version >= "3.11" and python_version < "4.0" -markupsafe==2.1.5 ; python_version >= "3.11" and python_version < "4.0" -mdurl==0.1.2 ; python_version >= "3.11" and python_version < "4.0" mypy-extensions==1.0.0 ; python_version >= "3.11" and python_version < "4.0" mypy==1.10.1 ; python_version >= "3.11" and python_version < "4.0" -nodeenv==1.9.1 ; python_version >= "3.11" and python_version < "4.0" -numpy==2.0.0 ; python_version >= "3.11" and python_version < "4.0" -opencv-python-headless==4.10.0.84 ; python_version >= "3.11" and python_version < "4.0" openpyxl-stubs==0.1.25 ; python_version >= "3.11" and python_version < "4.0" openpyxl==3.1.5 ; python_version >= "3.11" and python_version < "4.0" packaging==24.1 ; python_version >= "3.11" and python_version < "4.0" phonenumbers==8.13.39 ; python_version >= "3.11" and python_version < "4.0" pillow==10.3.0 ; python_version >= "3.11" and python_version < "4.0" -platformdirs==4.2.2 ; python_version >= "3.11" and python_version < "4.0" pluggy==1.5.0 ; python_version >= "3.11" and python_version < "4.0" -pre-commit==3.5.0 ; python_version >= "3.11" and python_version < "4.0" -prometheus-client==0.20.0 ; python_version >= "3.11" and python_version < "4.0" -prompt-toolkit==3.0.47 ; python_version >= "3.11" and python_version < "4.0" psycopg2-binary==2.9.9 ; python_version >= "3.11" and python_version < "4.0" -pydantic-core==2.20.1 ; python_version >= "3.11" and python_version < "4.0" -pydantic==2.8.2 ; python_version >= "3.11" and python_version < "4.0" -pygments==2.18.0 ; python_version >= "3.11" and python_version < "4.0" pytest-django==4.8.0 ; python_version >= "3.11" and python_version < "4.0" pytest-subtests==0.12.1 ; python_version >= "3.11" and python_version < "4.0" pytest==8.2.2 ; python_version >= "3.11" and python_version < "4.0" -python-dateutil==2.9.0.post0 ; python_version >= "3.11" and python_version < "4.0" -python-dotenv==1.0.1 ; python_version >= "3.11" and python_version < "4.0" -python-multipart==0.0.9 ; python_version >= "3.11" and python_version < "4.0" -pytz==2024.1 ; python_version >= "3.11" and python_version < "4.0" -pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "4.0" -rich==13.7.1 ; python_version >= "3.11" and python_version < "4.0" -requests==2.32.3 ; python_version >= "3.11" and python_version < "4.0" -ruff==0.4.10 ; python_version >= "3.11" and python_version < "4.0" -setuptools==70.1.1 ; python_version >= "3.11" and python_version < "4.0" -shellingham==1.5.4 ; python_version >= "3.11" and python_version < "4.0" -six==1.16.0 ; python_version >= "3.11" and python_version < "4.0" -sniffio==1.3.1 ; python_version >= "3.11" and python_version < "4.0" -pytz==2024.1 ; python_version >= "3.11" and python_version < "4.0" -pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "4.0" sqlparse==0.5.0 ; python_version >= "3.11" and python_version < "4.0" -starlette==0.37.2 ; python_version >= "3.11" and python_version < "4.0" -tornado==6.4.1 ; python_version >= "3.11" and python_version < "4.0" -typer==0.12.3 ; python_version >= "3.11" and python_version < "4.0" types-openpyxl==3.1.4.20240626 ; python_version >= "3.11" and python_version < "4.0" -types-pillow==10.2.0.20240520 ; python_version >= "3.11" and python_version < "4.0" types-python-dateutil==2.9.0.20240316 ; python_version >= "3.11" and python_version < "4.0" typing-extensions==4.12.2 ; python_version >= "3.11" and python_version < "4.0" tzdata==2024.1 ; python_version >= "3.11" and python_version < "4.0" and sys_platform == "win32" -uritemplate==4.1.1 ; python_version >= "3.11" and python_version < "4.0" -uvicorn[standard]==0.30.5 ; python_version >= "3.11" and python_version < "4.0" -uvloop==0.19.0 ; (sys_platform != "win32" and sys_platform != "cygwin") and platform_python_implementation != "PyPy" and python_version >= "3.11" and python_version < "4.0" -vine==5.1.0 ; python_version >= "3.11" and python_version < "4.0" -virtualenv==20.26.3 ; python_version >= "3.11" and python_version < "4.0" -watchfiles==0.23.0 ; python_version >= "3.11" and python_version < "4.0" -wcwidth==0.2.13 ; python_version >= "3.11" and python_version < "4.0" -websockets==12.0 ; python_version >= "3.11" and python_version < "4.0" wrapt==1.16.0 ; python_version >= "3.11" and python_version < "4.0" -yadisk==3.1.0 ; python_version >= "3.11" and python_version < "4.0"