Skip to content

Commit

Permalink
fix: run isort on imports
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq committed Mar 21, 2024
1 parent 2e8399e commit 91fd749
Show file tree
Hide file tree
Showing 33 changed files with 60 additions and 51 deletions.
2 changes: 1 addition & 1 deletion taxonomy/algolia/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from taxonomy.algolia.constants import EMBEDDED_OBJECT_LENGTH_CAP
from taxonomy.constants import JOB_SOURCE_COURSE_SKILL, JOB_SOURCE_INDUSTRY
from taxonomy.models import Job, JobPostings, JobSkills, IndustryJobSkill, B2CJobAllowList
from taxonomy.models import B2CJobAllowList, IndustryJobSkill, Job, JobPostings, JobSkills


class JobPostingSerializer(serializers.ModelSerializer):
Expand Down
3 changes: 2 additions & 1 deletion taxonomy/api/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Filters for the Taxonomy connector APIs.
"""

from django.db.models import Prefetch
from django_filters import rest_framework as filters

from django.db.models import Prefetch

from taxonomy.models import Skill, XBlockSkills


Expand Down
2 changes: 1 addition & 1 deletion taxonomy/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import permissions
from rest_framework.filters import OrderingFilter
from rest_framework.generics import RetrieveAPIView, ListAPIView
from rest_framework.generics import ListAPIView, RetrieveAPIView
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin
from rest_framework.response import Response
from rest_framework.views import APIView
Expand Down
1 change: 1 addition & 0 deletions taxonomy/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from datetime import date

from dateutil.relativedelta import relativedelta

from django.conf import settings


Expand Down
4 changes: 2 additions & 2 deletions taxonomy/emsi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import logging
from functools import wraps
from time import time, sleep
from time import sleep, time
from urllib.parse import urljoin

import requests
Expand All @@ -16,8 +16,8 @@

from django.conf import settings

from taxonomy.exceptions import TaxonomyAPIError
from taxonomy.constants import EMSI_API_RATE_LIMIT_PER_SEC
from taxonomy.exceptions import TaxonomyAPIError

LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 1 addition & 2 deletions taxonomy/management/commands/fetch_skill_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

from edx_django_utils.db import chunked_queryset

from django.db.models import Q
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q

from taxonomy.emsi.client import EMSISkillsApiClient
from taxonomy.emsi.parsers.skill_parsers import SkillDataParser
from taxonomy.exceptions import TaxonomyAPIError
from taxonomy.models import Skill, SkillCategory, SkillSubCategory


LOGGER = logging.getLogger(__name__)


Expand Down
2 changes: 1 addition & 1 deletion taxonomy/management/commands/refresh_job_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from taxonomy.emsi.client import EMSIJobsApiClient
from taxonomy.enums import RankingFacet
from taxonomy.exceptions import TaxonomyAPIError
from taxonomy.models import Job, JobSkills, Skill, IndustryJobSkill, Industry
from taxonomy.models import Industry, IndustryJobSkill, Job, JobSkills, Skill

LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion taxonomy/management/commands/refresh_program_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from taxonomy import utils
from taxonomy.choices import ProductTypes
from taxonomy.exceptions import ProgramMetadataNotFoundError, InvalidCommandOptionsError
from taxonomy.exceptions import InvalidCommandOptionsError, ProgramMetadataNotFoundError
from taxonomy.models import RefreshProgramSkillsConfig
from taxonomy.providers.utils import get_program_metadata_provider

Expand Down
7 changes: 4 additions & 3 deletions taxonomy/management/commands/refresh_xblock_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

import logging

from django.core.management.base import BaseCommand
from django.conf import settings
from django.utils.translation import gettext as _
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey, UsageKey

from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils.translation import gettext as _

from taxonomy import utils
from taxonomy.choices import ProductTypes
from taxonomy.exceptions import InvalidCommandOptionsError, XBlockMetadataNotFoundError
Expand Down
3 changes: 2 additions & 1 deletion taxonomy/migrations/0018_auto_20220613_0249.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Generated by Django 3.2.12 on 2022-06-13 02:49

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

import model_utils.fields


Expand Down
6 changes: 4 additions & 2 deletions taxonomy/migrations/0020_programskill.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Generated by Django 3.2.12 on 2022-08-01 11:50

from django.db import migrations, models
import uuid

import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

import model_utils.fields
import uuid


class Migration(migrations.Migration):
Expand Down
6 changes: 4 additions & 2 deletions taxonomy/migrations/0021_recreate_programskill.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Generated by Django 3.2.12 on 2022-08-12 11:50

from django.db import migrations, models
import uuid

import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

import model_utils.fields
import uuid


class Migration(migrations.Migration):
Expand Down
6 changes: 4 additions & 2 deletions taxonomy/migrations/0022_auto_20220825_0206.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Generated by Django 3.2.15 on 2022-08-25 02:06

from django.db import migrations, models
import uuid

import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

import model_utils.fields
import uuid


class Migration(migrations.Migration):
Expand Down
1 change: 1 addition & 0 deletions taxonomy/migrations/0025_industry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by Django 3.2.15 on 2022-10-17 06:41

from django.db import migrations, models

from taxonomy.constants import NAICS2_CODES


Expand Down
2 changes: 1 addition & 1 deletion taxonomy/migrations/0026_auto_20221101_0936.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.2.16 on 2022-11-01 09:36

from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
3 changes: 2 additions & 1 deletion taxonomy/migrations/0027_auto_20221117_0746.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Generated by Django 3.2.16 on 2022-11-17 07:46

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

import model_utils.fields


Expand Down
3 changes: 2 additions & 1 deletion taxonomy/migrations/0028_xblock_skills.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Generated by Django 3.2.16 on 2022-11-28 01:41

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

import model_utils.fields


Expand Down
3 changes: 2 additions & 1 deletion taxonomy/migrations/0031_auto_20230417_1557.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Generated by Django 3.2.18 on 2023-04-17 15:57

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

import model_utils.fields


Expand Down
3 changes: 2 additions & 1 deletion taxonomy/migrations/0032_auto_20230508_1428.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Generated by Django 3.2.19 on 2023-05-08 14:28

from django.db import migrations, models
import django.utils.timezone
from django.db import migrations, models

import model_utils.fields


Expand Down
2 changes: 1 addition & 1 deletion taxonomy/migrations/0033_b2c_allowlist.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.2.18 on 2023-06-15 16:19

from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
2 changes: 1 addition & 1 deletion taxonomy/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from taxonomy.providers.utils import (
get_course_metadata_provider,
get_program_metadata_provider,
get_xblock_metadata_provider
get_xblock_metadata_provider,
)

LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion taxonomy/validators/xblock_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
All host platform must run this validator to make sure providers are working as expected.
"""
from taxonomy.providers.utils import get_xblock_metadata_provider
from taxonomy.providers import XBlockContent
from taxonomy.providers.utils import get_xblock_metadata_provider


class XBlockMetadataProviderValidator:
Expand Down
2 changes: 1 addition & 1 deletion test_utils/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from taxonomy.choices import UserGoal
from taxonomy.models import (
B2CJobAllowList,
CourseRunXBlockSkillsTracker,
CourseSkills,
Industry,
Expand All @@ -30,7 +31,6 @@
Translation,
XBlockSkillData,
XBlockSkills,
B2CJobAllowList,
)

FAKER = FakerFactory.create()
Expand Down
2 changes: 1 addition & 1 deletion test_utils/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
CourseRunMetadataProvider,
ProgramMetadataProvider,
XBlockContent,
XBlockMetadataProvider
XBlockMetadataProvider,
)
from taxonomy.providers.course_run_metadata import CourseRunContent
from test_utils.mocks import MockCourse, MockCourseRun, MockProgram, MockXBlock
Expand Down
3 changes: 2 additions & 1 deletion tests/algolia/test_serializers.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""
Tests for algolia serializers.
"""
from django.test import TestCase
import mock
from pytest import mark

from django.test import TestCase

from taxonomy.algolia.serializers import JobSerializer
from taxonomy.models import Job
from test_utils import factories
Expand Down
2 changes: 1 addition & 1 deletion tests/emsi/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import logging
from time import time
from unittest import mock
from faker import Faker

import responses
from faker import Faker
from pytest import raises
from requests import HTTPError
from testfixtures import LogCapture
Expand Down
10 changes: 4 additions & 6 deletions tests/management/test_fetch_skill_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
Tests for the django management command `fetch_skill_details`.
"""
import responses
from pytest import mark, raises
from faker import Faker
from pytest import mark, raises

from django.core.management import call_command
from django.core.management.base import CommandError

from test_utils import factories
from test_utils.testcase import TaxonomyTestCase

from taxonomy.models import Skill, SkillCategory, SkillSubCategory
from taxonomy.emsi.client import EMSISkillsApiClient
from taxonomy.emsi.parsers.skill_parsers import INVALID_NAMES

from taxonomy.models import Skill, SkillCategory, SkillSubCategory
from test_utils import factories
from test_utils.testcase import TaxonomyTestCase

FAKER = Faker()

Expand Down
2 changes: 1 addition & 1 deletion tests/management/test_refresh_job_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from taxonomy.enums import RankingFacet
from taxonomy.exceptions import TaxonomyAPIError
from taxonomy.models import Job, JobSkills, Skill, Industry, IndustryJobSkill
from taxonomy.models import Industry, IndustryJobSkill, Job, JobSkills, Skill
from test_utils.factories import SkillFactory
from test_utils.sample_responses.jobs import JOBS, MISSING_SIGNIFICANCE_KEY_JOBS
from test_utils.testcase import TaxonomyTestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/management/test_refresh_program_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from django.core.management import call_command

from taxonomy.exceptions import ProgramMetadataNotFoundError, InvalidCommandOptionsError, TaxonomyAPIError
from taxonomy.exceptions import InvalidCommandOptionsError, ProgramMetadataNotFoundError, TaxonomyAPIError
from taxonomy.models import ProgramSkill, RefreshProgramSkillsConfig, Skill
from test_utils.mocks import MockProgram, mock_as_dict
from test_utils.providers import DiscoveryProgramMetadataProvider
Expand Down
4 changes: 2 additions & 2 deletions tests/management/test_refresh_xblock_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
from taxonomy.exceptions import InvalidCommandOptionsError, TaxonomyAPIError, XBlockMetadataNotFoundError
from taxonomy.models import (
CourseRunXBlockSkillsTracker,
Skill,
RefreshXBlockSkillsConfig,
Skill,
XBlockSkillData,
XBlockSkills
XBlockSkills,
)
from test_utils.mocks import MockCourseRun, MockXBlock, mock_as_dict
from test_utils.providers import DiscoveryCourseRunMetadataProvider, DiscoveryXBlockMetadataProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from django.core.exceptions import ValidationError
from django.test import TestCase

from taxonomy.models import Industry, Job, JobPostings, B2CJobAllowList
from taxonomy.models import B2CJobAllowList, Industry, Job, JobPostings
from taxonomy.signals.handlers import generate_job_description
from taxonomy.utils import generate_and_store_job_description
from test_utils import factories
Expand Down
12 changes: 4 additions & 8 deletions tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
import unittest

import mock
from pytest import mark
from testfixtures import LogCapture
from openedx_events.content_authoring.data import DuplicatedXBlockData, XBlockData
from openedx_events.content_authoring.signals import XBLOCK_DELETED, XBLOCK_DUPLICATED, XBLOCK_PUBLISHED
from openedx_events.learning.data import XBlockSkillVerificationData
from openedx_events.learning.signals import XBLOCK_SKILL_VERIFIED
from pytest import mark
from testfixtures import LogCapture

from taxonomy.models import CourseSkills, Skill, ProgramSkill, XBlockSkillData, XBlockSkills
from taxonomy.signals.signals import (
UPDATE_COURSE_SKILLS,
UPDATE_PROGRAM_SKILLS,
UPDATE_XBLOCK_SKILLS,
)
from taxonomy.models import CourseSkills, ProgramSkill, Skill, XBlockSkillData, XBlockSkills
from taxonomy.signals.signals import UPDATE_COURSE_SKILLS, UPDATE_PROGRAM_SKILLS, UPDATE_XBLOCK_SKILLS
from test_utils.mocks import MockCourse, MockProgram, MockXBlock
from test_utils.providers import (
DiscoveryCourseMetadataProvider,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pytest import mark
from testfixtures import LogCapture

from taxonomy.models import CourseSkills, Skill, ProgramSkill, XBlockSkills
from taxonomy.models import CourseSkills, ProgramSkill, Skill, XBlockSkills
from taxonomy.tasks import update_course_skills, update_program_skills, update_xblock_skills
from test_utils.mocks import MockCourse, MockProgram, MockXBlock
from test_utils.providers import (
Expand Down

0 comments on commit 91fd749

Please sign in to comment.