From dcd8edaaa6d2797b9eabbedce1f2f3ac143675e3 Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Sun, 16 Jan 2022 22:49:21 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Add=20pre-commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Format code Add bin/run --- .pre-commit-config.yaml | 19 +++ README.md | 3 +- bbssite/urls.py | 2 +- bbssite/wsgi.py | 1 + bin/format | 6 +- bin/generate_schema | 2 +- bin/lint | 6 +- bin/run | 3 + bin/test | 1 + main/admin.py | 1 + main/api/errors.py | 2 +- main/api/mutations.py | 2 +- main/api/schema.py | 2 +- main/api/serializers.py | 4 +- main/api/views.py | 2 +- main/forms.py | 2 +- main/management/commands/export_schema.py | 6 +- main/management/commands/facebook_sync.py | 6 +- main/migrations/0001_initial.py | 2 +- main/testing.py | 9 +- main/tests/test_mutations.py | 16 +- main/urls.py | 14 +- main/views/general.py | 6 +- main/views/reports.py | 5 +- main/views/stats.py | 7 +- main/views/users.py | 8 +- poetry.lock | 172 +++++++++++++++++++++- pyproject.toml | 6 + 28 files changed, 264 insertions(+), 51 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 bin/run diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..514e695 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: local + hooks: + - id: black + name: black + entry: pipenv run black + exclude: model_config.py + args: [--check] + language: system + require_serial: true + types: [python] + - id: isort + name: isort + entry: pipenv run isort + args: [--check-only] + language: system + types: [python] diff --git a/README.md b/README.md index 56f0e2d..8066927 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,9 @@ Before starting, make sure you have a working python and nodejs setup with pyenv apt-get install libmysqlclient-dev poetry install poetry shell +pre-commit install python manage.py migrate -python manage.py runserver +bin/run # in another terminal cd frontend diff --git a/bbssite/urls.py b/bbssite/urls.py index 88a80dc..9b44b93 100755 --- a/bbssite/urls.py +++ b/bbssite/urls.py @@ -2,7 +2,7 @@ from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.contrib.auth.views import LoginView, LogoutView -from django.urls import path, re_path, include +from django.urls import include, path, re_path from strawberry.django.views import GraphQLView from main import urls as main_urls diff --git a/bbssite/wsgi.py b/bbssite/wsgi.py index aaacc7d..228a9a4 100644 --- a/bbssite/wsgi.py +++ b/bbssite/wsgi.py @@ -1,4 +1,5 @@ import os + from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bbssite.settings") diff --git a/bin/format b/bin/format index 370ed80..0f8a7dd 100755 --- a/bin/format +++ b/bin/format @@ -1,2 +1,6 @@ #!/bin/bash -black main bbssite + +SRC_DIR="main bbssite" + +black $SRC_DIR +isort $SRC_DIR \ No newline at end of file diff --git a/bin/generate_schema b/bin/generate_schema index 9864798..8a2533f 100755 --- a/bin/generate_schema +++ b/bin/generate_schema @@ -1,4 +1,4 @@ #!/bin/bash -set -eu + python manage.py export_schema cd frontend && npm run generate diff --git a/bin/lint b/bin/lint index 01db7b4..24a51ff 100755 --- a/bin/lint +++ b/bin/lint @@ -1,2 +1,6 @@ #!/bin/bash -black --check main bbssite + +SRC_DIR="main bbssite" + +black --check $SRC_DIR +isort --diff $SRC_DIR \ No newline at end of file diff --git a/bin/run b/bin/run new file mode 100644 index 0000000..4a65373 --- /dev/null +++ b/bin/run @@ -0,0 +1,3 @@ +#!/bin/bash + +python manage.py runserver \ No newline at end of file diff --git a/bin/test b/bin/test index b539efa..cd58336 100755 --- a/bin/test +++ b/bin/test @@ -1,2 +1,3 @@ #!/bin/bash + pytest -v \ No newline at end of file diff --git a/main/admin.py b/main/admin.py index eba38ec..1222dd7 100644 --- a/main/admin.py +++ b/main/admin.py @@ -1,4 +1,5 @@ from django.contrib import admin + from main.models import * diff --git a/main/api/errors.py b/main/api/errors.py index b2d8c98..37d65ae 100644 --- a/main/api/errors.py +++ b/main/api/errors.py @@ -18,5 +18,5 @@ class FieldError(Error): @strawberry.type class FormErrors: fields: list[FieldError] - message: str = '' + message: str = "" error: bool = True diff --git a/main/api/mutations.py b/main/api/mutations.py index d84408b..1912a03 100644 --- a/main/api/mutations.py +++ b/main/api/mutations.py @@ -6,7 +6,7 @@ from django.shortcuts import get_object_or_404 from strawberry import ID from main import models -from main.api.errors import Error, FormErrors, FieldError +from main.api.errors import Error, FieldError, FormErrors from main.api.types import Order, Transaction, UserProfile UserModel = get_user_model() diff --git a/main/api/schema.py b/main/api/schema.py index 75be7bc..b25b750 100644 --- a/main/api/schema.py +++ b/main/api/schema.py @@ -2,7 +2,7 @@ import strawberry import strawberry_django from main.api import mutations -from main.api.types import Product, User, Order +from main.api.types import Order, Product, User @strawberry.type diff --git a/main/api/serializers.py b/main/api/serializers.py index 2a00f87..aaa9a7d 100644 --- a/main/api/serializers.py +++ b/main/api/serializers.py @@ -1,8 +1,8 @@ -from django.db.models import Sum, Count +from django.db.models import Count, Sum from rest_framework import serializers from rest_framework.serializers import ModelSerializer -from main.models import Product, OrderLine, Order +from main.models import Order, OrderLine, Product class ProductSerializer(ModelSerializer): diff --git a/main/api/views.py b/main/api/views.py index be87511..26bc1cf 100644 --- a/main/api/views.py +++ b/main/api/views.py @@ -1,10 +1,10 @@ from rest_framework import mixins from rest_framework.decorators import action from rest_framework.response import Response +from rest_framework.viewsets import GenericViewSet from main.api.serializers import ProductSerializer, ProductStatSerializer from main.models import Product -from rest_framework.viewsets import GenericViewSet class ProductViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, GenericViewSet): diff --git a/main/forms.py b/main/forms.py index a9285e0..604ca3b 100644 --- a/main/forms.py +++ b/main/forms.py @@ -2,7 +2,7 @@ from django import forms from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ -from main.models import Order, Transaction, InventoryTransaction, Product, UserProfile +from main.models import InventoryTransaction, Order, Product, Transaction, UserProfile from main.utils import format_username diff --git a/main/management/commands/export_schema.py b/main/management/commands/export_schema.py index 24465e7..2c1aa29 100644 --- a/main/management/commands/export_schema.py +++ b/main/management/commands/export_schema.py @@ -11,13 +11,13 @@ class Command(BaseCommand): help = " Write graphql schema to file or stdout" def add_arguments(self, parser: CommandParser): - parser.add_argument("--filename", default='schema.graphql', help='`-` prints to stdout') + parser.add_argument("--filename", default="schema.graphql", help="`-` prints to stdout") def handle(self, *args, filename=None, **options): schema_output = print_schema(schema_symbol) - if filename != '-': + if filename != "-": with Path(BASE_DIR, filename).open("w+") as fp: fp.write(schema_output) - self.stdout.write(self.style.SUCCESS('OK')) + self.stdout.write(self.style.SUCCESS("OK")) else: print(schema_output) diff --git a/main/management/commands/facebook_sync.py b/main/management/commands/facebook_sync.py index b3f0d58..a81d59e 100644 --- a/main/management/commands/facebook_sync.py +++ b/main/management/commands/facebook_sync.py @@ -1,8 +1,8 @@ -from django.contrib.auth.models import User - import difflib -from django.core.management.base import BaseCommand, CommandError + import facebook +from django.contrib.auth.models import User +from django.core.management.base import BaseCommand, CommandError from main.models import UserProfile diff --git a/main/migrations/0001_initial.py b/main/migrations/0001_initial.py index fe7872a..2616844 100644 --- a/main/migrations/0001_initial.py +++ b/main/migrations/0001_initial.py @@ -1,5 +1,5 @@ -from django.db import migrations, models from django.conf import settings +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/main/testing.py b/main/testing.py index 2252fc1..c74b95e 100644 --- a/main/testing.py +++ b/main/testing.py @@ -1,15 +1,14 @@ from dataclasses import dataclass +from typing import Any, Iterable, Type -from django.contrib.auth.models import User -from graphql.pyutils import snake_to_camel import strawberry +from django.contrib.auth.models import User +from django.test.client import RequestFactory +from graphql.pyutils import snake_to_camel from strawberry.arguments import is_unset from strawberry.types import ExecutionResult from main.api.schema import schema -from typing import Any, Iterable, Type - -from django.test.client import RequestFactory def lowercase_first_letter(text: str): diff --git a/main/tests/test_mutations.py b/main/tests/test_mutations.py index 3a515b6..5e15a26 100644 --- a/main/tests/test_mutations.py +++ b/main/tests/test_mutations.py @@ -3,7 +3,7 @@ from django.test import Client from strawberry.django.test import GraphQLTestClient from main.api.mutations import create_order -from main.models import Product, Order +from main.models import Order, Product from main.testing import MutationTest @@ -12,12 +12,12 @@ def gql_client_fixture(client: Client): yield GraphQLTestClient(client) -@pytest.fixture(name='product') +@pytest.fixture(name="product") def product_fix(db): - return Product.objects.create(name='borg', sale_price_ext=35, sale_price_int=30) + return Product.objects.create(name="borg", sale_price_ext=35, sale_price_int=30) -@pytest.fixture(name='create_order_mutation') +@pytest.fixture(name="create_order_mutation") def create_order_mutation_fixture(product): fields = """ ... on CreateOrderSuccess { @@ -38,13 +38,15 @@ def create_order_mutation_fixture(product): def test_create_order(product, create_order_mutation): assert Order.objects.count() == 0 - res = create_order_mutation.mutate(customerId="external", isExternal=True, orderLines=[{"productId": product.id, "amount": 1}]) + res = create_order_mutation.mutate( + customerId="external", isExternal=True, orderLines=[{"productId": product.id, "amount": 1}] + ) assert res assert not res.errors assert res.data - order_lines = res.data.get('createOrder', {}).get('order', {}).get('orderlines', []) + order_lines = res.data.get("createOrder", {}).get("order", {}).get("orderlines", []) assert order_lines - assert order_lines[0]['product']['id'] == str(product.id) + assert order_lines[0]["product"]["id"] == str(product.id) assert Order.objects.count() == 1 o = Order.objects.first() assert o.orderlines.first().product.id == product.id diff --git a/main/urls.py b/main/urls.py index b8275f2..3f3f460 100644 --- a/main/urls.py +++ b/main/urls.py @@ -1,21 +1,21 @@ from django.conf.urls import url from django.contrib.staticfiles.views import serve from django.urls import path +from rest_framework.routers import DefaultRouter from main.api.views import ProductViewSet +from main.views.general import deposit, log, register +from main.views.reports import inventory, inventory_add, report from main.views.stats import ( - stats_list, - stats_products_realtime, - stats_products_per_user, - OrdersHourlyView, OrdersDailyView, + OrdersHourlyView, OrdersMonthlyView, OrdersYearlyView, + stats_list, + stats_products_per_user, + stats_products_realtime, ) -from main.views.general import register, deposit, log -from main.views.reports import inventory, inventory_add, report from main.views.users import create_user, profile -from rest_framework.routers import DefaultRouter urlpatterns = [ url(r"^$", register, name="home"), diff --git a/main/views/general.py b/main/views/general.py index b4d425a..16ebc40 100644 --- a/main/views/general.py +++ b/main/views/general.py @@ -6,11 +6,11 @@ from django.contrib.auth.models import User from django.db.models import Min from django.forms import formset_factory from django.http import HttpResponseRedirect -from django.shortcuts import render, redirect +from django.shortcuts import redirect, render from django.urls import reverse -from main.forms import OrderLineForm, OrderForm, DepositForm -from main.models import Product, OrderLine, Order, Transaction +from main.forms import DepositForm, OrderForm, OrderLineForm +from main.models import Order, OrderLine, Product, Transaction from main.utils import users_format_js, users_with_perm diff --git a/main/views/reports.py b/main/views/reports.py index f5653eb..663cf95 100644 --- a/main/views/reports.py +++ b/main/views/reports.py @@ -2,9 +2,10 @@ from datetime import datetime, timedelta from itertools import groupby from django.contrib import messages -from django.shortcuts import render, redirect +from django.shortcuts import redirect, render + from main.forms import DateRangeForm, InventoryTransactionForm -from main.models import Product, InventoryTransaction, UserProfile, Transaction, Order +from main.models import InventoryTransaction, Order, Product, Transaction, UserProfile def report(request): diff --git a/main/views/stats.py b/main/views/stats.py index a9aaf0f..2768839 100644 --- a/main/views/stats.py +++ b/main/views/stats.py @@ -1,12 +1,13 @@ import time from datetime import datetime, timedelta +from itertools import groupby + from django.http import JsonResponse from django.shortcuts import render from django.utils import timezone -from itertools import groupby - from django.views.generic import View -from main.models import Product, OrderLine, Order + +from main.models import Order, OrderLine, Product def stats_list(request): diff --git a/main/views/users.py b/main/views/users.py index 96747e0..5c86902 100644 --- a/main/views/users.py +++ b/main/views/users.py @@ -1,11 +1,11 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required from django.db import connection -from django.db.models import Sum, Count -from django.shortcuts import render, redirect +from django.db.models import Count, Sum +from django.shortcuts import redirect, render + from main.forms import SimpleCreateUserForm -from main.models import Order -from main.models import Transaction +from main.models import Order, Transaction def create_user(request): diff --git a/poetry.lock b/poetry.lock index 7ae65fb..498d77b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -73,6 +73,14 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "cfgv" +version = "3.3.1" +description = "Validate configuration and produce human readable error messages." +category = "dev" +optional = false +python-versions = ">=3.6.1" + [[package]] name = "charset-normalizer" version = "2.0.10" @@ -103,6 +111,14 @@ category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +[[package]] +name = "distlib" +version = "0.3.4" +description = "Distribution utilities" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "django" version = "3.2.11" @@ -176,6 +192,18 @@ python-versions = "*" [package.dependencies] requests = "*" +[[package]] +name = "filelock" +version = "3.4.2" +description = "A platform independent file lock." +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.extras] +docs = ["furo (>=2021.8.17b43)", "sphinx (>=4.1)", "sphinx-autodoc-typehints (>=1.12)"] +testing = ["covdefaults (>=1.2.0)", "coverage (>=4)", "pytest (>=4)", "pytest-cov", "pytest-timeout (>=1.4.2)"] + [[package]] name = "graphql-core" version = "3.1.7" @@ -198,6 +226,17 @@ gevent = ["gevent (>=1.4.0)"] setproctitle = ["setproctitle"] tornado = ["tornado (>=0.2)"] +[[package]] +name = "identify" +version = "2.4.4" +description = "File identification library for Python" +category = "dev" +optional = false +python-versions = ">=3.6.1" + +[package.extras] +license = ["ukkonen"] + [[package]] name = "idna" version = "3.3" @@ -214,6 +253,20 @@ category = "dev" optional = false python-versions = "*" +[[package]] +name = "isort" +version = "5.10.1" +description = "A Python utility / library to sort Python imports." +category = "dev" +optional = false +python-versions = ">=3.6.1,<4.0" + +[package.extras] +pipfile_deprecated_finder = ["pipreqs", "requirementslib"] +requirements_deprecated_finder = ["pipreqs", "pip-api"] +colors = ["colorama (>=0.4.3,<0.5.0)"] +plugins = ["setuptools"] + [[package]] name = "mypy-extensions" version = "0.4.3" @@ -230,6 +283,14 @@ category = "main" optional = false python-versions = ">=3.5" +[[package]] +name = "nodeenv" +version = "1.6.0" +description = "Node.js virtual environment builder" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "packaging" version = "21.3" @@ -281,6 +342,22 @@ python-versions = ">=3.6" dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "pre-commit" +version = "2.16.0" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +category = "dev" +optional = false +python-versions = ">=3.6.1" + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +toml = "*" +virtualenv = ">=20.0.8" + [[package]] name = "py" version = "1.11.0" @@ -374,6 +451,14 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "pyyaml" +version = "6.0" +description = "YAML parser and emitter for Python" +category = "dev" +optional = false +python-versions = ">=3.6" + [[package]] name = "requests" version = "2.27.1" @@ -527,10 +612,28 @@ brotli = ["brotlipy (>=0.6.0)"] secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] +[[package]] +name = "virtualenv" +version = "20.13.0" +description = "Virtual Python Environment builder" +category = "dev" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" + +[package.dependencies] +distlib = ">=0.3.1,<1" +filelock = ">=3.2,<4" +platformdirs = ">=2,<3" +six = ">=1.9.0,<2" + +[package.extras] +docs = ["proselint (>=0.10.2)", "sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=21.3)"] +testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "packaging (>=20.0)"] + [metadata] lock-version = "1.1" python-versions = "^3.9" -content-hash = "9fdb99c106e4571be6ab4c647a3ba82619f2070af271a932d84df1009eda039b" +content-hash = "60442762009c623d4b11858aeee04ea967f75683fd7790a3d950ef96c29ef623" [metadata.files] asgiref = [ @@ -557,6 +660,10 @@ certifi = [ {file = "certifi-2021.10.8-py2.py3-none-any.whl", hash = "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"}, {file = "certifi-2021.10.8.tar.gz", hash = "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"}, ] +cfgv = [ + {file = "cfgv-3.3.1-py2.py3-none-any.whl", hash = "sha256:c6a0883f3917a037485059700b9e75da2464e6c27051014ad85ba6aaa5884426"}, + {file = "cfgv-3.3.1.tar.gz", hash = "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736"}, +] charset-normalizer = [ {file = "charset-normalizer-2.0.10.tar.gz", hash = "sha256:876d180e9d7432c5d1dfd4c5d26b72f099d503e8fcc0feb7532c9289be60fcbd"}, {file = "charset_normalizer-2.0.10-py3-none-any.whl", hash = "sha256:cb957888737fc0bbcd78e3df769addb41fd1ff8cf950dc9e7ad7793f1bf44455"}, @@ -569,6 +676,10 @@ colorama = [ {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, ] +distlib = [ + {file = "distlib-0.3.4-py2.py3-none-any.whl", hash = "sha256:6564fe0a8f51e734df6333d08b8b94d4ea8ee6b99b5ed50613f731fd4089f34b"}, + {file = "distlib-0.3.4.zip", hash = "sha256:e4b58818180336dc9c529bfb9a0b58728ffc09ad92027a3f30b7cd91e3458579"}, +] django = [ {file = "Django-3.2.11-py3-none-any.whl", hash = "sha256:0a0a37f0b93aef30c4bf3a839c187e1175bcdeb7e177341da0cb7b8194416891"}, {file = "Django-3.2.11.tar.gz", hash = "sha256:69c94abe5d6b1b088bf475e09b7b74403f943e34da107e798465d2045da27e75"}, @@ -594,6 +705,10 @@ facebook-sdk = [ {file = "facebook_sdk-3.0.0-py2-none-any.whl", hash = "sha256:c94df84b2bba1c497684c169ed28a713b57917bf56f95fba4c2a5290c16ce81e"}, {file = "facebook_sdk-3.0.0-py3-none-any.whl", hash = "sha256:8ef0a0d2c98a515a926875bb4be9c9a4630a39fc8190bff8d5265d58af1ef257"}, ] +filelock = [ + {file = "filelock-3.4.2-py3-none-any.whl", hash = "sha256:cf0fc6a2f8d26bd900f19bf33915ca70ba4dd8c56903eeb14e1e7a2fd7590146"}, + {file = "filelock-3.4.2.tar.gz", hash = "sha256:38b4f4c989f9d06d44524df1b24bd19e167d851f19b50bf3e3559952dddc5b80"}, +] graphql-core = [ {file = "graphql-core-3.1.7.tar.gz", hash = "sha256:62ec192150ccecd9a18cfb79e3e72eb7d1fd68fb594ef19c40099b6deec8ef0c"}, {file = "graphql_core-3.1.7-py3-none-any.whl", hash = "sha256:9b460f60320be01c7f3b1766cf3e406933003008055079b9d983b8f3988f4400"}, @@ -602,6 +717,10 @@ gunicorn = [ {file = "gunicorn-20.1.0-py3-none-any.whl", hash = "sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e"}, {file = "gunicorn-20.1.0.tar.gz", hash = "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8"}, ] +identify = [ + {file = "identify-2.4.4-py2.py3-none-any.whl", hash = "sha256:aa68609c7454dbcaae60a01ff6b8df1de9b39fe6e50b1f6107ec81dcda624aa6"}, + {file = "identify-2.4.4.tar.gz", hash = "sha256:6b4b5031f69c48bf93a646b90de9b381c6b5f560df4cbe0ed3cf7650ae741e4d"}, +] idna = [ {file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"}, {file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"}, @@ -610,6 +729,10 @@ iniconfig = [ {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, ] +isort = [ + {file = "isort-5.10.1-py3-none-any.whl", hash = "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7"}, + {file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"}, +] mypy-extensions = [ {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, @@ -621,6 +744,10 @@ mysqlclient = [ {file = "mysqlclient-2.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:e6279263d5a9feca3e0edbc2b2a52c057375bf301d47da2089c075ff76331d14"}, {file = "mysqlclient-2.1.0.tar.gz", hash = "sha256:973235686f1b720536d417bf0a0d39b4ab3d5086b2b6ad5e6752393428c02b12"}, ] +nodeenv = [ + {file = "nodeenv-1.6.0-py2.py3-none-any.whl", hash = "sha256:621e6b7076565ddcacd2db0294c0381e01fd28945ab36bcf00f41c5daf63bef7"}, + {file = "nodeenv-1.6.0.tar.gz", hash = "sha256:3ef13ff90291ba2a4a7a4ff9a979b63ffdd00a464dbe04acf0ea6471517a4c2b"}, +] packaging = [ {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, @@ -671,6 +798,10 @@ pluggy = [ {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] +pre-commit = [ + {file = "pre_commit-2.16.0-py2.py3-none-any.whl", hash = "sha256:758d1dc9b62c2ed8881585c254976d66eae0889919ab9b859064fc2fe3c7743e"}, + {file = "pre_commit-2.16.0.tar.gz", hash = "sha256:fe9897cac830aa7164dbd02a4e7b90cae49630451ce88464bca73db486ba9f65"}, +] py = [ {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, @@ -702,6 +833,41 @@ pytz = [ {file = "pytz-2021.3-py2.py3-none-any.whl", hash = "sha256:3672058bc3453457b622aab7a1c3bfd5ab0bdae451512f6cf25f64ed37f5b87c"}, {file = "pytz-2021.3.tar.gz", hash = "sha256:acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326"}, ] +pyyaml = [ + {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, + {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, + {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, + {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, + {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4"}, + {file = "PyYAML-6.0-cp36-cp36m-win32.whl", hash = "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293"}, + {file = "PyYAML-6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57"}, + {file = "PyYAML-6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9"}, + {file = "PyYAML-6.0-cp37-cp37m-win32.whl", hash = "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737"}, + {file = "PyYAML-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d"}, + {file = "PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287"}, + {file = "PyYAML-6.0-cp38-cp38-win32.whl", hash = "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78"}, + {file = "PyYAML-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0"}, + {file = "PyYAML-6.0-cp39-cp39-win32.whl", hash = "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb"}, + {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, + {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, +] requests = [ {file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"}, {file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"}, @@ -746,3 +912,7 @@ urllib3 = [ {file = "urllib3-1.26.8-py2.py3-none-any.whl", hash = "sha256:000ca7f471a233c2251c6c7023ee85305721bfdf18621ebff4fd17a8653427ed"}, {file = "urllib3-1.26.8.tar.gz", hash = "sha256:0e7c33d9a63e7ddfcb86780aac87befc2fbddf46c58dbb487e0855f7ceec283c"}, ] +virtualenv = [ + {file = "virtualenv-20.13.0-py2.py3-none-any.whl", hash = "sha256:339f16c4a86b44240ba7223d0f93a7887c3ca04b5f9c8129da7958447d079b09"}, + {file = "virtualenv-20.13.0.tar.gz", hash = "sha256:d8458cf8d59d0ea495ad9b34c2599487f8a7772d796f9910858376d1600dd2dd"}, +] diff --git a/pyproject.toml b/pyproject.toml index 4586801..27f945c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,10 @@ DJANGO_SETTINGS_MODULE = "bbssite.settings" line-length = 120 target_version = ['py39'] +[tool.isort] +profile = "black" +line_length = 120 + [tool.poetry] name = "bbs" version = "0.1.0" @@ -31,6 +35,8 @@ django-cors-headers = "^3.10.0" pytest = "^6.2.5" black = "^21.9b0" pytest-django = "^4.5.1" +pre-commit = "^2.16.0" +isort = "^5.10.1" [build-system]