Skip to content

Commit

Permalink
Fix I002 Missing required import
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhelba authored and mvandenburgh committed Jan 22, 2024
1 parent d1f9fff commit 7b6d475
Show file tree
Hide file tree
Showing 103 changed files with 104 additions and 0 deletions.
1 change: 1 addition & 0 deletions dandiapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from importlib.metadata import version

# This project module is imported for us when Django starts. To ensure that Celery app is always
Expand Down
1 change: 1 addition & 0 deletions dandiapi/analytics/apps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.apps import AppConfig


Expand Down
1 change: 1 addition & 0 deletions dandiapi/analytics/migrations/0001_initial_v2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import django.core.validators
from django.db import migrations, models

Expand Down
1 change: 1 addition & 0 deletions dandiapi/analytics/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.core.validators import RegexValidator
from django.db import models

Expand Down
1 change: 1 addition & 0 deletions dandiapi/analytics/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from collections import Counter
from collections.abc import Generator
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions dandiapi/analytics/tests/test_download_counts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings
import pytest

Expand Down
2 changes: 2 additions & 0 deletions dandiapi/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# flake8: noqa
from __future__ import annotations

# TODO: remove this after migration is complete
import dandiapi.api.user_migration
1 change: 1 addition & 0 deletions dandiapi/api/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import csv

from allauth.socialaccount.models import SocialAccount
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/apps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import logging
import re

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/checks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings
from django.core.checks import Error, register

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/doi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import logging

from django.conf import settings
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/garbage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from datetime import timedelta

from django.db.models import Exists, OuterRef
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/management/commands/cleanup_blobs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings
import djclick as click
from storages.backends.s3 import S3Storage
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/management/commands/collect_garbage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import djclick as click

from dandiapi.api.garbage import stale_assets
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/management/commands/create_dev_dandiset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from uuid import uuid4

from django.conf import settings
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/management/commands/depose_placeholder.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.contrib.auth.models import User
import djclick as click

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/management/commands/depose_placeholders.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.contrib.auth.models import User
import djclick as click

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/management/commands/ingest_asset_paths.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import djclick as click

from dandiapi.api.asset_paths import add_version_asset_paths
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/management/commands/list_placeholders.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.contrib.auth.models import User
import djclick as click

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from difflib import ndiff
from pprint import pformat

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from dandischema import migrate
import djclick as click

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/management/commands/revalidate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import djclick as click

from dandiapi.api.models import Asset, Version
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/manifests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from contextlib import contextmanager
import tempfile
from typing import IO, Any, Generator, Iterable
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/migrations/0001_initial_v2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import uuid

from django.conf import settings
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/migrations/0001_stagingapplication.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/migrations/0002_asset_zarr.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.db import migrations, models
import django.db.models.deletion

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/migrations/0003_default_oauth_application.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.db import migrations
from django.db.models import Q
from oauth2_provider.settings import oauth2_settings
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/migrations/0004_merge.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.db import migrations


Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from .asset import Asset, AssetBlob, EmbargoedAssetBlob
from .asset_paths import AssetPath, AssetPathRelation
from .dandiset import Dandiset
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/models/metadata.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import datetime
from uuid import uuid4

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/models/oauth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from fnmatch import fnmatch

from django.core.exceptions import ValidationError
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/models/user.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.contrib.auth.models import User
from django.db import models
from django_extensions.db.models import TimeStampedModel
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/permissions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from rest_framework.permissions import SAFE_METHODS, BasePermission, IsAuthenticated

from dandiapi.api.models.user import UserMetadata
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/asset/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.db import transaction

from dandiapi.api.asset_paths import add_asset_paths, delete_asset_paths, get_conflicting_paths
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/asset/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from rest_framework import status

from dandiapi.api.services.exceptions import DandiError
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/dandiset/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.db import transaction

from dandiapi.api.models.dandiset import Dandiset
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/dandiset/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from rest_framework import status

from dandiapi.api.services.exceptions import DandiError
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/embargo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models import QuerySet
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/embargo/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from rest_framework import status

from dandiapi.api.services.exceptions import DandiError
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from rest_framework import status


Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/metadata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from celery.utils.log import get_task_logger
import dandischema.exceptions
from dandischema.metadata import aggregate_assets_summary, validate
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/metadata/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from rest_framework import status

from dandiapi.api.services.exceptions import DandiError
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/publish/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import datetime

from dandischema.metadata import aggregate_assets_summary, validate
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/publish/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from rest_framework import status

from dandiapi.api.services.exceptions import DandiError
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/services/version/metadata.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from dandischema.models import Dandiset as PydanticDandiset
from django.conf import settings

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/signals.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from allauth.account.signals import user_signed_up
from corsheaders.signals import check_request_enabled
from django.conf import settings
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from celery import shared_task
from celery.utils.log import get_task_logger

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tasks/scheduled.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module is imported from celery.py in a post-app-load hook.
"""
from __future__ import annotations
from collections.abc import Iterable
from datetime import timedelta
import time
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/factories.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import datetime
import hashlib

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/fuzzy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import re


Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_asset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import json
import os.path
from uuid import uuid4
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_asset_paths.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.db.models import Q, QuerySet
import pytest

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import pytest
from rest_framework.authtoken.models import Token

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_checksum.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import hashlib

from django.core.files.base import ContentFile
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_create_dev_dandiset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import pytest

from dandiapi.api.management.commands.create_dev_dandiset import create_dev_dandiset
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_dandiset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import datetime

from django.conf import settings
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_embargo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import pytest

from dandiapi.api.models import Dandiset
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_garbage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from datetime import timedelta

from django.utils import timezone
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_info.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings

from dandiapi import __version__
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_manifests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings
from django.core.files.base import ContentFile
from django.core.files.storage import Storage
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_permission.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import pytest
from rest_framework.permissions import SAFE_METHODS

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_search.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import pytest
from rest_framework.test import APIClient

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_stats.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import pytest


Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_tasks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import datetime
import hashlib

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_unembargo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import math
import os

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/tests/test_upload.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import os
import uuid

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/user_migration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import logging

from allauth.account.signals import user_logged_in
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/views/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from .asset import AssetViewSet, NestedAssetViewSet
from .auth import auth_token_view, authorize_view, user_questionnaire_form_view
from .dandiset import DandisetViewSet
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/views/common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from drf_yasg import openapi
from rest_framework.pagination import PageNumberPagination

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/views/dandiset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from allauth.socialaccount.models import SocialAccount
from django.contrib.auth.models import User
from django.db.models import Count, Max, OuterRef, Subquery, Sum
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/views/dashboard.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from allauth.socialaccount.models import SocialAccount
from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/views/info.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings
from drf_yasg.utils import no_body, swagger_auto_schema
from rest_framework import serializers
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/views/root.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings
from django.shortcuts import render

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/views/serializers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from collections import OrderedDict
from typing import Any

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/views/stats.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.contrib.auth.models import User
from django.views.decorators.cache import cache_page
from rest_framework.decorators import api_view
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/views/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.db import transaction
from django.utils.decorators import method_decorator
from django_filters import rest_framework as filters
Expand Down
1 change: 1 addition & 0 deletions dandiapi/asgi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import os

import configurations.importer
Expand Down
1 change: 1 addition & 0 deletions dandiapi/celery.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import os

from celery import Celery, signals
Expand Down
1 change: 1 addition & 0 deletions dandiapi/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from django.conf import settings
from django.core.files.storage import Storage
from minio_storage.storage import MinioStorage
Expand Down
Loading

0 comments on commit 7b6d475

Please sign in to comment.