Skip to content

Commit

Permalink
Cleanup with black, isort
Browse files Browse the repository at this point in the history
  • Loading branch information
hoh committed Oct 16, 2024
1 parent 87b3dc6 commit 2c79fca
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
7 changes: 3 additions & 4 deletions aleph_message/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import datetime
from enum import Enum
import json
import logging
from copy import copy
from enum import Enum
from hashlib import sha256
from json import JSONDecodeError
from pathlib import Path
from typing import Any, Dict, List, Literal, Optional, Type, TypeVar, Union, cast

from pydantic import BaseModel, Field, field_validator, ConfigDict
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing_extensions import TypeAlias

from .abstract import BaseContent, HashableModel
Expand All @@ -17,8 +18,6 @@
from .execution.program import ProgramContent
from .item_hash import ItemHash, ItemType

import logging

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion aleph_message/models/execution/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .abstract import BaseExecutableContent
from .base import Encoding, Interface, MachineType, Payment, PaymentType
from .instance import InstanceContent
from .program import ProgramContent
from .base import Encoding, MachineType, PaymentType, Payment, Interface

__all__ = [
"BaseExecutableContent",
Expand Down
9 changes: 5 additions & 4 deletions aleph_message/models/execution/instance.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
from __future__ import annotations
from typing import Optional, List

from pydantic import Field, field_validator
from typing import List, Optional

from pydantic import Field

from aleph_message.models.abstract import HashableModel

from ...utils import Gigabytes, gigabyte_to_mebibyte
from .abstract import BaseExecutableContent
from .environment import InstanceEnvironment
from .volume import ParentVolume, PersistentVolumeSizeMib, VolumePersistence
from .base import Payment
from .environment import InstanceEnvironment
from .volume import ParentVolume, VolumePersistence


class RootfsVolume(HashableModel):
Expand Down
2 changes: 1 addition & 1 deletion aleph_message/models/execution/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from enum import Enum
from typing import Literal, Optional, Union

from pydantic import BaseModel, ConfigDict, Field, field_validator
from pydantic import ConfigDict, Field

from ...utils import Gigabytes, gigabyte_to_mebibyte
from ..abstract import HashableModel
Expand Down
5 changes: 3 additions & 2 deletions aleph_message/models/item_hash.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from enum import Enum
from functools import lru_cache

from ..exceptions import UnknownHashError
from pydantic_core import core_schema
from pydantic import GetCoreSchemaHandler
from pydantic_core import core_schema

from ..exceptions import UnknownHashError


class ItemType(str, Enum):
Expand Down
10 changes: 6 additions & 4 deletions aleph_message/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import json
import os.path
from functools import partial
from os import listdir
from os.path import isdir, join
from pathlib import Path

import pytest
import requests
from functools import partial
from pydantic import ValidationError
from rich.console import Console

Expand All @@ -29,9 +29,11 @@
)
from aleph_message.models.execution.environment import AMDSEVPolicy
from aleph_message.models.execution.instance import RootfsVolume
from aleph_message.models.execution.volume import (EphemeralVolume,
ParentVolume,
VolumePersistence)
from aleph_message.models.execution.volume import (
EphemeralVolume,
ParentVolume,
VolumePersistence,
)
from aleph_message.tests.download_messages import MESSAGES_STORAGE_PATH
from aleph_message.utils import Gigabytes, Mebibytes, gigabyte_to_mebibyte

Expand Down

0 comments on commit 2c79fca

Please sign in to comment.