Skip to content

Commit

Permalink
merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xxfeel committed Dec 18, 2023
2 parents d5015ca + 6c68d4a commit ffebb7f
Show file tree
Hide file tree
Showing 24 changed files with 131 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
rev: 6.1.0
hooks:
- id: flake8
exclude: migrations/|.*settings(\.py|/)?
exclude: migrations/|config/|.*settings(\.py|/)?
additional_dependencies:
- flake8-isort
- flake8-django
Expand All @@ -41,4 +41,4 @@ repos:
language: system
pass_filenames: false
entry: poetry export --without-hashes --output requirements/production.txt
files: ^(pyproject.toml|poetry.lock)$
files: ^(pyproject.toml|poetry.lock)$
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Определение переменных
PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
MANAGE_DIR := $(PROJECT_DIR)/adaptive_hockey_federation/manage.py
DJANGO_DIR := $(PROJECT_DIR)/adaptive_hockey_federation
POETRY_RUN := poetry run python
DJANGO_RUN := $(POETRY_RUN) $(MANAGE_DIR)
SHELL_GREEN = \033[32m
Expand All @@ -22,6 +23,7 @@ help:
@echo " createsuperuser - $(SHELL_GREEN)Команда для создания супер-юзера.$(SHELL_NC)"
@echo " run - $(SHELL_GREEN)Команда для локального запуска проекта.$(SHELL_NC)"
@echo " fill-db - $(SHELL_GREEN)Команда для заполнения базы данных с помощью парсера.$(SHELL_NC)"
@echo " pytest - $(SHELL_GREEN)Команда для прогона юнит тестов pytest.$(SHELL_NC)"
@echo " help - $(SHELL_GREEN)Команда вызова справки.$(SHELL_NC)"
@echo "$(SHELL_YELLOW)Для запуска исполнения команд используйте данные ключи совместно с командой 'make', например 'make init-app'."
@echo "При запуске команды 'make' без какого либо ключа, происходит вызов справки.$(SHELL_NC)"
Expand Down Expand Up @@ -66,4 +68,9 @@ shell:
fill-db:
cd $(PROJECT_DIR) && $(DJANGO_RUN) fill-db

# Прогон тестов с помощью pytest
pytest:
cd $(DJANGO_DIR) && pytest


.PHONY: help
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

os.environ.setdefault(
'DJANGO_SETTINGS_MODULE',
'adaptive_hockey_federation.settings'
'core.config.dev_settings',
)

application = get_asgi_application()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# import environ

BASE_DIR = Path(__file__).resolve().parent.parent
BASE_DIR = Path(__file__).resolve().parent.parent.parent

# env = environ.Env(DEBUG=(bool, False))

Expand Down Expand Up @@ -41,7 +41,7 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'adaptive_hockey_federation.urls'
ROOT_URLCONF = 'core.urls'

TEMPLATES_DIR = BASE_DIR / 'templates'

Expand All @@ -61,7 +61,7 @@
},
]

WSGI_APPLICATION = 'adaptive_hockey_federation.wsgi.application'
WSGI_APPLICATION = 'core.wsgi.application'

DATABASES = {
'default': {
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.core.management.base import BaseCommand

from adaptive_hockey_federation.settings import RESOURSES_ROOT
from adaptive_hockey_federation.core.config.dev_settings import RESOURSES_ROOT


class Command(BaseCommand):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

os.environ.setdefault(
'DJANGO_SETTINGS_MODULE',
'adaptive_hockey_federation.settings'
'core.config.dev_settings',
)

application = get_wsgi_application()
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.8 on 2023-12-16 13:59

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('main', '0002_alter_player_patronymic'),
]

operations = [
migrations.AlterField(
model_name='player',
name='patronymic',
field=models.CharField(blank=True, default='--пусто--', help_text='Отчество', max_length=256, verbose_name='Отчество'),
),
]
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'adaptive_hockey_federation.settings')
'core.config.dev_settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/parser/docx_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import docx # type: ignore

from adaptive_hockey_federation.core.user_card import BaseUserInfo
from adaptive_hockey_federation.parser.user_card import BaseUserInfo

NAME = '[И|и][М|м][Я|я]'
SURNAME = '[Ф|ф][А|а][М|м][И|и][Л|л][И|и][Я|я]'
Expand Down
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/parser/xlsx_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import openpyxl

from adaptive_hockey_federation.core.user_card import BaseUserInfo
from adaptive_hockey_federation.parser.user_card import BaseUserInfo


def xlsx_parser(path: str) -> list[BaseUserInfo]:
Expand Down
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from phonenumber_field.modelfields import PhoneNumberField
from phonenumber_field.validators import validate_international_phonenumber

from adaptive_hockey_federation.constants import (
from core.constants import (
EMAIL_MAX_LENGTH,
NAME_MAX_LENGTH,
QUERY_SET_LENGTH,
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sleep 5
app/.venv/bin/python manage.py collectstatic --noinput
mv /static/* /app/static/

exec "$@"
exec "$@"
66 changes: 65 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ openpyxl-stubs = "^0.1.25"
click = "^8.1.7"
wrapt = "^1.16.0"
django-phonenumber-field = {extras = ["phonenumbers"], version = "^7.2.0"}
pytest-django = "^4.7.0"

[tool.poetry.group.dev.dependencies]
isort = "^5.12.0"
Expand Down Expand Up @@ -51,16 +52,21 @@ mypy_path = "./adaptive_hockey_federation"

[[tool.mypy.overrides]]
module = [
"adaptive_hockey_federation.core.user_card",
"adaptive_hockey_federation.parser.user_card",
"adaptive_hockey_federation.parser.*",
"phonenumber_field.*"
"phonenumber_field.*",
"adaptive_hockey_federation.core.config.dev_settings",
]
ignore_missing_imports = true


[tool.django-stubs]
django_settings_module = "adaptive_hockey_federation.settings"
django_settings_module = "adaptive_hockey_federation.core.config.dev_settings"


[tool.poetry.scripts]
parser = "adaptive_hockey_federation.parser.parser:parsing_file"
parser = "adaptive_hockey_federation.parser.parser:parsing_file"

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "adaptive_hockey_federation.core.config.test_settings"
python_files = ["test_*.py"]
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
python_paths = adaptive_hockey_federation/
DJANGO_SETTINGS_MODULE = core.config.test_settings
testpaths = tests/
python_files = test_*.py
8 changes: 6 additions & 2 deletions requirements/develop.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
asgiref==3.7.2 ; python_version >= "3.11" and python_version < "4.0"
cfgv==3.4.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"
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-extensions==3.2.3 ; python_version >= "3.11" and python_version < "4.0"
django-phonenumber-field[phonenumbers]==7.2.0 ; python_version >= "3.11" and python_version < "4.0"
Expand All @@ -10,6 +10,7 @@ et-xmlfile==1.1.0 ; python_version >= "3.11" and python_version < "4.0"
filelock==3.13.1 ; python_version >= "3.11" and python_version < "4.0"
gunicorn==21.2.0 ; python_version >= "3.11" and python_version < "4.0"
identify==2.5.33 ; python_version >= "3.11" and python_version < "4.0"
iniconfig==2.0.0 ; python_version >= "3.11" and python_version < "4.0"
isort==5.13.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.7.1 ; python_version >= "3.11" and python_version < "4.0"
Expand All @@ -19,12 +20,15 @@ openpyxl==3.1.2 ; python_version >= "3.11" and python_version < "4.0"
packaging==23.2 ; python_version >= "3.11" and python_version < "4.0"
phonenumbers==8.13.26 ; python_version >= "3.11" and python_version < "4.0"
platformdirs==4.1.0 ; python_version >= "3.11" and python_version < "4.0"
pluggy==1.3.0 ; python_version >= "3.11" and python_version < "4.0"
pre-commit==3.5.0 ; python_version >= "3.11" and python_version < "4.0"
pytest-django==4.7.0 ; python_version >= "3.11" and python_version < "4.0"
pytest==7.4.3 ; python_version >= "3.11" and python_version < "4.0"
pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "4.0"
setuptools==69.0.2 ; python_version >= "3.11" and python_version < "4.0"
sqlparse==0.4.4 ; python_version >= "3.11" and python_version < "4.0"
types-openpyxl==3.1.0.32 ; python_version >= "3.11" and python_version < "4.0"
typing-extensions==4.9.0 ; python_version >= "3.11" and python_version < "4.0"
tzdata==2023.3 ; python_version >= "3.11" and python_version < "4.0" and sys_platform == "win32"
virtualenv==20.25.0 ; python_version >= "3.11" and python_version < "4.0"
wrapt==1.16.0 ; python_version >= "3.11" and python_version < "4.0"
wrapt==1.16.0 ; python_version >= "3.11" and python_version < "4.0"
8 changes: 6 additions & 2 deletions requirements/production.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
asgiref==3.7.2 ; 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"
colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32")
django-phonenumber-field[phonenumbers]==7.2.0 ; python_version >= "3.11" and python_version < "4.0"
django==4.2.8 ; python_version >= "3.11" and python_version < "4.0"
et-xmlfile==1.1.0 ; python_version >= "3.11" and python_version < "4.0"
gunicorn==21.2.0 ; python_version >= "3.11" and python_version < "4.0"
iniconfig==2.0.0 ; 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.7.1 ; 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.2 ; python_version >= "3.11" and python_version < "4.0"
packaging==23.2 ; python_version >= "3.11" and python_version < "4.0"
phonenumbers==8.13.26 ; python_version >= "3.11" and python_version < "4.0"
pluggy==1.3.0 ; python_version >= "3.11" and python_version < "4.0"
pytest-django==4.7.0 ; python_version >= "3.11" and python_version < "4.0"
pytest==7.4.3 ; python_version >= "3.11" and python_version < "4.0"
sqlparse==0.4.4 ; python_version >= "3.11" and python_version < "4.0"
types-openpyxl==3.1.0.32 ; python_version >= "3.11" and python_version < "4.0"
typing-extensions==4.9.0 ; python_version >= "3.11" and python_version < "4.0"
tzdata==2023.3 ; python_version >= "3.11" and python_version < "4.0" and sys_platform == "win32"
wrapt==1.16.0 ; python_version >= "3.11" and python_version < "4.0"
wrapt==1.16.0 ; python_version >= "3.11" and python_version < "4.0"
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ignore =
exclude =
tests/,
*/migrations/,
*/config/,
venv/,
.venv/,
env/
Expand Down

0 comments on commit ffebb7f

Please sign in to comment.