Skip to content

Commit

Permalink
style: package wide isort
Browse files Browse the repository at this point in the history
  • Loading branch information
in03 committed Feb 9, 2023
1 parent 128023e commit deaeb9c
Show file tree
Hide file tree
Showing 19 changed files with 64 additions and 74 deletions.
12 changes: 5 additions & 7 deletions src/proxima/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
__version__ = "1.0.2"

import os

import semver

_semver = semver.VersionInfo.parse(__version__)

os.environ["PROXIMA_VERSION"] = __version__
os.environ["PROXIMA_VC_KEY"] = f"{_semver.major}.{_semver.minor}"

from .app import core
from .celery import shared
from .app import checks
from .app import exceptions
from .app import resolve
from .app.link import ProxyLinker

from proxima.cli import main as cli

from .app import checks, core, exceptions, resolve
from .app.link import ProxyLinker
from .celery import shared
2 changes: 1 addition & 1 deletion src/proxima/app/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import time

from notifypy import Notify
from rich.console import Console
from rich.logging import RichHandler
from rich.prompt import Prompt
from rich.console import Console

console = Console()

Expand Down
7 changes: 4 additions & 3 deletions src/proxima/app/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import logging
import os

from pydavinci import davinci
from pydavinci.wrappers.mediapoolitem import MediaPoolItem
from rich.console import Console
from proxima.app import core

from proxima import exceptions
from proxima.app import core
from proxima.settings import settings
from pydavinci import davinci
from proxima.types.job import Job
from proxima.types.media_pool_index import media_pool_index
from pydavinci.wrappers.mediapoolitem import MediaPoolItem

resolve = davinci.Resolve()
console = Console()
Expand Down
13 changes: 6 additions & 7 deletions src/proxima/app/package.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import importlib
import logging
import os
import subprocess
import sys
from distutils.sysconfig import get_python_lib
from pathlib import Path
from functools import cached_property
from pathlib import Path

import importlib
import subprocess
import sys
from git.exc import InvalidGitRepositoryError
from git.repo import Repo

from proxima.settings import settings

from git.repo import Repo
from git.exc import InvalidGitRepositoryError

logger = logging.getLogger("proxima")
logger.setLevel(settings["app"]["loglevel"])

Expand Down
15 changes: 8 additions & 7 deletions src/proxima/app/resolve.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import logging
import os

from proxima.app import core
from proxima.settings import settings, SettingsManager
from pydavinci import davinci
from pydavinci.wrappers.timeline import Timeline
from pydavinci.wrappers.project import Project
from pydavinci.wrappers.timelineitem import TimelineItem
from pydavinci.wrappers.mediapool import MediaPool
from pydavinci.wrappers.mediapoolitem import MediaPoolItem
from proxima.types.media_pool_index import media_pool_index
from proxima.types.job import Job, ProjectMetadata, SourceMetadata
from pydavinci.wrappers.project import Project
from pydavinci.wrappers.timeline import Timeline
from pydavinci.wrappers.timelineitem import TimelineItem

from proxima.app import core
from proxima.settings import SettingsManager, settings
from proxima.types.batch import Batch
from proxima.types.job import Job, ProjectMetadata, SourceMetadata
from proxima.types.media_pool_index import media_pool_index

resolve = davinci.Resolve()

Expand Down
1 change: 1 addition & 0 deletions src/proxima/celery/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys

from celery import Celery

from proxima.settings import settings

# QUEUE - Celery routing queue using version constraint key
Expand Down
6 changes: 3 additions & 3 deletions src/proxima/celery/ffmpeg/ffmpeg_process.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import logging
import os
import subprocess
import json

from rich.console import Console
from rich.progress import (
Expand All @@ -13,11 +13,11 @@
)
from rich.prompt import Confirm

from .utils import ffprobe

from proxima.app import core
from proxima.settings import settings

from .utils import ffprobe

core.install_rich_tracebacks()
logger = logging.getLogger("proxima")
logger.setLevel(settings["worker"]["loglevel"])
Expand Down
3 changes: 2 additions & 1 deletion src/proxima/celery/ffmpeg/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import logging
import json
import logging
import os
import shlex
import subprocess
import sys
from fractions import Fraction

from proxima.app import core
from proxima.settings import settings

Expand Down
5 changes: 2 additions & 3 deletions src/proxima/celery/launch_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
import os
import platform
import subprocess
import shortuuid
import time
from shutil import which

import shortuuid
from rich import print

from proxima.app import core
from proxima.app import package
from proxima.app import core, package
from proxima.settings import settings

core.install_rich_tracebacks()
Expand Down
13 changes: 4 additions & 9 deletions src/proxima/celery/shared.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
from typing import List
import logging
import time
from typing import List

from celery.result import AsyncResult, GroupResult
from rich.console import Group
from rich.progress import (
BarColumn,
Progress,
SpinnerColumn,
TextColumn,
)
from rich.live import Live
from celery.result import AsyncResult
from celery.result import GroupResult
from rich.progress import BarColumn, Progress, SpinnerColumn, TextColumn

logger = logging.getLogger("proxima")

Expand Down
17 changes: 9 additions & 8 deletions src/proxima/celery/tasks.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
from dataclasses import dataclass, fields
import logging
import os
from dataclasses import dataclass, fields

from celery.exceptions import Reject
from rich import print
from rich.console import Console

from proxima.app import core
from proxima.settings import settings
from proxima.settings.manager import SettingsManager
from proxima.celery import celery_app
from proxima.celery.ffmpeg import FfmpegProcess
from proxima.celery.celery import celery_queue
from celery.exceptions import Reject
from proxima.celery.ffmpeg import FfmpegProcess
from proxima.settings import settings
from proxima.settings.manager import SettingsManager
from proxima.types.job import ProjectMetadata, SourceMetadata

from rich import print
from rich.console import Console

# Worker and Celery settings pulled from local user_settings file
# All other settings are passed from queuer
console = Console()
Expand Down
2 changes: 1 addition & 1 deletion src/proxima/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from typing import List, Optional

import typer
from pyfiglet import Figlet
from rich import print
from rich.console import Console
from pyfiglet import Figlet

# Init classes
cli_app = typer.Typer()
Expand Down
3 changes: 1 addition & 2 deletions src/proxima/settings/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from .manager import settings
from .manager import SettingsManager
from .manager import SettingsManager, settings
5 changes: 3 additions & 2 deletions src/proxima/settings/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@

import typer
from deepdiff import DeepDiff
from proxima.app import core
from rich import print
from rich.prompt import Confirm, Prompt
from ruamel.yaml import YAML
from schema import SchemaError
from yaspin import yaspin

from schema import SchemaError
from proxima.app import core

from .schema import settings_schema

core.install_rich_tracebacks()
Expand Down
3 changes: 1 addition & 2 deletions src/proxima/settings/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import re

from commonregex import link
from schema import Schema, And, Optional

from schema import And, Optional, Schema

settings_schema = Schema(
{
Expand Down
3 changes: 1 addition & 2 deletions src/proxima/tests/test_checks.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import pytest
from shortuuid import uuid

from proxima.app import checks
from proxima.celery import launch_workers

from shortuuid import uuid


@pytest.fixture
def test_launch_workers():
Expand Down
14 changes: 7 additions & 7 deletions src/proxima/types/batch.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from functools import cached_property
import json
import logging
import os
from rich.prompt import Confirm, Prompt
from dataclasses import asdict
from functools import cached_property

from rich import print
from rich.console import Console
from rich.panel import Panel
from dataclasses import asdict
import json
from rich.prompt import Confirm, Prompt

from proxima.app import core, exceptions
from proxima.app import link
from proxima.types.job import Job
from proxima.app import core, exceptions, link
from proxima.settings import settings
from proxima.types.job import Job

core.install_rich_tracebacks()
logger = logging.getLogger("proxima")
Expand Down
13 changes: 4 additions & 9 deletions src/proxima/types/job.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import logging
import os

from proxima.app import core
from proxima.celery import ffmpeg

import os
import pathlib
import re

from dataclasses import dataclass
from glob import glob
from functools import cached_property
from glob import glob

from proxima.settings import settings, SettingsManager
from proxima.app import core, exceptions
from proxima.celery import ffmpeg
from proxima.settings import SettingsManager, settings
from proxima.types.media_pool_index import media_pool_index
from proxima.app import exceptions

core.install_rich_tracebacks()
logger = logging.getLogger("proxima")
Expand Down
1 change: 1 addition & 0 deletions src/proxima/types/media_pool_index.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pydavinci.wrappers.mediapoolitem import MediaPoolItem

from proxima.app.exceptions import MPIAlreadyRegistered


Expand Down

0 comments on commit deaeb9c

Please sign in to comment.