Skip to content

Commit

Permalink
refact: cleanup imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfermigier committed Nov 5, 2024
1 parent 5b93567 commit d46d3ab
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 26 deletions.
1 change: 0 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ lint.extend-ignore = [
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"SLF001", # Private member accessed
"T201", # `print` found
"TID252", # Relative imports from parent modules are banned
"UP032", # Use f-strings
]

Expand Down
4 changes: 2 additions & 2 deletions src/abilian/sbe/apps/calendar/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from toolz import groupby

from abilian.i18n import _l
from abilian.sbe.apps.communities.blueprint import CommunityBlueprint
from abilian.sbe.apps.communities.views import default_view_kw
from abilian.web import url_for, views
from abilian.web.action import ButtonAction

from ..communities.blueprint import CommunityBlueprint
from ..communities.views import default_view_kw
from .forms import EventForm
from .models import Event

Expand Down
2 changes: 1 addition & 1 deletion src/abilian/sbe/apps/documents/webdav/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from werkzeug.wrappers import Response

from abilian.core.extensions import db
from abilian.sbe.apps.documents import repository
from abilian.services import get_service

from .. import repository
from .constants import (
DAV_PROPS,
HTTP_BAD_REQUEST,
Expand Down
6 changes: 3 additions & 3 deletions src/abilian/sbe/apps/forum/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@

from abilian.core.util import utc_dt
from abilian.i18n import _, _l
from abilian.sbe.apps.communities.blueprint import CommunityBlueprint
from abilian.sbe.apps.communities.common import activity_time_format, object_viewers
from abilian.sbe.apps.communities.security import is_manager
from abilian.sbe.apps.communities.views import default_view_kw
from abilian.services.viewtracker import viewtracker
from abilian.web import url_for, views
from abilian.web.action import ButtonAction, Endpoint
from abilian.web.nav import BreadcrumbItem
from abilian.web.views import default_view

from ..communities.blueprint import CommunityBlueprint
from ..communities.common import activity_time_format, object_viewers
from ..communities.views import default_view_kw
from .forms import PostEditForm, PostForm, ThreadForm
from .models import Post, PostAttachment, Thread
from .tasks import send_post_by_email
Expand Down
3 changes: 1 addition & 2 deletions src/abilian/sbe/apps/notifications/tasks/social.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
from abilian.sbe.apps.documents.models import Document
from abilian.sbe.apps.documents.repository import content_repository
from abilian.sbe.apps.forum.models import Post, Thread
from abilian.sbe.apps.notifications import TOKEN_SERIALIZER_NAME
from abilian.sbe.apps.wiki.models import WikiPage
from abilian.services import get_service
from abilian.services.activity import ActivityEntry
from abilian.services.auth.views import get_serializer
from abilian.web import url_for

from .. import TOKEN_SERIALIZER_NAME


@crontab("SCHEDULE_SEND_DAILY_SOCIAL_DIGEST")
@dramatiq.actor()
Expand Down
5 changes: 4 additions & 1 deletion src/abilian/sbe/apps/notifications/views/social.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
from abilian.i18n import render_template_i18n
from abilian.sbe.apps.communities.security import require_admin
from abilian.sbe.apps.notifications import TOKEN_SERIALIZER_NAME
from abilian.sbe.apps.notifications.tasks.social import (
make_message,
send_daily_social_digest_to,
)
from abilian.services import get_service
from abilian.services.auth.views import get_token_status
from abilian.services.preferences.service import PreferenceService

from ..tasks.social import make_message, send_daily_social_digest_to
from . import notifications

__all__ = ()
Expand Down
3 changes: 1 addition & 2 deletions src/abilian/services/antivirus/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from loguru import logger

from abilian.core.models.blob import Blob

from ..base import Service
from abilian.services.base import Service

try:
from clamd import ClamdError, ClamdUnixSocket
Expand Down
2 changes: 1 addition & 1 deletion src/abilian/setup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
from flask_talisman import DEFAULT_CSP_POLICY, Talisman

from abilian.core import extensions, signals
from abilian.extensions import asset_manager
from abilian.services import settings_service
from abilian.services.security import Anonymous
from abilian.web.access_blueprint import allow_access_for_roles
from abilian.web.nav import setup_nav_and_breadcrumbs

from ..extensions import asset_manager
from .blueprints import setup_blueprints
from .debug import setup_debug
from .extensions import init_extensions, init_sentry
Expand Down
4 changes: 2 additions & 2 deletions src/abilian/web/views/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from abilian.i18n import _, _l
from abilian.services import get_service
from abilian.services.security import CREATE, DELETE, READ, WRITE
from abilian.web import csrf, forms, nav
from abilian.web.action import ButtonAction, Endpoint, actions

from .. import csrf, forms, nav
from ..action import ButtonAction, Endpoint, actions
from .base import JSONView, View


Expand Down
3 changes: 1 addition & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from pytest import fixture

from abilian.sbe.app import create_app

from ..conftest import TestConfig
from tests.conftest import TestConfig

PUBLIC_ENDPOINTS = [
"login.forgotten_pw_form",
Expand Down
3 changes: 1 addition & 2 deletions tests/sbe/apps/documents/test_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
from abilian.sbe.apps.documents.models import Document, Folder
from abilian.sbe.apps.documents.views.folders import explore_archive
from abilian.services import index_service, security_service

from ....util import login, redis_available
from tests.util import login, redis_available


def open_file(filename: str) -> IO[bytes]:
Expand Down
2 changes: 1 addition & 1 deletion tests/sbe/apps/forum/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
from abilian.sbe.apps.forum.views import ThreadCreate
from abilian.services import get_service, security_service
from abilian.services.indexing.service import IndexService
from tests.util import client_login, redis_available

from ....util import client_login, redis_available
from .util import get_string_from_file


Expand Down
3 changes: 1 addition & 2 deletions tests/sbe/apps/wiki/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

from abilian.sbe.apps.wiki.markup import SBEWikiLinkExtension
from abilian.sbe.apps.wiki.models import WikiPage

from ....util import client_login
from tests.util import client_login


@pytest.mark.parametrize("text", ["TOTO", "x 123", "/#$", "/*€("])
Expand Down
3 changes: 1 addition & 2 deletions tests/services/test_vocabularies.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from abilian.services.vocabularies.models import BaseVocabulary, Vocabulary
from abilian.services.vocabularies.service import vocabularies
from abilian.web import url_for

from ..util import path_from_url
from tests.util import path_from_url

# DefaultVoc = Vocabulary('defaultstates', group='', label='States')

Expand Down
3 changes: 1 addition & 2 deletions tests/web/test_views_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
# noinspection PyUnresolvedReferences
from abilian.web.views import default_view
from abilian.web.views.registry import Registry

from ..util import class_fqn
from tests.util import class_fqn


class RegEntity(Entity):
Expand Down

0 comments on commit d46d3ab

Please sign in to comment.