Skip to content

Commit 36c858d

Browse files
authored
Update CI. (#212)
* Update CI. * Fix mypy errors and make its configuration simpler.
1 parent b9b3b7a commit 36c858d

File tree

7 files changed

+997
-766
lines changed

7 files changed

+997
-766
lines changed

.github/workflows/ci.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: "Check out repository code"
3030
uses: "actions/checkout@v2"
3131
- name: "Setup environment"
32-
uses: "networktocode/gh-action-setup-poetry-environment@v1"
32+
uses: "networktocode/gh-action-setup-poetry-environment@v5"
3333
- name: "Linting: black"
3434
run: "poetry run invoke black"
3535
bandit:
@@ -40,7 +40,7 @@ jobs:
4040
- name: "Check out repository code"
4141
uses: "actions/checkout@v2"
4242
- name: "Setup environment"
43-
uses: "networktocode/gh-action-setup-poetry-environment@v1"
43+
uses: "networktocode/gh-action-setup-poetry-environment@v5"
4444
- name: "Linting: bandit"
4545
run: "poetry run invoke bandit"
4646
needs:
@@ -53,7 +53,7 @@ jobs:
5353
- name: "Check out repository code"
5454
uses: "actions/checkout@v2"
5555
- name: "Setup environment"
56-
uses: "networktocode/gh-action-setup-poetry-environment@v1"
56+
uses: "networktocode/gh-action-setup-poetry-environment@v5"
5757
- name: "Linting: pydocstyle"
5858
run: "poetry run invoke pydocstyle"
5959
needs:
@@ -66,7 +66,7 @@ jobs:
6666
- name: "Check out repository code"
6767
uses: "actions/checkout@v2"
6868
- name: "Setup environment"
69-
uses: "networktocode/gh-action-setup-poetry-environment@v1"
69+
uses: "networktocode/gh-action-setup-poetry-environment@v5"
7070
- name: "Linting: flake8"
7171
run: "poetry run invoke flake8"
7272
needs:
@@ -79,8 +79,8 @@ jobs:
7979
- name: "Check out repository code"
8080
uses: "actions/checkout@v2"
8181
- name: "Setup environment"
82-
uses: "networktocode/gh-action-setup-poetry-environment@v1"
83-
- name: "Linting: flake8"
82+
uses: "networktocode/gh-action-setup-poetry-environment@v5"
83+
- name: "Linting: mypy"
8484
run: "poetry run invoke mypy"
8585
needs:
8686
- "black"
@@ -92,7 +92,7 @@ jobs:
9292
- name: "Check out repository code"
9393
uses: "actions/checkout@v2"
9494
- name: "Setup environment"
95-
uses: "networktocode/gh-action-setup-poetry-environment@v1"
95+
uses: "networktocode/gh-action-setup-poetry-environment@v5"
9696
- name: "Linting: yamllint"
9797
run: "poetry run invoke yamllint"
9898
needs:
@@ -103,7 +103,7 @@ jobs:
103103
- name: "Check out repository code"
104104
uses: "actions/checkout@v2"
105105
- name: "Setup environment"
106-
uses: "networktocode/gh-action-setup-poetry-environment@v1"
106+
uses: "networktocode/gh-action-setup-poetry-environment@v5"
107107
- name: "Build Container"
108108
run: "poetry run invoke build"
109109
needs:
@@ -118,7 +118,7 @@ jobs:
118118
- name: "Check out repository code"
119119
uses: "actions/checkout@v2"
120120
- name: "Setup environment"
121-
uses: "networktocode/gh-action-setup-poetry-environment@v1"
121+
uses: "networktocode/gh-action-setup-poetry-environment@v5"
122122
- name: "Build Container"
123123
run: "poetry run invoke build"
124124
- name: "Linting: Pylint"
@@ -137,7 +137,7 @@ jobs:
137137
- name: "Check out repository code"
138138
uses: "actions/checkout@v2"
139139
- name: "Setup environment"
140-
uses: "networktocode/gh-action-setup-poetry-environment@v2"
140+
uses: "networktocode/gh-action-setup-poetry-environment@v5"
141141
with:
142142
python-version: "${{ matrix.python-version }}"
143143
- name: "Install redis"

diffsync/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ def sync_complete(
593593
source: "DiffSync",
594594
diff: Diff,
595595
flags: DiffSyncFlags = DiffSyncFlags.NONE,
596-
logger: structlog.BoundLogger = None,
596+
logger: Optional[structlog.BoundLogger] = None,
597597
):
598598
"""Callback triggered after a `sync_from` operation has completed and updated the model data of this instance.
599599
@@ -786,7 +786,7 @@ def remove(self, obj: DiffSyncModel, remove_children: bool = False):
786786
return self.store.remove(obj=obj, remove_children=remove_children)
787787

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

diffsync/helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def perform_sync(self) -> bool:
328328
self.base_logger.info("Sync complete")
329329
return changed
330330

331-
def sync_diff_element(self, element: DiffElement, parent_model: "DiffSyncModel" = None) -> bool:
331+
def sync_diff_element(self, element: DiffElement, parent_model: Optional["DiffSyncModel"] = None) -> bool:
332332
"""Recursively synchronize the given DiffElement and its children, if any, into the dst_diffsync.
333333
334334
Helper method to `perform_sync`.

diffsync/store/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def count(self, *, model: Union[Text, "DiffSyncModel", Type["DiffSyncModel"], No
134134
raise NotImplementedError
135135

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

0 commit comments

Comments
 (0)