Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Update .pre-commit-config #796

Merged
merged 9 commits into from
Mar 26, 2024
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:

- name: "Linting Checks 🧹"
run: |
hatch env run -e dev lint
hatch env run -e lint lint

- name: "Build package 📦"
run: |
Expand Down
32 changes: 17 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,28 @@
#
# - Register git hooks: pre-commit install --install-hooks
# - Run on all files: pre-commit run --all-files
ci:
autoupdate_schedule: monthly
autofix_commit_msg: |
[pre-commit.ci] Apply automatic pre-commit fixes

repos:
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 24.3.0
hooks:
- id: black
exclude: "examples|tests/assets"

- repo: https://github.com/charliermarsh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.0.289"
rev: "v0.3.4"
hooks:
- id: ruff
exclude: "examples|tests/assets"
args: ["--fix"]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort
additional_dependencies: [toml]
files: \.py$
args: ["--profile", "black"]
exclude: "conda-store-server/conda_store_server/action/__init__.py"

trallard marked this conversation as resolved.
Show resolved Hide resolved
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
files: ".*\\.py"
Expand All @@ -44,7 +38,15 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier
exclude: ^(examples/|templates/|)

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort
args: ["--profile", "black"]
exclude: "conda-store-server/conda_store_server/action/__init__.py"
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 @@ -5,9 +5,12 @@
Create Date: 2024-01-29 03:56:36.889909

"""

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 @@ -5,9 +5,12 @@
Create Date: 2023-12-13 21:01:45.546591

"""

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 @@ -5,9 +5,12 @@
Create Date: 2022-08-24 12:01:48.461989

"""

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 @@ -5,9 +5,12 @@
Create Date: 2023-11-17 14:34:40.688865

"""

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 @@ -5,9 +5,12 @@
Create Date: 2022-06-01 18:37:12.396138

"""

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 @@ -5,9 +5,12 @@
Create Date: 2024-01-28 14:31:35.723505

"""

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 @@ -5,9 +5,12 @@
Create Date: 2022-08-05 22:14:34.110642

"""

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 @@ -5,9 +5,12 @@
Create Date: 2023-11-29 09:02:35.835664

"""

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 @@ -5,9 +5,12 @@
Create Date: 2022-07-15 14:22:00.351131

"""

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 @@ -5,9 +5,12 @@
Create Date: 2023-05-11 16:38:12.210549

"""

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 @@ -5,9 +5,12 @@
Create Date: 2023-07-04 14:35:48.177574

"""

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 @@ -5,9 +5,12 @@
Create Date: 2023-11-07 12:25:04.416192

"""

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
Loading
Loading