Skip to content

Commit

Permalink
weekly cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
borisbrue committed Dec 15, 2021
1 parent 524b4cb commit 6ee3454
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 13 deletions.
12 changes: 11 additions & 1 deletion Makefile
Expand Up @@ -5,13 +5,16 @@ help: ## See what commands are available.
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36mmake %-15s\033[0m # %s\n", $$1, $$2}'


all: install clean test lint ## Install, test and lint the project.
all: install clean isort lint coverage ## Install, test and lint the project.

clean: ## Remove Python file artifacts.
@echo '== Cleanup =='
rm dist/* 2>/dev/null || true
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete

install: ## Install dependencies.
@echo '== Install all dependencies =='
poetry install

doc: ## create the docs.
Expand All @@ -21,16 +24,23 @@ flake8: ## Run flake8 on the project.
flake8 --select BLK wagtail_tenants/

black: ## Run flake8 on the project.
@echo '== Format the files =='
black wagtail_tenants/

isort: ## Run isort on the project.
@echo '== Sort the imports =='
isort wagtail_tenants/

lint: black flake8 isort ## Lint the project.

test: ## Test the project.
py.test

coverage:
@echo '== Run the tests and coverage =='
coverage run -m py.test
coverage report -m

build: ## Build the package.
@echo '== Cleanup =='
rm dist/* 2>/dev/null || true
Expand Down
62 changes: 61 additions & 1 deletion poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Expand Up @@ -15,6 +15,7 @@ myst-parser = "^0.15.2"
sphinx-rtd-theme = "^1.0.0"
psycopg2 = "^2.9.2"
python-dotenv = "^0.19.2"
coverage = "^6.2"

[tool.poetry.dev-dependencies]
black = "^21.11b1"
Expand Down
5 changes: 3 additions & 2 deletions wagtail_tenants/management/commands/create_tenant.py
@@ -1,5 +1,6 @@
from django_tenants.management.commands.create_tenant import \
Command as CreateTenantCommand
from django_tenants.management.commands.create_tenant import (
Command as CreateTenantCommand,
)


class Command(CreateTenantCommand):
Expand Down
@@ -1,5 +1,6 @@
from django_tenants.management.commands.create_tenant_superuser import \
Command as CreateTenantSuperuserCommand
from django_tenants.management.commands.create_tenant_superuser import (
Command as CreateTenantSuperuserCommand,
)


class Command(CreateTenantSuperuserCommand):
Expand Down
3 changes: 1 addition & 2 deletions wagtail_tenants/management/commands/migrate_schemas.py
@@ -1,5 +1,4 @@
from django_tenants.management.commands.migrate_schemas import \
MigrateSchemasCommand
from django_tenants.management.commands.migrate_schemas import MigrateSchemasCommand


class Command(MigrateSchemasCommand):
Expand Down
13 changes: 8 additions & 5 deletions wagtail_tenants/users/views/users.py
Expand Up @@ -15,11 +15,14 @@
from wagtail.core import hooks
from wagtail.core.log_actions import log
from wagtail.users.utils import user_can_delete_user
from wagtail.users.views.users import (add_user_perm, change_user_perm,
delete_user_perm,
get_user_creation_form,
get_user_edit_form,
get_users_filter_query)
from wagtail.users.views.users import (
add_user_perm,
change_user_perm,
delete_user_perm,
get_user_creation_form,
get_user_edit_form,
get_users_filter_query,
)

from wagtail_tenants.models import User
from wagtail_tenants.utils import check_tenant_for_user, is_client_tenant
Expand Down

0 comments on commit 6ee3454

Please sign in to comment.