Skip to content

Commit

Permalink
Rename top-level package to 'link'
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-blessing committed Sep 28, 2023
1 parent a00b27a commit 98b18cb
Show file tree
Hide file tree
Showing 37 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ LINK_PASS=secret-password
The destination table is created by passing information about where to find the source table to the `link` decorator:

```python
from dj_link import link
from link import link

@link(
"databaseserver.com",
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
functional_tests:
build: .
volumes:
- $PWD/dj_link:/src/dj_link:ro
- $PWD/link:/src/link:ro
- $PWD/tests:/src/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
environment:
Expand All @@ -21,7 +21,7 @@ services:
tests_with_coverage:
build: .
volumes:
- $PWD/dj_link:/src/dj_link:ro
- $PWD/link:/src/link:ro
- $PWD/tests:/src/tests:ro
- $PWD/reports:/src/reports
- /var/run/docker.sock:/var/run/docker.sock
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from typing import Callable, Iterable, Mapping

from dj_link.service.services import (
from link.service.services import (
DeleteRequest,
ListIdleEntitiesRequest,
PullRequest,
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions dj_link/adapters/gateway.py → link/adapters/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from itertools import groupby
from typing import Iterable

from dj_link.domain.custom_types import Identifier
from dj_link.domain.link import Link, create_link
from dj_link.domain.state import Commands, Components, Processes, Update
from dj_link.service.gateway import LinkGateway
from link.domain.custom_types import Identifier
from link.domain.link import Link, create_link
from link.domain.state import Commands, Components, Processes, Update
from link.service.gateway import LinkGateway

from .custom_types import PrimaryKey
from .facade import DJAssignments, DJLinkFacade, DJProcess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Union
from uuid import UUID, uuid4

from dj_link.domain.custom_types import Identifier
from link.domain.custom_types import Identifier

from .custom_types import PrimaryKey

Expand Down
2 changes: 1 addition & 1 deletion dj_link/adapters/present.py → link/adapters/present.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dataclasses import dataclass
from typing import Callable, Iterable

from dj_link.service.services import (
from link.service.services import (
ListIdleEntitiesResponse,
OperationResponse,
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
cast,
)

from dj_link.adapters import PrimaryKey
from dj_link.adapters.facade import DJAssignments, DJProcess
from dj_link.adapters.facade import DJLinkFacade as AbstractDJLinkFacade
from link.adapters import PrimaryKey
from link.adapters.facade import DJAssignments, DJProcess
from link.adapters.facade import DJLinkFacade as AbstractDJLinkFacade


class Connection(Protocol):
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions dj_link/infrastructure/link.py → link/infrastructure/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
from functools import partial
from typing import Any, Mapping, Optional

from dj_link.adapters.controller import DJController
from dj_link.adapters.custom_types import PrimaryKey
from dj_link.adapters.gateway import DJLinkGateway
from dj_link.adapters.identification import IdentificationTranslator
from dj_link.adapters.present import (
from link.adapters.controller import DJController
from link.adapters.custom_types import PrimaryKey
from link.adapters.gateway import DJLinkGateway
from link.adapters.identification import IdentificationTranslator
from link.adapters.present import (
create_idle_entities_updater,
create_operation_response_presenter,
)
from dj_link.service.io import make_responsive
from dj_link.service.services import (
from link.service.io import make_responsive
from link.service.services import (
Services,
delete,
list_idle_entities,
Expand Down
4 changes: 2 additions & 2 deletions dj_link/infrastructure/log.py → link/infrastructure/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from dataclasses import asdict
from typing import Callable

from dj_link.adapters.present import OperationRecord
from link.adapters.present import OperationRecord


def create_operation_logger() -> Callable[[OperationRecord], None]:
"""Create a function that logs information about finished operations."""
logger = logging.getLogger("dj_link[operations]")
logger = logging.getLogger("link[operations]")

def log(record: OperationRecord) -> None:
for request in record.requests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from datajoint import Table

from dj_link.adapters.controller import DJController
from dj_link.adapters.custom_types import PrimaryKey
from link.adapters.controller import DJController
from link.adapters.custom_types import PrimaryKey

from . import DJTables

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions dj_link/service/gateway.py → link/service/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from abc import ABC, abstractmethod
from collections.abc import Iterable

from dj_link.domain.link import Link
from dj_link.domain.state import Update
from link.domain.link import Link
from link.domain.state import Update


class LinkGateway(ABC):
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions dj_link/service/services.py → link/service/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from dataclasses import dataclass
from enum import Enum, auto

from dj_link.domain.custom_types import Identifier
from dj_link.domain.link import process as process_domain_service
from dj_link.domain.link import start_delete, start_pull
from dj_link.domain.state import InvalidOperation, Operations, Update, states
from link.domain.custom_types import Identifier
from link.domain.link import process as process_domain_service
from link.domain.link import start_delete, start_pull
from link.domain.state import InvalidOperation, Operations, Update, states

from .gateway import LinkGateway

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ disable = ["cyclic-import", "logging-fstring-interpolation", "duplicate-code"]
[tool.mypy]
python_version = "3.8"
files = [
"dj_link",
"link",
"tests",
"stubs",
]
Expand Down Expand Up @@ -78,7 +78,7 @@ ignore_missing_imports = true

[tool.coverage.run]
branch = true
source = ["dj_link"]
source = ["link"]

[tool.coverage.report]
exclude_lines = ["if TYPE_CHECKING:"]
Expand Down Expand Up @@ -126,7 +126,7 @@ markers = [
line-length = 120
select = ["E", "F", "I", "D", "PL", "PT"]
ignore = ["F821"]
include = ["dj_link/*.py", "tests/*.py"]
include = ["link/*.py", "tests/*.py"]

[tool.ruff.per-file-ignores]
"tests/*.py" = ["D", "PL"]
Expand Down
4 changes: 2 additions & 2 deletions tests/assignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from typing import Iterable, Mapping, Optional
from uuid import UUID, uuid4

from dj_link.domain.custom_types import Identifier
from dj_link.domain.state import Components
from link.domain.custom_types import Identifier
from link.domain.state import Components

__UUIDS: dict[str, UUID] = {}

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_deleting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datajoint as dj

from dj_link import link
from link import link


def test_deleting(
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_pulling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import datajoint as dj

from dj_link import link
from link import link


def test_pulling(
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/test_datajoint_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

import pytest

from dj_link.adapters import PrimaryKey
from dj_link.adapters.gateway import DJLinkGateway
from dj_link.adapters.identification import IdentificationTranslator
from dj_link.domain.link import create_link, process, start_delete, start_pull
from dj_link.domain.state import Components, Processes
from dj_link.infrastructure.facade import DJLinkFacade, Table
from link.adapters import PrimaryKey
from link.adapters.gateway import DJLinkGateway
from link.adapters.identification import IdentificationTranslator
from link.domain.link import create_link, process, start_delete, start_pull
from link.domain.state import Components, Processes
from link.infrastructure.facade import DJLinkFacade, Table


class FakeConnection:
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

import pytest

from dj_link.domain.custom_types import Identifier
from dj_link.domain.link import Link, create_link
from dj_link.domain.state import Commands, Components, InvalidOperation, Operations, Processes, State, Update, states
from dj_link.service.gateway import LinkGateway
from dj_link.service.io import Service, make_responsive
from dj_link.service.services import (
from link.domain.custom_types import Identifier
from link.domain.link import Link, create_link
from link.domain.state import Commands, Components, InvalidOperation, Operations, Processes, State, Update, states
from link.service.gateway import LinkGateway
from link.service.io import Service, make_responsive
from link.service.services import (
DeleteRequest,
DeleteResponse,
ListIdleEntitiesRequest,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/adapters/datajoint/test_identification.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from dj_link.adapters.custom_types import PrimaryKey
from dj_link.adapters.identification import IdentificationTranslator
from link.adapters.custom_types import PrimaryKey
from link.adapters.identification import IdentificationTranslator


def test_primary_key_translated_to_identifier_and_back_is_identical_to_original() -> None:
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/entities/test_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import pytest

from dj_link.domain.custom_types import Identifier
from dj_link.domain.link import Link, create_link, process, start_delete, start_pull
from dj_link.domain.state import Components, Processes, State, states
from link.domain.custom_types import Identifier
from link.domain.link import Link, create_link, process, start_delete, start_pull
from link.domain.state import Components, Processes, State, states
from tests.assignments import create_assignments, create_identifier, create_identifiers


Expand Down
6 changes: 3 additions & 3 deletions tests/unit/entities/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import pytest

from dj_link.domain.custom_types import Identifier
from dj_link.domain.link import create_link
from dj_link.domain.state import (
from link.domain.custom_types import Identifier
from link.domain.link import create_link
from link.domain.state import (
Commands,
Components,
InvalidOperation,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/infrastructure/datajoint/test_dj_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest

from dj_link.infrastructure import dj_helpers
from link.infrastructure import dj_helpers


class TestReplaceStores:
Expand Down

0 comments on commit 98b18cb

Please sign in to comment.