Skip to content

Commit

Permalink
[pre-commit.ci] Apply automatic pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Mar 26, 2024
1 parent 46a60bf commit a3ec591
Show file tree
Hide file tree
Showing 65 changed files with 165 additions and 48 deletions.
2 changes: 2 additions & 0 deletions conda-store-server/conda_store_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import datetime
import typing

from pathlib import Path


__version__ = "2024.3.1"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pathlib

from conda.core.prefix_data import PrefixData

from conda_store_server import action, api


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import typing

from conda.models.dist import Dist

from conda_store_server import action, api, conda_utils


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import conda_package_handling.api
import conda_package_streaming.url
import filelock

from conda.base.constants import PACKAGE_CACHE_MAGIC_FILE
from conda.common.path import expand, strip_pkg_extension
from conda.core.package_cache_data import (
Expand All @@ -20,6 +21,7 @@
write_as_json_to_file,
)
from conda.gateways.disk.update import touch

from conda_store_server import action, conda_utils


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pathlib

import conda_pack

from conda_store_server import action


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import warnings

import yaml

from conda_store_server import action, schema
from conda_store_server.action.utils import logged_command

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import typing

import yaml

from conda_lock.conda_lock import run_lock

from conda_store_server import action, conda_utils, schema
from conda_store_server.action.utils import logged_command

Expand Down
3 changes: 3 additions & 0 deletions conda-store-server/conda_store_server/alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from alembic import context
from sqlalchemy import engine_from_config, pool


# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
Expand All @@ -22,10 +23,12 @@
# assumes that alembic is inside directory conda_store_server/alembic/env.py
import sys # noqa E402


sys.path.append(str(pathlib.Path(__file__).parent.parent.parent))

from conda_store_server.orm import Base # noqa E402


target_metadata = Base.metadata


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "03c839888c82"
down_revision = "57cd11b949d5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "0f7e23ff24ee"
down_revision = "771180018e1b"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "16f65805dc8f"
down_revision = "5ad723de2abd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "30b37e725c32"
down_revision = "d78e9889566a"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "48be4072fe58"
down_revision = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "57cd11b949d5"
down_revision = "0f7e23ff24ee"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "5ad723de2abd"
down_revision = "8d63a091aff8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "771180018e1b"
down_revision = "30b37e725c32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "8d63a091aff8"
down_revision = "48be4072fe58"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "abd7248d5327"
down_revision = "16f65805dc8f"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "b387747ca9b7"
down_revision = "abd7248d5327"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"""

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision = "d78e9889566a"
down_revision = "b387747ca9b7"
Expand Down
4 changes: 3 additions & 1 deletion conda-store-server/conda_store_server/api.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import re

from typing import Any, Dict, List

from conda_store_server import conda_utils, orm, schema, utils
from sqlalchemy import distinct, func, null, or_
from sqlalchemy.orm import aliased

from conda_store_server import conda_utils, orm, schema, utils


def list_namespaces(db, show_soft_deleted: bool = False):
filters = []
Expand Down
27 changes: 15 additions & 12 deletions conda-store-server/conda_store_server/app.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
import datetime
import os
import sys

from contextlib import contextmanager
from typing import Any, Dict

import pydantic

from celery import Celery, group
from conda_store_server import (
CONDA_STORE_DIR,
BuildKey,
api,
conda_utils,
environment,
orm,
registry,
schema,
storage,
utils,
)
from sqlalchemy.orm import Session
from sqlalchemy.pool import QueuePool
from traitlets import (
Expand All @@ -34,6 +24,19 @@
)
from traitlets.config import LoggingConfigurable

from conda_store_server import (
CONDA_STORE_DIR,
BuildKey,
api,
conda_utils,
environment,
orm,
registry,
schema,
storage,
utils,
)


def conda_store_validate_specification(
db: Session,
Expand Down
4 changes: 3 additions & 1 deletion conda-store-server/conda_store_server/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
import typing

import yaml

from sqlalchemy.orm import Session

from conda_store_server import action, api, conda_utils, orm, schema, utils
from conda_store_server.utils import BuildPathError
from sqlalchemy.orm import Session


def append_to_logs(db: Session, conda_store, build, logs: typing.Union[str, bytes]):
Expand Down
2 changes: 2 additions & 0 deletions conda-store-server/conda_store_server/dbutil.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import os

from contextlib import contextmanager
from tempfile import TemporaryDirectory

from alembic import command
from alembic.config import Config
from sqlalchemy import create_engine, inspect


_here = os.path.abspath(os.path.dirname(__file__))

ALEMBIC_INI_TEMPLATE_PATH = os.path.join(_here, "alembic.ini")
Expand Down
1 change: 1 addition & 0 deletions conda-store-server/conda_store_server/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pydantic
import yaml

from conda_store_server import conda_utils, schema


Expand Down
8 changes: 5 additions & 3 deletions conda-store-server/conda_store_server/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import shutil
import sys

from conda_store_server import conda_utils, schema, utils
from conda_store_server.environment import validate_environment
from conda_store_server.utils import BuildPathError
from sqlalchemy import (
JSON,
BigInteger,
Expand Down Expand Up @@ -36,6 +33,11 @@
validates,
)

from conda_store_server import conda_utils, schema, utils
from conda_store_server.environment import validate_environment
from conda_store_server.utils import BuildPathError


logger = logging.getLogger("orm")

Base = declarative_base()
Expand Down
3 changes: 2 additions & 1 deletion conda-store-server/conda_store_server/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
import hashlib
import urllib.parse

from conda_store_server import orm, schema, utils
from python_docker.registry import Image, Registry
from sqlalchemy.orm import Session
from traitlets import Callable, Dict, default
from traitlets.config import LoggingConfigurable

from conda_store_server import orm, schema, utils


class ContainerRegistry(LoggingConfigurable):
container_registries = Dict(
Expand Down
4 changes: 3 additions & 1 deletion conda-store-server/conda_store_server/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import os
import re
import sys

from typing import Any, Callable, Dict, List, Optional, Union

from conda_store_server import conda_utils, utils
from pydantic import BaseModel, Field, ValidationError, constr, validator

from conda_store_server import conda_utils, utils


def _datetime_factory(offset: datetime.timedelta):
"""utcnow datetime + timezone as string"""
Expand Down
1 change: 1 addition & 0 deletions conda-store-server/conda_store_server/server/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from conda_store_server.server.app import CondaStoreServer


main = CondaStoreServer.launch_instance

if __name__ == "__main__":
Expand Down
Loading

0 comments on commit a3ec591

Please sign in to comment.