annet 3.17.0__py3-none-any.whl → 3.17.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of annet might be problematic. Click here for more details.

annet/annlib/jsontools.py CHANGED
@@ -91,7 +91,23 @@ def _pointer_set(pointer: jsonpointer.JsonPointer, doc: Any, value: Any) -> None
91
91
 
92
92
  def make_patch(old: Dict[str, Any], new: Dict[str, Any]) -> List[Dict[str, Any]]:
93
93
  """Generate a JSON patch by comparing the old document with the new one."""
94
- return sorted(jsonpatch.make_patch(old, new).patch, key=itemgetter("path"))
94
+ # NOTE: changing order of the patch operations (e.g. sorting)
95
+ # may interfere with the `move` logic.
96
+ # E.g.:
97
+ # ```python
98
+ # old = [["a", "b"], ["c", "d"]]
99
+ # new = [["d", "c"], ["b", "a"]]
100
+ # ```
101
+ # produces the following patch:
102
+ # ```json
103
+ # [{"op": "move", "path": "/0/0", "from": "/1/0"},
104
+ # {"op": "move", "path": "/1/0", "from": "/0/2"},
105
+ # {"op": "move", "path": "/0/0", "from": "/1/1"},
106
+ # {"op": "move", "path": "/1/1", "from": "/0/2"}]
107
+ # ```
108
+ # which relies on proper ordering to be correctly applied.
109
+ # See https://github.com/annetutil/annet/pull/452 for details.
110
+ return jsonpatch.make_patch(old, new).patch
95
111
 
96
112
 
97
113
  def apply_patch(content: Optional[bytes], patch_bytes: bytes) -> bytes:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: annet
3
- Version: 3.17.0
3
+ Version: 3.17.1
4
4
  Summary: annet
5
5
  Home-page: https://github.com/annetutil/annet
6
6
  License: MIT
@@ -55,7 +55,7 @@ annet/annlib/command.py,sha256=GsgzQ8oFiHFan1Tfyo340rWgfhyU4_sCKJGhBm2jG6Y,1258
55
55
  annet/annlib/diff.py,sha256=MZ6eQAU3cadQp8KaSE6uAYFtcfMDCIe_eNuVROnYkCk,4496
56
56
  annet/annlib/errors.py,sha256=jBcSFzY6Vj-FxR__vqjFm-87AwYQ0xHuAopTirii5AU,287
57
57
  annet/annlib/filter_acl.py,sha256=ZJvNpSwE5MzJS_sKLenQpZgTuM-IrngwcbukQRq90do,7195
58
- annet/annlib/jsontools.py,sha256=H9O-NM1Ix8okD3QOiTppfzkODKVTqQeE3FvBMuAiMiU,7441
58
+ annet/annlib/jsontools.py,sha256=licizwJye0HYm3YAOHinhNIom70DyW8rQtwodx7iCkM,8055
59
59
  annet/annlib/lib.py,sha256=lxmYrbeablFMhFtvFmADVpVShSFi9TN4gNWaBs_Ygm0,14952
60
60
  annet/annlib/output.py,sha256=g8d_LyNg5snywt0iPQuL9OFpoxKMdN59VW-vcrKitTQ,7674
61
61
  annet/annlib/patching.py,sha256=1bxlLDRx15GjB6aNk6kAx7t3WPPLHffYvSy7VLGnCig,21506
@@ -208,8 +208,8 @@ annet/vendors/library/optixtrans.py,sha256=VdME69Ca4HAEgoaKN21fZxnmmsqqaxOe_HZja
208
208
  annet/vendors/library/pc.py,sha256=vfv31_NPi7M-4AUDL89UcpawK2E6xvCpELA209cd1ho,1086
209
209
  annet/vendors/library/ribbon.py,sha256=DDOBq-_-FL9dCxqXs2inEWZ-pvw-dJ-A-prA7cKMhec,1216
210
210
  annet/vendors/library/routeros.py,sha256=iQa7m_4wjuvcgBOI9gyZwlw1BvzJfOkvUbyoEk-NI9I,1254
211
- annet-3.17.0.dist-info/licenses/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
212
- annet-3.17.0.dist-info/licenses/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
211
+ annet-3.17.1.dist-info/licenses/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
212
+ annet-3.17.1.dist-info/licenses/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
213
213
  annet_generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
214
214
  annet_generators/example/__init__.py,sha256=OJ77uj8axc-FIyIu_Xdcnzmde3oQW5mk5qbODkhuVc8,355
215
215
  annet_generators/example/hostname.py,sha256=RloLzNVetEoWPLITzfJ13Nk3CC0yi-cZB1RTd6dnuhI,2541
@@ -222,8 +222,8 @@ annet_generators/rpl_example/generator.py,sha256=EWah19gOH8G-QyNyWqxCqdRi0BK7GbM
222
222
  annet_generators/rpl_example/items.py,sha256=HPgxScDvSqJPdz0c2SppDrH82DZYC4zUaniQwcWmh4A,1176
223
223
  annet_generators/rpl_example/mesh.py,sha256=z_WgfDZZ4xnyh3cSf75igyH09hGvtexEVwy1gCD_DzA,288
224
224
  annet_generators/rpl_example/route_policy.py,sha256=z6nPb0VDeQtKD1NIg9sFvmUxBD5tVs2frfNIuKdM-5c,2318
225
- annet-3.17.0.dist-info/METADATA,sha256=C87PBTHYS5svy-j2qCf-0TBBtFM0jbbB7FcQ1cvzg-0,850
226
- annet-3.17.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
227
- annet-3.17.0.dist-info/entry_points.txt,sha256=5lIaDGlGi3l6QQ2ry2jZaqViP5Lvt8AmsegdD0Uznck,192
228
- annet-3.17.0.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
229
- annet-3.17.0.dist-info/RECORD,,
225
+ annet-3.17.1.dist-info/METADATA,sha256=EQkXfefC9u4bnO2LEjZmSk1xAEHYwDpGx1tH1jcHdNk,850
226
+ annet-3.17.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
227
+ annet-3.17.1.dist-info/entry_points.txt,sha256=5lIaDGlGi3l6QQ2ry2jZaqViP5Lvt8AmsegdD0Uznck,192
228
+ annet-3.17.1.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
229
+ annet-3.17.1.dist-info/RECORD,,
File without changes