Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Nov 8, 2023
1 parent ac0c9a6 commit f23cfff
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dandi/cli/tests/test_cmd_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from dandi.tests.skip import mark

from ..ls import ls
from ..cmd_ls import ls
from ...utils import yaml_load


Expand Down
4 changes: 2 additions & 2 deletions dandi/cli/tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from click.testing import CliRunner
import pytest

from ..cmd_ls import ls
from ..cmd_validate import validate
from ..command import __all_commands__
from ..ls import ls
from ..validate import validate


@pytest.mark.parametrize("command", (ls, validate))
Expand Down
2 changes: 1 addition & 1 deletion dandi/cli/tests/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from click.testing import CliRunner
import pytest

from ..download import download
from ..cmd_download import download
from ...consts import dandiset_metadata_file, known_instances


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

from click.testing import CliRunner

from ..instances import instances
from ..cmd_instances import instances


def test_cmd_instances(monkeypatch):
Expand Down
2 changes: 1 addition & 1 deletion dandi/cli/tests/test_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
from pytest_mock import MockerFixture

from ..move import move
from ..cmd_move import move


@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion dandi/cli/tests/test_service_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from dandi import __version__
from dandi.tests.fixtures import SampleDandiset

from ..service_scripts import service_scripts
from ..cmd_service_scripts import service_scripts

DATA_DIR = Path(__file__).with_name("data")

Expand Down
5 changes: 4 additions & 1 deletion dandi/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from dataclasses import dataclass
from enum import Enum
import os
from typing import Union

#: A list of metadata fields which dandi extracts from .nwb files.
#: Additional fields (such as ``number_of_*``) might be added by
Expand Down Expand Up @@ -98,7 +99,9 @@ class EmbargoStatus(Enum):
@dataclass(frozen=True)
class DandiInstance:
name: str
gui: str | None
# This class is used as an attribute of ParsedDandiURL, a Pydantic class,
# and thus we need non-future annotations:
gui: Union[str, None]
api: str

@property
Expand Down
4 changes: 2 additions & 2 deletions dandi/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import re
from time import sleep, time
from types import TracebackType
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional
from typing import TYPE_CHECKING, Any, ClassVar, Dict, FrozenSet, List, Optional
from urllib.parse import quote_plus, urlparse, urlunparse

import click
Expand Down Expand Up @@ -621,7 +621,7 @@ class APIBase(BaseModel):
detail; do not rely on it.
"""

JSON_EXCLUDE: ClassVar[frozenset[str]] = frozenset(["client"])
JSON_EXCLUDE: ClassVar[FrozenSet[str]] = frozenset(["client"])

def json_dict(self) -> dict[str, Any]:
"""
Expand Down
6 changes: 3 additions & 3 deletions dandi/dandiarchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import posixpath
import re
from time import sleep
from typing import Any
from typing import Any, Union
from urllib.parse import unquote as urlunquote

from pydantic import AnyHttpUrl, BaseModel, parse_obj_as
Expand Down Expand Up @@ -70,11 +70,11 @@ class ParsedDandiURL(ABC, BaseModel):
#: The Dandi Archive instance that the URL points to
instance: DandiInstance
#: The ID of the Dandiset given in the URL
dandiset_id: str | None
dandiset_id: Union[str, None]
#: The version of the Dandiset, if specified. If this is not set, the
#: version will be defaulted using the rules described under
#: `DandiAPIClient.get_dandiset()`.
version_id: str | None = None
version_id: Union[str, None] = None

@property
def api_url(self) -> AnyHttpUrl:
Expand Down
2 changes: 1 addition & 1 deletion dandi/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

from .skip import skipif
from .. import get_logger
from ..cli.organize import organize
from ..cli.cmd_organize import organize
from ..consts import (
DandiInstance,
dandiset_metadata_file,
Expand Down
2 changes: 1 addition & 1 deletion dandi/tests/test_organize.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pytest
import ruamel.yaml

from ..cli.organize import organize
from ..cli.cmd_organize import organize
from ..consts import dandiset_metadata_file, file_operation_modes
from ..organize import (
_sanitize_value,
Expand Down

0 comments on commit f23cfff

Please sign in to comment.