Skip to content

Commit

Permalink
Update CI. (#212)
Browse files Browse the repository at this point in the history
* Update CI.

* Fix mypy errors and make its configuration simpler.
  • Loading branch information
Kircheneer committed Mar 3, 2023
1 parent b9b3b7a commit 36c858d
Show file tree
Hide file tree
Showing 7 changed files with 997 additions and 766 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
- name: "Linting: black"
run: "poetry run invoke black"
bandit:
Expand All @@ -40,7 +40,7 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
needs:
Expand All @@ -53,7 +53,7 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
- name: "Linting: pydocstyle"
run: "poetry run invoke pydocstyle"
needs:
Expand All @@ -66,7 +66,7 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
- name: "Linting: flake8"
run: "poetry run invoke flake8"
needs:
Expand All @@ -79,8 +79,8 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
- name: "Linting: flake8"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
- name: "Linting: mypy"
run: "poetry run invoke mypy"
needs:
- "black"
Expand All @@ -92,7 +92,7 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
- name: "Linting: yamllint"
run: "poetry run invoke yamllint"
needs:
Expand All @@ -103,7 +103,7 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
- name: "Build Container"
run: "poetry run invoke build"
needs:
Expand All @@ -118,7 +118,7 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
- name: "Build Container"
run: "poetry run invoke build"
- name: "Linting: Pylint"
Expand All @@ -137,7 +137,7 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install redis"
Expand Down
4 changes: 2 additions & 2 deletions diffsync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def sync_complete(
source: "DiffSync",
diff: Diff,
flags: DiffSyncFlags = DiffSyncFlags.NONE,
logger: structlog.BoundLogger = None,
logger: Optional[structlog.BoundLogger] = None,
):
"""Callback triggered after a `sync_from` operation has completed and updated the model data of this instance.
Expand Down Expand Up @@ -786,7 +786,7 @@ def remove(self, obj: DiffSyncModel, remove_children: bool = False):
return self.store.remove(obj=obj, remove_children=remove_children)

def get_or_instantiate(
self, model: Type[DiffSyncModel], ids: Dict, attrs: Dict = None
self, model: Type[DiffSyncModel], ids: Dict, attrs: Optional[Dict] = None
) -> Tuple[DiffSyncModel, bool]:
"""Attempt to get the object with provided identifiers or instantiate it with provided identifiers and attrs.
Expand Down
2 changes: 1 addition & 1 deletion diffsync/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def perform_sync(self) -> bool:
self.base_logger.info("Sync complete")
return changed

def sync_diff_element(self, element: DiffElement, parent_model: "DiffSyncModel" = None) -> bool:
def sync_diff_element(self, element: DiffElement, parent_model: Optional["DiffSyncModel"] = None) -> bool:
"""Recursively synchronize the given DiffElement and its children, if any, into the dst_diffsync.
Helper method to `perform_sync`.
Expand Down
2 changes: 1 addition & 1 deletion diffsync/store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def count(self, *, model: Union[Text, "DiffSyncModel", Type["DiffSyncModel"], No
raise NotImplementedError

def get_or_instantiate(
self, *, model: Type["DiffSyncModel"], ids: Dict, attrs: Dict = None
self, *, model: Type["DiffSyncModel"], ids: Dict, attrs: Optional[Dict] = None
) -> Tuple["DiffSyncModel", bool]:
"""Attempt to get the object with provided identifiers or instantiate it with provided identifiers and attrs.
Expand Down

0 comments on commit 36c858d

Please sign in to comment.