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 37689f1 commit 1e0538b
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 75 deletions.
16 changes: 0 additions & 16 deletions .flake8

This file was deleted.

15 changes: 11 additions & 4 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:

steps:
- name: Check out the repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: "3.12"

- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
Expand All @@ -47,6 +47,13 @@ jobs:
run: |
python manage.py check --fail-level WARNING
- name: Run pre-commit hook
uses: pre-commit/action@v3.0.0

- name: Run Pytest suite
run: |
pytest --create-db --disable-warnings
- name: Build docker image
run: |
docker build -t mantiby/manti.by:latest .
3 changes: 1 addition & 2 deletions .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ multi_line_output=3
line_length=120
include_trailing_comma=True
use_parentheses=True
skip=venv,env,migrations,.env,.venv

skip=venv,env,migrations,.env,.venv,__pycache__/,.pytest_cache/
34 changes: 11 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,32 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: fix-byte-order-marker
- id: check-ast
- id: check-docstring-first
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: pretty-format-json
- 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:
- id: isort
name: isort-local
entry: isort
language: python
types: [ python ]
exclude: .+/settings/.+
pass_filenames: true

- id: black
name: black-local
entry: black
language: python
language_version: python3.11
types: [python]
exclude: .+/settings/.+
pass_filenames: true

- id: prospector
name: prospector-local
entry: prospector --messages-only
Expand All @@ -41,19 +37,11 @@ repos:
exclude: .+/settings/.+
pass_filenames: true

- id: bandit
name: bandit
entry: bandit
language: python
language_version: python3
exclude: .+/tests/.+
types: [python]

- repo: https://github.com/thibaudcolas/curlylint
rev: v0.13.1
hooks:
- id: curlylint
types: [ file ]
files: \.html$
language_version: python3.11.1
files: \.(html|sls)$
language_version: python3.12
additional_dependencies: ['click<8.1']
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ check:
pre-commit run

django-checks:
python3 manage.py makemigrations --dry-run --check --verbosity=3
python manage.py makemigrations --dry-run --check --verbosity=3
python manage.py check --fail-level WARNING

test:
pytest
pytest manti_by/

pip:
pip install -r requirements.txt
Expand Down
40 changes: 17 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
[tool.pytest.ini_options]
log_cli = true
log_cli_format = "%(levelname)s %(asctime)s %(message)s"
django_find_project = true
addopts = '-p no:warnings --color=yes --ds=db_benchmarks.core.settings'
norecursedirs = '''
.git
'''

[tool.black]
line-length = 120
target_version = ['py311']
target_version = ['py312']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.idea
| \.venv
| \.pytest_cache
)/
'''

[tool.prospector]
exclude = '''
/(
\.git
| \.idea
| \.venv
| \.pytest_cache
)/
'''

[tool.bandit]
exclude = '''
/(
\.git
| \.idea
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| \.pytest_cache
| _build
| buck-out
| build
| dist
)/
'''

Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ DJANGO_SETTINGS_MODULE = manti_by.settings.sqlite
python_classes = *Test
filterwarnings =
ignore::DeprecationWarning
ignore::PendingDeprecationWarning
ignore::PendingDeprecationWarning
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ django-modeltranslation==0.18.11
exifread==3.0.0
gunicorn==21.2.0

ipython>=8.22.2
ipython>=8.23.0
pytest>=8.1.1
pytest-django>=4.8.0
fakeredis>=2.21.3

pre_commit>=3.6.2
pre_commit>=3.7.0
isort>=5.13.2
pyupgrade>=3.15.1
pyupgrade>=3.15.2
black>=24.3.0
prospector>=1.10.3
bandit>=1.7.8
pip-check-updates>=0.26.1
pip-check-updates>=0.26.1

0 comments on commit 1e0538b

Please sign in to comment.