Skip to content

Commit 33c89ce

Browse files
authored
Merge pull request #290 from networktocode/release-v2.1.0
Release v2.1.0
2 parents 86c71de + 4af0646 commit 33c89ce

32 files changed

+1148
-1092
lines changed

.github/workflows/ci.yml

+40-24
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on: # yamllint disable
1313
pull_request: ~
1414
jobs:
1515
validate_renovate:
16-
runs-on: "ubuntu-20.04"
16+
runs-on: "ubuntu-24.04"
1717
steps:
1818
- name: "Check out repository code"
1919
uses: "actions/checkout@v2"
@@ -22,88 +22,102 @@ jobs:
2222
with:
2323
pattern: "renovate.json"
2424
black:
25-
runs-on: "ubuntu-20.04"
25+
runs-on: "ubuntu-24.04"
2626
env:
2727
INVOKE_LOCAL: "True"
2828
steps:
2929
- name: "Check out repository code"
3030
uses: "actions/checkout@v2"
3131
- name: "Setup environment"
32-
uses: "networktocode/gh-action-setup-poetry-environment@v5"
32+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
33+
with:
34+
poetry-version: "1.8.5"
3335
- name: "Linting: black"
3436
run: "poetry run invoke black"
3537
bandit:
36-
runs-on: "ubuntu-20.04"
38+
runs-on: "ubuntu-24.04"
3739
env:
3840
INVOKE_LOCAL: "True"
3941
steps:
4042
- name: "Check out repository code"
4143
uses: "actions/checkout@v2"
4244
- name: "Setup environment"
43-
uses: "networktocode/gh-action-setup-poetry-environment@v5"
45+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
46+
with:
47+
poetry-version: "1.8.5"
4448
- name: "Linting: bandit"
4549
run: "poetry run invoke bandit"
4650
needs:
4751
- "black"
4852
pydocstyle:
49-
runs-on: "ubuntu-20.04"
53+
runs-on: "ubuntu-24.04"
5054
env:
5155
INVOKE_LOCAL: "True"
5256
steps:
5357
- name: "Check out repository code"
5458
uses: "actions/checkout@v2"
5559
- name: "Setup environment"
56-
uses: "networktocode/gh-action-setup-poetry-environment@v5"
60+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
61+
with:
62+
poetry-version: "1.8.5"
5763
- name: "Linting: pydocstyle"
5864
run: "poetry run invoke pydocstyle"
5965
needs:
6066
- "black"
6167
flake8:
62-
runs-on: "ubuntu-20.04"
68+
runs-on: "ubuntu-24.04"
6369
env:
6470
INVOKE_LOCAL: "True"
6571
steps:
6672
- name: "Check out repository code"
6773
uses: "actions/checkout@v2"
6874
- name: "Setup environment"
69-
uses: "networktocode/gh-action-setup-poetry-environment@v5"
75+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
76+
with:
77+
poetry-version: "1.8.5"
7078
- name: "Linting: flake8"
7179
run: "poetry run invoke flake8"
7280
needs:
7381
- "black"
7482
mypy:
75-
runs-on: "ubuntu-20.04"
83+
runs-on: "ubuntu-24.04"
7684
env:
7785
INVOKE_LOCAL: "True"
7886
steps:
7987
- name: "Check out repository code"
8088
uses: "actions/checkout@v2"
8189
- name: "Setup environment"
82-
uses: "networktocode/gh-action-setup-poetry-environment@v5"
90+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
91+
with:
92+
poetry-version: "1.8.5"
8393
- name: "Linting: mypy"
8494
run: "poetry run invoke mypy"
8595
needs:
8696
- "black"
8797
yamllint:
88-
runs-on: "ubuntu-20.04"
98+
runs-on: "ubuntu-24.04"
8999
env:
90100
INVOKE_LOCAL: "True"
91101
steps:
92102
- name: "Check out repository code"
93103
uses: "actions/checkout@v2"
94104
- name: "Setup environment"
95-
uses: "networktocode/gh-action-setup-poetry-environment@v5"
105+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
106+
with:
107+
poetry-version: "1.8.5"
96108
- name: "Linting: yamllint"
97109
run: "poetry run invoke yamllint"
98110
needs:
99111
- "black"
100112
build:
101-
runs-on: "ubuntu-20.04"
113+
runs-on: "ubuntu-24.04"
102114
steps:
103115
- name: "Check out repository code"
104116
uses: "actions/checkout@v2"
105117
- name: "Setup environment"
106-
uses: "networktocode/gh-action-setup-poetry-environment@v5"
118+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
119+
with:
120+
poetry-version: "1.8.5"
107121
- name: "Build Container"
108122
run: "poetry run invoke build"
109123
needs:
@@ -113,12 +127,14 @@ jobs:
113127
- "yamllint"
114128
- "mypy"
115129
pylint:
116-
runs-on: "ubuntu-20.04"
130+
runs-on: "ubuntu-24.04"
117131
steps:
118132
- name: "Check out repository code"
119133
uses: "actions/checkout@v2"
120134
- name: "Setup environment"
121-
uses: "networktocode/gh-action-setup-poetry-environment@v5"
135+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
136+
with:
137+
poetry-version: "1.8.5"
122138
- name: "Build Container"
123139
run: "poetry run invoke build"
124140
- name: "Linting: Pylint"
@@ -129,9 +145,9 @@ jobs:
129145
strategy:
130146
fail-fast: true
131147
matrix:
132-
python-version: ["3.8", "3.9", "3.10", "3.11"]
133-
poetry-version: ["1.5.1"]
134-
runs-on: "ubuntu-20.04"
148+
python-version: ["3.9", "3.10", "3.11"]
149+
poetry-version: ["1.8.5"]
150+
runs-on: "ubuntu-24.04"
135151
env:
136152
PYTHON_VER: "${{ matrix.python-version }}"
137153
steps:
@@ -140,7 +156,7 @@ jobs:
140156
- name: "Setup environment"
141157
uses: "networktocode/gh-action-setup-poetry-environment@3ea5d3ecf382cdcb0c74d4c0ff0629d95fce63c7"
142158
env:
143-
POETRY_VERSION: 1.5.1
159+
POETRY_VERSION: 1.8.5
144160
with:
145161
python-version: "${{ matrix.python-version }}"
146162
poetry-version: "${{ matrix.poetry-version }}"
@@ -154,7 +170,7 @@ jobs:
154170
- "pylint"
155171
publish_gh:
156172
name: "Publish to GitHub"
157-
runs-on: "ubuntu-20.04"
173+
runs-on: "ubuntu-24.04"
158174
if: "startsWith(github.ref, 'refs/tags/v')"
159175
steps:
160176
- name: "Check out repository code"
@@ -183,7 +199,7 @@ jobs:
183199
- "unittest"
184200
publish_pypi:
185201
name: "Push Package to PyPI"
186-
runs-on: "ubuntu-20.04"
202+
runs-on: "ubuntu-24.04"
187203
if: "startsWith(github.ref, 'refs/tags/v')"
188204
steps:
189205
- name: "Check out repository code"
@@ -212,7 +228,7 @@ jobs:
212228
- "publish_gh"
213229
- "publish_pypi"
214230
name: "Send notification to the Slack"
215-
runs-on: "ubuntu-20.04"
231+
runs-on: "ubuntu-24.04"
216232
env:
217233
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
218234
SLACK_MESSAGE: >-

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## [2.1.0]
8+
9+
### Changed
10+
11+
- [284](https://github.com/networktocode/diffsync/pull/284) - Update pyyaml to 6.0.2 in poetry.lock by @gsnider2195
12+
- [286](https://github.com/networktocode/diffsync/pull/286) - Update GitHub Actions runner version by @mjbear
13+
- [289](https://github.com/networktocode/diffsync/pull/289) - Remove upper limit on Packaging by @jdrew82
14+
15+
## New Contributors
16+
17+
- @gsnider2195 made their first contribution in https://github.com/networktocode/diffsync/pull/284
18+
- @mjbear made their first contribution in https://github.com/networktocode/diffsync/pull/286
19+
- @jdrew82 made their first contribution in https://github.com/networktocode/diffsync/pull/289
20+
721
## [2.0.1]
822

923
### Changed

diffsync/__init__.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,33 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17+
1718
import sys
1819
from inspect import isclass
1920
from typing import (
21+
Any,
2022
Callable,
2123
ClassVar,
2224
Dict,
2325
List,
2426
Optional,
27+
Set,
2528
Tuple,
2629
Type,
2730
Union,
28-
Any,
29-
Set,
3031
)
31-
from typing_extensions import deprecated
3232

33-
from pydantic import ConfigDict, BaseModel, PrivateAttr
3433
import structlog # type: ignore
34+
from pydantic import BaseModel, ConfigDict, PrivateAttr
35+
from typing_extensions import deprecated
3536

3637
from diffsync.diff import Diff
37-
from diffsync.enum import DiffSyncModelFlags, DiffSyncFlags, DiffSyncStatus
38+
from diffsync.enum import DiffSyncFlags, DiffSyncModelFlags, DiffSyncStatus
3839
from diffsync.exceptions import (
3940
DiffClassMismatch,
4041
ObjectAlreadyExists,
41-
ObjectStoreWrongType,
4242
ObjectNotFound,
43+
ObjectStoreWrongType,
4344
)
4445
from diffsync.helpers import DiffSyncDiffer, DiffSyncSyncer
4546
from diffsync.store import BaseStore
@@ -69,7 +70,7 @@ class DiffSyncModel(BaseModel):
6970
be included in **at most** one of these three tuples.
7071
"""
7172

72-
_modelname: ClassVar[str] = "diffsyncmodel"
73+
_modelname: ClassVar[str] = "diffsyncmodel" # pylint: disable=used-before-assignment
7374
"""Name of this model, used by DiffSync to store and look up instances of this model or its equivalents.
7475
7576
Lowercase by convention; typically corresponds to the class name, but that is not enforced.
@@ -133,16 +134,16 @@ def __pydantic_init_subclass__(cls, **kwargs: Any) -> None:
133134
"""
134135
# Make sure that any field referenced by name actually exists on the model
135136
for attr in cls._identifiers:
136-
if attr not in cls.model_fields and not hasattr(cls, attr):
137+
if attr not in cls.model_fields and not hasattr(cls, attr): # pylint: disable=unsupported-membership-test
137138
raise AttributeError(f"_identifiers {cls._identifiers} references missing or un-annotated attr {attr}")
138139
for attr in cls._shortname:
139-
if attr not in cls.model_fields:
140+
if attr not in cls.model_fields: # pylint: disable=unsupported-membership-test
140141
raise AttributeError(f"_shortname {cls._shortname} references missing or un-annotated attr {attr}")
141142
for attr in cls._attributes:
142-
if attr not in cls.model_fields:
143+
if attr not in cls.model_fields: # pylint: disable=unsupported-membership-test
143144
raise AttributeError(f"_attributes {cls._attributes} references missing or un-annotated attr {attr}")
144145
for attr in cls._children.values():
145-
if attr not in cls.model_fields:
146+
if attr not in cls.model_fields: # pylint: disable=unsupported-membership-test
146147
raise AttributeError(f"_children {cls._children} references missing or un-annotated attr {attr}")
147148

148149
# Any given field can only be in one of (_identifiers, _attributes, _children)
@@ -431,7 +432,7 @@ class Adapter: # pylint: disable=too-many-public-methods
431432
# modelname1 = MyModelClass1
432433
# modelname2 = MyModelClass2
433434

434-
type: Optional[str] = None
435+
type: Optional[str] = None # pylint: disable=used-before-assignment
435436
"""Type of the object, will default to the name of the class if not provided."""
436437

437438
top_level: ClassVar[List[str]] = []
@@ -557,7 +558,7 @@ def load_from_dict(self, data: Dict) -> None:
557558
# Synchronization between DiffSync instances
558559
# ------------------------------------------------------------------------------
559560

560-
def sync_from( # pylint: disable=too-many-arguments
561+
def sync_from( # pylint: disable=too-many-arguments, too-many-positional-arguments
561562
self,
562563
source: "Adapter",
563564
diff_class: Type[Diff] = Diff,
@@ -601,7 +602,7 @@ def sync_from( # pylint: disable=too-many-arguments
601602

602603
return diff
603604

604-
def sync_to( # pylint: disable=too-many-arguments
605+
def sync_to( # pylint: disable=too-many-arguments, too-many-positional-arguments
605606
self,
606607
target: "Adapter",
607608
diff_class: Type[Diff] = Diff,

diffsync/diff.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
"""
1717

1818
from functools import total_ordering
19-
from typing import Any, Iterator, Optional, Type, List, Dict, Iterable
19+
from typing import Any, Dict, Iterable, Iterator, List, Optional, Type
2020

21-
from .exceptions import ObjectAlreadyExists
22-
from .utils import intersection, OrderedDefaultDict
2321
from .enum import DiffSyncActions
22+
from .exceptions import ObjectAlreadyExists
23+
from .utils import OrderedDefaultDict, intersection
2424

2525
# This workaround is used because we are defining a method called `str` in our class definition, which therefore renders
2626
# the builtin `str` type unusable.
@@ -105,8 +105,7 @@ def order_children_default(cls, children: Dict[StrType, "DiffElement"]) -> Itera
105105
106106
Since children is already an OrderedDefaultDict, this method is not doing anything special.
107107
"""
108-
for child in children.values():
109-
yield child
108+
yield from children.values()
110109

111110
def summary(self) -> Dict[StrType, int]:
112111
"""Build a dict summary of this Diff and its child DiffElements."""
@@ -161,7 +160,7 @@ def dict(self) -> Dict[StrType, Dict[StrType, Dict]]:
161160
class DiffElement: # pylint: disable=too-many-instance-attributes
162161
"""DiffElement object, designed to represent a single item/object that may or may not have any diffs."""
163162

164-
def __init__(
163+
def __init__( # pylint: disable=too-many-positional-arguments
165164
self,
166165
obj_type: StrType,
167166
name: StrType,

diffsync/exceptions.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17+
1718
from typing import TYPE_CHECKING, Union, Any
1819

1920
if TYPE_CHECKING:

0 commit comments

Comments
 (0)