skilleter-thingy 0.0.61__py3-none-any.whl → 0.0.62__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 skilleter-thingy might be problematic. Click here for more details.

@@ -31,6 +31,7 @@ TF_IGNORE_MSG = 'Unless you have made equivalent changes to your configuration,
31
31
 
32
32
  TF_REFRESHING_AND_READING = re.compile(r'.*: (?:Refreshing state\.\.\.|Reading\.\.\.|Still reading\.\.\.|Read complete after |Preparing import\.\.\.).*')
33
33
  TF_FINDING_AND_INSTALLING = re.compile(r'- (?:Finding .*[.]{3}|Installing .*[.]{3}|Installed .*)')
34
+ TF_FETCHING_AND_INSTALLING = re.compile(r'(Fetching|Installing|Using) [-a-z0-9_]+ [0-9.]+')
34
35
 
35
36
  TF_UNCHANGED_HIDDEN = re.compile(r' +# \(\d+ unchanged (?:attribute|block|element)s? hidden\)')
36
37
 
@@ -40,16 +41,22 @@ TF_HAS_CHANGED_END = re.compile(r' [}]')
40
41
  TF_READ_DURING_APPLY = re.compile(r' +# [-a-z_.0-9\[\]]+ will be read during apply')
41
42
  TF_READ_DURING_APPLY_END = re.compile(r' [}]')
42
43
 
44
+ TF_TAG_CHANGE_BLOCK_START = re.compile(r'^ +~ +tags(_all)? += +\{$')
45
+ TF_TAG_ENTRY_IGNORE = re.compile(r'^ +".*" += +".*"')
46
+ TF_TAG_CHANGE_BLOCK_END = re.compile(r'^ +}$')
47
+
43
48
  TF_MISC_REGEX = \
44
49
  [
45
50
  { 'regex': re.compile(r'(Read complete after) \d+s'), 'replace': r'\1 {SECONDS}'},
46
51
  { 'regex': re.compile(r'"(.*:.*)"( = ".*")'), 'replace': r'\1\2'},
47
52
  { 'regex': re.compile(r'"(.*:.*)"( = \[$)'), 'replace': r'\1\2'},
53
+ { 'regex': re.compile(r'^last "terraform apply":$'), 'replace':r'last "terraform apply" which may have affected this plan:'},
48
54
  ]
49
55
 
50
56
  TF_IGNORE_LIST = [
51
57
  {'start': TF_HAS_CHANGED, 'end': TF_HAS_CHANGED_END},
52
58
  {'start': TF_READ_DURING_APPLY, 'end': TF_READ_DURING_APPLY_END},
59
+ {'start': re.compile('(Releasing|Acquiring) state lock. This may take a few moments\.+')},
53
60
  ]
54
61
 
55
62
  ################################################################################
@@ -142,6 +149,10 @@ def cleanfile(args, infile, outfile):
142
149
 
143
150
  collection = []
144
151
 
152
+ # True if we are processing a tag block
153
+
154
+ in_tag_block = False
155
+
145
156
  # Read, process and write stdin to stdout, converting appropriately
146
157
 
147
158
  for data in infile:
@@ -196,22 +207,31 @@ def cleanfile(args, infile, outfile):
196
207
 
197
208
  for ignore in TF_IGNORE_LIST:
198
209
  if ignore['start'].fullmatch(clean):
199
- ignore_until = ignore['end']
210
+ if 'end' in ignore:
211
+ ignore_until = ignore['end']
212
+
213
+ logging.info('Found ignore start marker: "%s"', clean)
214
+ logging.info('Skipping until end marker: "%s"', ignore_until.pattern)
215
+ else:
216
+ clean = None
200
217
 
201
- logging.info('Found ignore start marker: "%s"', clean)
202
- logging.info('Skipping until end marker: "%s"', ignore_until.pattern)
203
218
  break
204
219
  else:
205
- if TF_UNCHANGED_HIDDEN.fullmatch(clean):
220
+ if TF_TAG_CHANGE_BLOCK_START.fullmatch(clean):
221
+ in_tag_block = True
222
+
223
+ elif TF_TAG_CHANGE_BLOCK_END.fullmatch(clean):
224
+ in_tag_block = False
225
+
226
+ elif TF_UNCHANGED_HIDDEN.fullmatch(clean):
206
227
  clean = None
207
228
 
208
229
  elif clean == TF_IGNORE_MSG:
209
230
  clean = None
210
231
 
211
- elif TF_REFRESHING_AND_READING.match(clean) or TF_FINDING_AND_INSTALLING.fullmatch(clean):
232
+ elif TF_REFRESHING_AND_READING.match(clean) or TF_FINDING_AND_INSTALLING.fullmatch(clean) or TF_FETCHING_AND_INSTALLING.fullmatch(clean):
212
233
  # Collect a block of non-deterministically-ordered data
213
234
 
214
- logging.info('Adding "%s" to collection', clean)
215
235
  collection.append(clean)
216
236
  clean = None
217
237
 
@@ -227,6 +247,9 @@ def cleanfile(args, infile, outfile):
227
247
 
228
248
  collection = []
229
249
 
250
+ if in_tag_block and clean and TF_TAG_ENTRY_IGNORE.fullmatch(clean):
251
+ clean = None
252
+
230
253
  # Write normal output, skipping >1 blank lines
231
254
 
232
255
  if clean is not None and not ignore_until:
@@ -248,6 +271,10 @@ def cleanfile(args, infile, outfile):
248
271
  print(f'INTERNAL ERROR: Code never found end of ignore-block marker "{ignore_until.pattern}" - either the Terraform output format has changed, or the log file is incomplete!')
249
272
  sys.exit(2)
250
273
 
274
+ if in_tag_block:
275
+ print('INTERNAL ERROR: Code never found end of tag block marker - either the Terraform output format has changed, or the log file is incomplete!')
276
+ sys.exit(2)
277
+
251
278
  ################################################################################
252
279
 
253
280
  def main():
@@ -58,8 +58,8 @@ RE_TIME = [
58
58
 
59
59
  {'regex': re.compile(r'[0-9]([.][0-9]*)*\s*(second[s]?)'), 'replace': '{ELAPSED}'},
60
60
 
61
- {'find': r'{DATE} {TIME}', 'replace': '{DATE+TIME}'},
62
- {'find': r'\d{2}m \d{2}s', 'replace': '{TIME}'},
61
+ {'find': '\{DATE\} \{TIME\}', 'replace': '{DATE+TIME}'},
62
+ {'regex': re.compile(r'[0-9]{2}m [0-9]{2}s'), 'replace': '{TIME}'},
63
63
  ]
64
64
 
65
65
  # SHA values
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: skilleter_thingy
3
- Version: 0.0.61
3
+ Version: 0.0.62
4
4
  Summary: A collection of useful utilities, mainly aimed at making Git more friendly
5
5
  Author-email: John Skilleter <john@skilleter.org.uk>
6
6
  Project-URL: Home, https://skilleter.org.uk
7
7
  Classifier: Programming Language :: Python :: 3
8
8
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
9
9
  Classifier: Operating System :: OS Independent
10
- Requires-Python: >=3.6
10
+ Requires-Python: >=3.8
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Requires-Dist: imagehash
@@ -28,7 +28,7 @@ skilleter_thingy/moviemover.py,sha256=j_Xb9_jFdgpFBAXcF4tEqbnKH_FonlnUU39LiCK980
28
28
  skilleter_thingy/photodupe.py,sha256=l0hbzSLb2Vk2ceteg-x9fHXCEE1uUuFo84hz5rsZUPA,4184
29
29
  skilleter_thingy/phototidier.py,sha256=5gSjlINUxf3ZQl3NG0o7CsWwODvTbokIMIafLFvn8Hc,7818
30
30
  skilleter_thingy/py_audit.py,sha256=xJm5k5qyeA6ii8mODa4dOkmP8L1drv94UHuxR54RsIM,4384
31
- skilleter_thingy/readable.py,sha256=I1S78l-kt-f7TvVvMolhEdlZtF3-NZtDTjcEingoSHA,11814
31
+ skilleter_thingy/readable.py,sha256=YYzeZuaUAwz_dx47X4D8qoHURVXw5CsN_ziGpuHXqlA,12985
32
32
  skilleter_thingy/remdir.py,sha256=SkN9xEc1ckFGRP4zS2LUbx7Ihw697YMV0ybr_-afiyE,4653
33
33
  skilleter_thingy/rmdupe.py,sha256=tcX3w8XvliGwBMdSt9BUu07kuDtQEc0IiU8sCxmgzHA,17117
34
34
  skilleter_thingy/rpylint.py,sha256=TzZ5GvWrqgTKYKZwadTvzdbX-DJ8ll4WfVJqtN6IzO0,2635
@@ -58,11 +58,11 @@ skilleter_thingy/thingy/popup.py,sha256=jW-nbpdeswqEMTli7OmBv1J8XQsvFoMI0J33O6dO
58
58
  skilleter_thingy/thingy/process.py,sha256=WJLg3js1zdgI7Nlkt7e5ICltkjXcA9P1f-LWPSZCdWs,3570
59
59
  skilleter_thingy/thingy/run.py,sha256=6SNKWF01fSxzB10GMU9ajraXYZqAL1w0PXkqjJdr1Uo,12611
60
60
  skilleter_thingy/thingy/tfm_pane.py,sha256=oqy5zBzKwfbjbGqetbbhpKi4x5He7sl4qkmhUeqtdZc,19789
61
- skilleter_thingy/thingy/tidy.py,sha256=0EVUP2XyUTtoIpqaDwvrHL58YxM4Elvu5MO1nzhwLG4,5854
61
+ skilleter_thingy/thingy/tidy.py,sha256=1TO7BdfC7oizUnG6p66LxFV1_I7H835SFh3ugxCzol0,5876
62
62
  skilleter_thingy/thingy/venv_template.py,sha256=SsVNvSwojd8NnFeQaZPCRQYTNdwJRplpZpygbUEXRnY,1015
63
- skilleter_thingy-0.0.61.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
64
- skilleter_thingy-0.0.61.dist-info/METADATA,sha256=5MPCMmouJ9scaoLffGMLOSyp_0Cjn1DOeJuGRiwMWTE,5313
65
- skilleter_thingy-0.0.61.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
66
- skilleter_thingy-0.0.61.dist-info/entry_points.txt,sha256=IT6cZSbGHrd2UzIQbiMRotKiTJnYJBkESC4fAe8gjsE,2026
67
- skilleter_thingy-0.0.61.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
68
- skilleter_thingy-0.0.61.dist-info/RECORD,,
63
+ skilleter_thingy-0.0.62.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
64
+ skilleter_thingy-0.0.62.dist-info/METADATA,sha256=35e1F-eA_ZYivbxww1bE4AsIMecwG_ZM7i0Hb0mEN9U,5313
65
+ skilleter_thingy-0.0.62.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
66
+ skilleter_thingy-0.0.62.dist-info/entry_points.txt,sha256=IT6cZSbGHrd2UzIQbiMRotKiTJnYJBkESC4fAe8gjsE,2026
67
+ skilleter_thingy-0.0.62.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
68
+ skilleter_thingy-0.0.62.dist-info/RECORD,,