cook-build 0.6.0__py3-none-any.whl → 0.6.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.
cook/__main__.py CHANGED
@@ -356,7 +356,7 @@ def __main__(cli_args: list[str] | None = None) -> None:
356
356
  with closing(
357
357
  sqlite3.connect(args.db, detect_types=sqlite3.PARSE_DECLTYPES)
358
358
  ) as connection:
359
- connection.executescript(QUERIES["schema"])
359
+ _setup_schema(connection)
360
360
  controller = Controller(manager.resolve_dependencies(), connection)
361
361
  command: Command = args.command
362
362
  try:
@@ -370,5 +370,15 @@ def __main__(cli_args: list[str] | None = None) -> None:
370
370
  sys.exit(1)
371
371
 
372
372
 
373
+ def _setup_schema(connection: sqlite3.Connection) -> None:
374
+ connection.executescript(QUERIES["schema"])
375
+ # Attempt to add the column which may not be present for cook versions <0.6.
376
+ try:
377
+ connection.execute("ALTER TABLE tasks ADD COLUMN last_started TIMESTAMP")
378
+ except sqlite3.OperationalError as ex:
379
+ if "duplicate column name" not in ex.args[0]:
380
+ raise # pragma: no cover
381
+
382
+
373
383
  if __name__ == "__main__":
374
384
  __main__()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cook-build
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Requires-Python: >=3.10
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -1,14 +1,14 @@
1
1
  cook/__init__.py,sha256=uNRvyxT6-XuoAMdDujWYa_4ZW0ppAiom6tsxMovZ-A0,180
2
- cook/__main__.py,sha256=TYNxaZmxSjvL2qTxSmlgmaOkSZaulIFaQ_hviBsgMGQ,12527
2
+ cook/__main__.py,sha256=jcXYDWbMkRU24ZrrAZGrsT2wQ7nhimpigrPjfrMsRtk,12925
3
3
  cook/actions.py,sha256=erjjDKC45kQpv_Qb2V3OCGvrrphka4Ytj78RPEvs8Uc,6718
4
4
  cook/contexts.py,sha256=Gw2zfiyVFaJ5p2vAFrFJEQ4f521GznueM2Y2ddiG3iE,10047
5
5
  cook/controller.py,sha256=BYsYxPqEWDwYLAG7-cHzzTuqIvFunGGSge1XAbDk9xs,15753
6
6
  cook/manager.py,sha256=vt-PoZ8IOmPIGbe9xeqUrZ4VJf2Gj5KucwjQzc5YUZ4,5684
7
7
  cook/task.py,sha256=0OGzVKKezo8x6nX80OpLnGsqCG8mIE7oUaBgSqv3m0M,1381
8
8
  cook/util.py,sha256=hpMxxHnmJRfCUUAzkwMQU4kF_JAcEBFVpvPsHxOOY2U,2681
9
- cook_build-0.6.0.dist-info/licenses/LICENSE,sha256=3Nuj_WTTcz7JDg4-9EzNf6vHlKRWpdLUccg-pvoZ3WE,1500
10
- cook_build-0.6.0.dist-info/METADATA,sha256=H0jjPsom6MWmaV_8PLzVwCjra1QjOhMwxXueskdtzyg,3598
11
- cook_build-0.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- cook_build-0.6.0.dist-info/entry_points.txt,sha256=5UP0ZmmxSNKevTVISUJxmdXEQsKrI4n54OQYkjrdX2c,48
13
- cook_build-0.6.0.dist-info/top_level.txt,sha256=ewNQIn2oRSYV98vAsUnw88u2Q8XHKhAz70ed2PEdR2c,5
14
- cook_build-0.6.0.dist-info/RECORD,,
9
+ cook_build-0.6.1.dist-info/licenses/LICENSE,sha256=3Nuj_WTTcz7JDg4-9EzNf6vHlKRWpdLUccg-pvoZ3WE,1500
10
+ cook_build-0.6.1.dist-info/METADATA,sha256=uZtvhDQcm9dpQgn9AioqKAl4U_TaQb3z5D0LNzt_cIM,3598
11
+ cook_build-0.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ cook_build-0.6.1.dist-info/entry_points.txt,sha256=5UP0ZmmxSNKevTVISUJxmdXEQsKrI4n54OQYkjrdX2c,48
13
+ cook_build-0.6.1.dist-info/top_level.txt,sha256=ewNQIn2oRSYV98vAsUnw88u2Q8XHKhAz70ed2PEdR2c,5
14
+ cook_build-0.6.1.dist-info/RECORD,,