streamflow-postgresql 0.0.10__tar.gz → 0.0.12__tar.gz

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.
Files changed (23) hide show
  1. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/PKG-INFO +2 -2
  2. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/pyproject.toml +17 -12
  3. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow/plugins/unito/postgresql/database.py +7 -7
  4. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow_postgresql.egg-info/PKG-INFO +2 -2
  5. streamflow_postgresql-0.0.12/streamflow_postgresql.egg-info/requires.txt +2 -0
  6. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/tests/test_cwl_persistence.py +46 -45
  7. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/tests/test_database.py +2 -2
  8. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/tests/test_persistence.py +32 -33
  9. streamflow_postgresql-0.0.10/streamflow_postgresql.egg-info/requires.txt +0 -2
  10. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/LICENSE +0 -0
  11. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/MANIFEST.in +0 -0
  12. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/README.md +0 -0
  13. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/setup.cfg +0 -0
  14. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow/plugins/unito/postgresql/__init__.py +0 -0
  15. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow/plugins/unito/postgresql/plugin.py +0 -0
  16. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow/plugins/unito/postgresql/schemas/postgresql.json +0 -0
  17. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow/plugins/unito/postgresql/schemas/postgresql.sql +0 -0
  18. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow/plugins/unito/postgresql/version.py +0 -0
  19. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow_postgresql.egg-info/SOURCES.txt +0 -0
  20. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow_postgresql.egg-info/dependency_links.txt +0 -0
  21. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow_postgresql.egg-info/entry_points.txt +0 -0
  22. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow_postgresql.egg-info/top_level.txt +0 -0
  23. {streamflow_postgresql-0.0.10 → streamflow_postgresql-0.0.12}/streamflow_postgresql.egg-info/zip-safe +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamflow-postgresql
3
- Version: 0.0.10
3
+ Version: 0.0.12
4
4
  Summary: StreamFlow PostgreSQL plugin
5
5
  Author-email: Iacopo Colonnelli <iacopo.colonnelli@unito.it>
6
6
  License: LGPL-3.0-or-later
@@ -25,7 +25,7 @@ Requires-Python: >=3.10
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
27
  Requires-Dist: asyncpg==0.31.0
28
- Requires-Dist: streamflow==0.2.0.dev14
28
+ Requires-Dist: streamflow==0.2.0rc2
29
29
  Dynamic: license-file
30
30
 
31
31
  # PostgreSQL Plugin for StreamFlow
@@ -30,9 +30,9 @@ classifiers = [
30
30
  ]
31
31
  dependencies = [
32
32
  "asyncpg==0.31.0",
33
- "streamflow==0.2.0.dev14"
33
+ "streamflow==0.2.0rc2"
34
34
  ]
35
- version = "0.0.10"
35
+ version = "0.0.12"
36
36
 
37
37
  [project.urls]
38
38
  Package = "https://pypi.org/project/streamflow-postgresql"
@@ -48,20 +48,19 @@ dev = [
48
48
  {include-group = "test"}
49
49
  ]
50
50
  bandit = [
51
- "bandit==1.9.3"
51
+ "bandit==1.9.4"
52
52
  ]
53
53
  lint = [
54
- "black==26.1.0",
55
- "codespell==2.4.1",
56
- "flake8-bugbear==25.11.29",
57
- "isort==7.0.0",
58
- "pyupgrade==3.21.2"
54
+ "black==26.3.1",
55
+ "codespell==2.4.2",
56
+ "pyupgrade==3.21.2",
57
+ "ruff==0.15.12"
59
58
  ]
60
59
  test = [
61
60
  "cwltest==2.6.20251216093331",
62
- "pytest==9.0.2",
61
+ "pytest==9.0.3",
63
62
  "pytest-asyncio==1.3.0",
64
- "pytest-cov==7.0.0",
63
+ "pytest-cov==7.1.0",
65
64
  "pytest-xdist==3.8.0"
66
65
  ]
67
66
 
@@ -74,5 +73,11 @@ zip-safe = true
74
73
  [tool.setuptools.package-data]
75
74
  "streamflow.plugins.unito.postgresql" = ["schemas/*.json", "schemas/*.sql"]
76
75
 
77
- [tool.isort]
78
- profile = "black"
76
+ [tool.ruff]
77
+ exclude = ["streamflow/cwl/antlr"]
78
+ line-length = 88
79
+ target-version = "py310"
80
+
81
+ [tool.ruff.lint]
82
+ select = ["E", "W", "F", "B", "I"]
83
+ ignore = ["E203", "E501", "B904"]
@@ -7,8 +7,8 @@ from importlib.resources import files
7
7
  from typing import Any
8
8
 
9
9
  import asyncpg
10
+ from cachebox import cached
10
11
  from streamflow.core import utils
11
- from streamflow.core.asyncache import cachedmethod
12
12
  from streamflow.core.context import StreamFlowContext
13
13
  from streamflow.core.deployment import Target
14
14
  from streamflow.core.persistence import DependencyType
@@ -325,7 +325,7 @@ class PostgreSQLDatabase(CachedDatabase):
325
325
  token_id,
326
326
  )
327
327
 
328
- @cachedmethod(lambda self: self.deployment_cache)
328
+ @cached(cache=lambda self: self.deployment_cache)
329
329
  async def get_deployment(self, deployment_id: int) -> MutableMapping[str, Any]:
330
330
  async with self.pool as pool:
331
331
  async with pool.acquire() as conn:
@@ -368,7 +368,7 @@ class PostgreSQLDatabase(CachedDatabase):
368
368
  for row in rows
369
369
  ]
370
370
 
371
- @cachedmethod(lambda self: self.filter_cache)
371
+ @cached(cache=lambda self: self.filter_cache)
372
372
  async def get_filter(self, filter_id: int) -> MutableMapping[str, Any]:
373
373
  async with self.pool as pool:
374
374
  async with pool.acquire() as conn:
@@ -426,7 +426,7 @@ class PostgreSQLDatabase(CachedDatabase):
426
426
  DependencyType.INPUT.value,
427
427
  )
428
428
 
429
- @cachedmethod(lambda self: self.port_cache)
429
+ @cached(cache=lambda self: self.port_cache)
430
430
  async def get_port(self, port_id: int) -> MutableMapping[str, Any]:
431
431
  async with self.pool as pool:
432
432
  async with pool.acquire() as conn:
@@ -490,7 +490,7 @@ class PostgreSQLDatabase(CachedDatabase):
490
490
  )
491
491
  return list(result.values())
492
492
 
493
- @cachedmethod(lambda self: self.step_cache)
493
+ @cached(cache=lambda self: self.step_cache)
494
494
  async def get_step(self, step_id: int) -> MutableMapping[str, Any]:
495
495
  async with self.pool as pool:
496
496
  async with pool.acquire() as conn:
@@ -500,7 +500,7 @@ class PostgreSQLDatabase(CachedDatabase):
500
500
  )
501
501
  )
502
502
 
503
- @cachedmethod(lambda self: self.target_cache)
503
+ @cached(cache=lambda self: self.target_cache)
504
504
  async def get_target(self, target_id: int) -> MutableMapping[str, Any]:
505
505
  async with self.pool as pool:
506
506
  async with pool.acquire() as conn:
@@ -512,7 +512,7 @@ class PostgreSQLDatabase(CachedDatabase):
512
512
  )
513
513
  )
514
514
 
515
- @cachedmethod(lambda self: self.token_cache)
515
+ @cached(cache=lambda self: self.token_cache)
516
516
  async def get_token(self, token_id: int) -> MutableMapping[str, Any]:
517
517
  async with self.pool as pool:
518
518
  async with pool.acquire() as conn:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamflow-postgresql
3
- Version: 0.0.10
3
+ Version: 0.0.12
4
4
  Summary: StreamFlow PostgreSQL plugin
5
5
  Author-email: Iacopo Colonnelli <iacopo.colonnelli@unito.it>
6
6
  License: LGPL-3.0-or-later
@@ -25,7 +25,7 @@ Requires-Python: >=3.10
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
27
  Requires-Dist: asyncpg==0.31.0
28
- Requires-Dist: streamflow==0.2.0.dev14
28
+ Requires-Dist: streamflow==0.2.0rc2
29
29
  Dynamic: license-file
30
30
 
31
31
  # PostgreSQL Plugin for StreamFlow
@@ -0,0 +1,2 @@
1
+ asyncpg==0.31.0
2
+ streamflow==0.2.0rc2
@@ -165,7 +165,7 @@ def _create_cwl_token_processor(name: str, workflow: CWLWorkflow) -> CWLTokenPro
165
165
 
166
166
 
167
167
  @pytest.mark.asyncio
168
- async def test_clone_transformer(context: StreamFlowContext):
168
+ async def test_clone_transformer(context: StreamFlowContext) -> None:
169
169
  """Test saving and loading CloneTransformer from database"""
170
170
  workflow, (in_port, replica_port, out_port) = await create_workflow(
171
171
  context=context, num_port=3
@@ -184,7 +184,7 @@ async def test_clone_transformer(context: StreamFlowContext):
184
184
 
185
185
 
186
186
  @pytest.mark.asyncio
187
- async def test_cwl_file_token(context: StreamFlowContext):
187
+ async def test_cwl_file_token(context: StreamFlowContext) -> None:
188
188
  """Test saving and loading CWLFileToken from database"""
189
189
  token = get_full_instantiation(
190
190
  cls_=CWLFileToken,
@@ -207,13 +207,13 @@ async def test_cwl_file_token(context: StreamFlowContext):
207
207
 
208
208
  @pytest.mark.asyncio
209
209
  @pytest.mark.parametrize("processor_t", ["none", "primitive", "map", "object", "union"])
210
- async def test_cwl_command(context: StreamFlowContext, processor_t: str):
210
+ async def test_cwl_command(context: StreamFlowContext, processor_t: str) -> None:
211
211
  """Test saving and loading ExecuteStep with CWLCommand and CWLCommandTokenProcessor classes from database"""
212
212
  workflow = CWLWorkflow(
213
213
  context=context, name=utils.random_name(), config={}, cwl_version=CWL_VERSION
214
214
  )
215
215
  job_port = workflow.create_port(JobPort)
216
- await workflow.save(context)
216
+ await workflow.save(context.database)
217
217
  match processor_t:
218
218
  case "none":
219
219
  processors = None
@@ -272,13 +272,13 @@ async def test_cwl_command(context: StreamFlowContext, processor_t: str):
272
272
 
273
273
 
274
274
  @pytest.mark.asyncio
275
- async def test_cwl_expression_command(context: StreamFlowContext):
275
+ async def test_cwl_expression_command(context: StreamFlowContext) -> None:
276
276
  """Test saving and loading ExecuteStep with CWLExpressionCommand from database"""
277
277
  workflow = CWLWorkflow(
278
278
  context=context, name=utils.random_name(), config={}, cwl_version=CWL_VERSION
279
279
  )
280
280
  job_port = workflow.create_port(JobPort)
281
- await workflow.save(context)
281
+ await workflow.save(context.database)
282
282
  step = workflow.create_step(
283
283
  cls=ExecuteStep, name=utils.random_name(), job_port=job_port
284
284
  )
@@ -301,7 +301,7 @@ async def test_cwl_expression_command(context: StreamFlowContext):
301
301
  "output_type",
302
302
  ["no_output", "default", "expression", "primitive", "object", "union"],
303
303
  )
304
- async def test_cwl_execute_step(context: StreamFlowContext, output_type: str):
304
+ async def test_cwl_execute_step(context: StreamFlowContext, output_type: str) -> None:
305
305
  """Test saving and loading CWLExecuteStep from database"""
306
306
  workflow = CWLWorkflow(
307
307
  context=context, name=utils.random_name(), config={}, cwl_version=CWL_VERSION
@@ -309,7 +309,7 @@ async def test_cwl_execute_step(context: StreamFlowContext, output_type: str):
309
309
  job_port = workflow.create_port(JobPort)
310
310
  if output_type != "no_output":
311
311
  port = workflow.create_port()
312
- await workflow.save(context)
312
+ await workflow.save(context.database)
313
313
 
314
314
  step = get_full_instantiation(
315
315
  cls_=CWLExecuteStep,
@@ -385,7 +385,7 @@ async def test_cwl_execute_step(context: StreamFlowContext, output_type: str):
385
385
 
386
386
 
387
387
  @pytest.mark.asyncio
388
- async def test_list_merge_combinator(context: StreamFlowContext):
388
+ async def test_list_merge_combinator(context: StreamFlowContext) -> None:
389
389
  """Test saving and loading CombinatorStep with ListMergeCombinator from database"""
390
390
  workflow, (port,) = await create_workflow(context=context, num_port=1)
391
391
  name = utils.random_name()
@@ -419,7 +419,7 @@ async def test_list_merge_combinator(context: StreamFlowContext):
419
419
 
420
420
 
421
421
  @pytest.mark.asyncio
422
- async def test_default_transformer(context: StreamFlowContext):
422
+ async def test_default_transformer(context: StreamFlowContext) -> None:
423
423
  """Test saving and loading DefaultTransformer from database"""
424
424
  workflow, (port,) = await create_workflow(context=context, num_port=1)
425
425
  step = get_full_instantiation(
@@ -433,7 +433,7 @@ async def test_default_transformer(context: StreamFlowContext):
433
433
 
434
434
 
435
435
  @pytest.mark.asyncio
436
- async def test_default_retag_transformer(context: StreamFlowContext):
436
+ async def test_default_retag_transformer(context: StreamFlowContext) -> None:
437
437
  """Test saving and loading DefaultRetagTransformer from database"""
438
438
  workflow, (port,) = await create_workflow(context=context, num_port=1)
439
439
  step = get_full_instantiation(
@@ -451,7 +451,9 @@ async def test_default_retag_transformer(context: StreamFlowContext):
451
451
  @pytest.mark.parametrize(
452
452
  "processor_t", ["primitive", "map", "object", "union", "optional"]
453
453
  )
454
- async def test_cwl_token_transformer(context: StreamFlowContext, processor_t: str):
454
+ async def test_cwl_token_transformer(
455
+ context: StreamFlowContext, processor_t: str
456
+ ) -> None:
455
457
  """Test saving and loading CWLTokenTransformer with different TokenProcessor classes from database"""
456
458
  workflow = CWLWorkflow(
457
459
  context=context, name=utils.random_name(), config={}, cwl_version=CWL_VERSION
@@ -459,7 +461,7 @@ async def test_cwl_token_transformer(context: StreamFlowContext, processor_t: st
459
461
  port = workflow.create_port()
460
462
  if workflow.format_graph is None:
461
463
  workflow.format_graph = Graph()
462
- await workflow.save(context)
464
+ await workflow.save(context.database)
463
465
  processor = None
464
466
  match processor_t:
465
467
  case "primitive":
@@ -511,7 +513,7 @@ async def test_cwl_token_transformer(context: StreamFlowContext, processor_t: st
511
513
 
512
514
 
513
515
  @pytest.mark.asyncio
514
- async def test_value_from_transformer(context: StreamFlowContext):
516
+ async def test_value_from_transformer(context: StreamFlowContext) -> None:
515
517
  """Test saving and loading ValueFromTransformer with CWLTokenProcessor from database"""
516
518
  workflow = CWLWorkflow(
517
519
  context=context, name=utils.random_name(), config={}, cwl_version=CWL_VERSION
@@ -519,7 +521,7 @@ async def test_value_from_transformer(context: StreamFlowContext):
519
521
  port = workflow.create_port()
520
522
  if workflow.format_graph is None:
521
523
  workflow.format_graph = Graph()
522
- await workflow.save(context)
524
+ await workflow.save(context.database)
523
525
 
524
526
  step = get_full_instantiation(
525
527
  cls_=ValueFromTransformer,
@@ -536,7 +538,7 @@ async def test_value_from_transformer(context: StreamFlowContext):
536
538
 
537
539
 
538
540
  @pytest.mark.asyncio
539
- async def test_loop_value_from_transformer(context: StreamFlowContext):
541
+ async def test_loop_value_from_transformer(context: StreamFlowContext) -> None:
540
542
  """Test saving and loading LoopValueFromTransformer with CWLTokenProcessor from database"""
541
543
  workflow = CWLWorkflow(
542
544
  context=context, name=utils.random_name(), config={}, cwl_version=CWL_VERSION
@@ -545,20 +547,17 @@ async def test_loop_value_from_transformer(context: StreamFlowContext):
545
547
  port_name = utils.random_name()
546
548
  if workflow.format_graph is None:
547
549
  workflow.format_graph = Graph()
548
- await workflow.save(context)
550
+ await workflow.save(context.database)
549
551
 
550
- step = cast(
551
- LoopValueFromTransformer,
552
- get_full_instantiation(
553
- cls_=LoopValueFromTransformer,
554
- name=f"{utils.random_name()}-loop-value-from-transformer",
555
- processor=_create_cwl_token_processor(port_name, workflow),
556
- port_name=port_name,
557
- expression_lib=True,
558
- full_js=True,
559
- value_from="$(1 + 1 == 0)",
560
- workflow=workflow,
561
- ),
552
+ step = get_full_instantiation(
553
+ cls_=LoopValueFromTransformer,
554
+ name=f"{utils.random_name()}-loop-value-from-transformer",
555
+ processor=_create_cwl_token_processor(port_name, workflow),
556
+ port_name=port_name,
557
+ expression_lib=True,
558
+ full_js=True,
559
+ value_from="$(1 + 1 == 0)",
560
+ workflow=workflow,
562
561
  )
563
562
  step.add_loop_input_port(port_name, ports[0])
564
563
  step.add_loop_source_port(port_name, ports[1])
@@ -567,7 +566,7 @@ async def test_loop_value_from_transformer(context: StreamFlowContext):
567
566
 
568
567
 
569
568
  @pytest.mark.asyncio
570
- async def test_all_non_null_transformer(context: StreamFlowContext):
569
+ async def test_all_non_null_transformer(context: StreamFlowContext) -> None:
571
570
  """Test saving and loading AllNonNullTransformer from database"""
572
571
  workflow, (in_port, out_port) = await create_workflow(context=context)
573
572
  name = utils.random_name()
@@ -583,7 +582,7 @@ async def test_all_non_null_transformer(context: StreamFlowContext):
583
582
 
584
583
 
585
584
  @pytest.mark.asyncio
586
- async def test_first_non_null_transformer(context: StreamFlowContext):
585
+ async def test_first_non_null_transformer(context: StreamFlowContext) -> None:
587
586
  """Test saving and loading FirstNonNullTransformer from database"""
588
587
  workflow, (in_port, out_port) = await create_workflow(context=context)
589
588
  name = utils.random_name()
@@ -599,7 +598,7 @@ async def test_first_non_null_transformer(context: StreamFlowContext):
599
598
 
600
599
 
601
600
  @pytest.mark.asyncio
602
- async def test_forward_transformer(context: StreamFlowContext):
601
+ async def test_forward_transformer(context: StreamFlowContext) -> None:
603
602
  """Test saving and loading ForwardTransformer from database"""
604
603
  workflow, (in_port, out_port) = await create_workflow(context=context)
605
604
  name = utils.random_name()
@@ -615,7 +614,7 @@ async def test_forward_transformer(context: StreamFlowContext):
615
614
 
616
615
 
617
616
  @pytest.mark.asyncio
618
- async def test_list_to_element_transformer(context: StreamFlowContext):
617
+ async def test_list_to_element_transformer(context: StreamFlowContext) -> None:
619
618
  """Test saving and loading ListToElementTransformer from database"""
620
619
  workflow, (in_port, out_port) = await create_workflow(context=context)
621
620
  name = utils.random_name()
@@ -631,7 +630,7 @@ async def test_list_to_element_transformer(context: StreamFlowContext):
631
630
 
632
631
 
633
632
  @pytest.mark.asyncio
634
- async def test_only_non_null_transformer(context: StreamFlowContext):
633
+ async def test_only_non_null_transformer(context: StreamFlowContext) -> None:
635
634
  """Test saving and loading OnlyNonNullTransformer from database"""
636
635
  workflow, (in_port, out_port) = await create_workflow(context=context)
637
636
  name = utils.random_name()
@@ -647,7 +646,7 @@ async def test_only_non_null_transformer(context: StreamFlowContext):
647
646
 
648
647
 
649
648
  @pytest.mark.asyncio
650
- async def test_cwl_empty_scatter_conditional_step(context: StreamFlowContext):
649
+ async def test_cwl_empty_scatter_conditional_step(context: StreamFlowContext) -> None:
651
650
  """Test saving and loading CWLEmptyScatterConditionalStep from database"""
652
651
  workflow, (in_port, out_port) = await create_workflow(context=context)
653
652
  name = utils.random_name()
@@ -664,7 +663,7 @@ async def test_cwl_empty_scatter_conditional_step(context: StreamFlowContext):
664
663
 
665
664
 
666
665
  @pytest.mark.asyncio
667
- async def test_cwl_conditional_step(context: StreamFlowContext):
666
+ async def test_cwl_conditional_step(context: StreamFlowContext) -> None:
668
667
  """Test saving and loading CWLConditionalStep from database"""
669
668
  workflow, (skip_port,) = await create_workflow(context=context, num_port=1)
670
669
  step = get_full_instantiation(
@@ -681,7 +680,7 @@ async def test_cwl_conditional_step(context: StreamFlowContext):
681
680
 
682
681
 
683
682
  @pytest.mark.asyncio
684
- async def test_cwl_loop_conditional_step(context: StreamFlowContext):
683
+ async def test_cwl_loop_conditional_step(context: StreamFlowContext) -> None:
685
684
  """Test saving and loading CWLLoopConditionalStep from database"""
686
685
  workflow, (skip_port,) = await create_workflow(context=context, num_port=1)
687
686
  step = get_full_instantiation(
@@ -698,10 +697,10 @@ async def test_cwl_loop_conditional_step(context: StreamFlowContext):
698
697
 
699
698
 
700
699
  @pytest.mark.asyncio
701
- async def test_cwl_transfer_step(context: StreamFlowContext):
700
+ async def test_cwl_transfer_step(context: StreamFlowContext) -> None:
702
701
  """Test saving and loading CWLTransferStep from database"""
703
702
  workflow, (job_port,) = await create_workflow(context=context, num_port=1)
704
- await workflow.save(context)
703
+ await workflow.save(context.database)
705
704
  step = get_full_instantiation(
706
705
  cls_=CWLTransferStep,
707
706
  name=posixpath.join(utils.random_name(), "__transfer__", "test"),
@@ -715,10 +714,10 @@ async def test_cwl_transfer_step(context: StreamFlowContext):
715
714
 
716
715
 
717
716
  @pytest.mark.asyncio
718
- async def test_cwl_input_injector_step(context: StreamFlowContext):
717
+ async def test_cwl_input_injector_step(context: StreamFlowContext) -> None:
719
718
  """Test saving and loading CWLInputInjectorStep from database"""
720
719
  workflow, (job_port,) = await create_workflow(context=context, num_port=1)
721
- await workflow.save(context)
720
+ await workflow.save(context.database)
722
721
  step = get_full_instantiation(
723
722
  cls_=CWLInputInjectorStep,
724
723
  name=posixpath.join(utils.random_name(), "-injector"),
@@ -731,7 +730,9 @@ async def test_cwl_input_injector_step(context: StreamFlowContext):
731
730
 
732
731
  @pytest.mark.asyncio
733
732
  @pytest.mark.parametrize("step_cls", [CWLLoopOutputAllStep, CWLLoopOutputLastStep])
734
- async def test_cwl_loop_output(context: StreamFlowContext, step_cls: type[Step]):
733
+ async def test_cwl_loop_output(
734
+ context: StreamFlowContext, step_cls: type[Step]
735
+ ) -> None:
735
736
  """Test saving and loading CWLLoopOutput from database"""
736
737
  workflow, _ = await create_workflow(context=context, num_port=0)
737
738
  step = get_full_instantiation(
@@ -744,7 +745,7 @@ async def test_cwl_loop_output(context: StreamFlowContext, step_cls: type[Step])
744
745
 
745
746
 
746
747
  @pytest.mark.asyncio
747
- async def test_cwl_schedule_step(context: StreamFlowContext):
748
+ async def test_cwl_schedule_step(context: StreamFlowContext) -> None:
748
749
  """Test saving and loading CWLScheduleStep with a CWLHardwareRequirement from database"""
749
750
  workflow, (job_port,) = await create_workflow(context, 1)
750
751
  binding_config = get_full_instantiation(
@@ -762,7 +763,7 @@ async def test_cwl_schedule_step(context: StreamFlowContext):
762
763
  target.deployment.name: workflow.create_port(ConnectorPort)
763
764
  for target in binding_config.targets
764
765
  }
765
- await workflow.save(context)
766
+ await workflow.save(context.database)
766
767
  step = get_full_instantiation(
767
768
  cls_=CWLScheduleStep,
768
769
  name=posixpath.join(utils.random_name(), "__schedule__"),
@@ -790,7 +791,7 @@ async def test_cwl_schedule_step(context: StreamFlowContext):
790
791
 
791
792
 
792
793
  @pytest.mark.asyncio
793
- async def test_cwl_workflow(context: StreamFlowContext):
794
+ async def test_cwl_workflow(context: StreamFlowContext) -> None:
794
795
  """Test saving and loading CWLWorkflow from database"""
795
796
  g = Graph()
796
797
  g.add(
@@ -7,7 +7,7 @@ from tests.utils.workflow import create_workflow
7
7
 
8
8
 
9
9
  @pytest.mark.asyncio
10
- async def test_get_steps_queries(context: StreamFlowContext):
10
+ async def test_get_steps_queries(context: StreamFlowContext) -> None:
11
11
  """Test get_input_steps and get_output_steps queries"""
12
12
  workflow, (port_a, job_port, job_port_2, port_b, port_c) = await create_workflow(
13
13
  context, num_port=5
@@ -22,7 +22,7 @@ async def test_get_steps_queries(context: StreamFlowContext):
22
22
  step.add_output_port("out", port_b)
23
23
  step_2.add_input_port("in2", port_b)
24
24
  step_2.add_output_port("out2", port_c)
25
- await workflow.save(context)
25
+ await workflow.save(context.database)
26
26
 
27
27
  input_steps_port_a = await context.database.get_input_steps(port_a.persistent_id)
28
28
  assert len(input_steps_port_a) == 0
@@ -13,7 +13,7 @@ from streamflow.core.deployment import (
13
13
  Target,
14
14
  WrapsConfig,
15
15
  )
16
- from streamflow.core.persistence import DatabaseLoadingContext
16
+ from streamflow.core.persistence import Database, DatabaseLoadingContext
17
17
  from streamflow.core.scheduling import Hardware, HardwareRequirement
18
18
  from streamflow.core.workflow import Job, Port, Status, Token, Workflow
19
19
  from streamflow.workflow.port import ConnectorPort, JobPort
@@ -43,14 +43,13 @@ class DummyHardwareRequirement(HardwareRequirement):
43
43
  @classmethod
44
44
  async def _load(
45
45
  cls,
46
- context: StreamFlowContext,
47
46
  row: MutableMapping[str, Any],
48
47
  loading_context: DatabaseLoadingContext,
49
48
  ) -> Self:
50
49
  return DummyHardwareRequirement()
51
50
 
52
51
  async def _save_additional_params(
53
- self, context: StreamFlowContext
52
+ self, database: Database
54
53
  ) -> MutableMapping[str, Any]:
55
54
  return {}
56
55
 
@@ -59,7 +58,7 @@ class DummyHardwareRequirement(HardwareRequirement):
59
58
 
60
59
 
61
60
  @pytest.mark.asyncio
62
- async def test_workflow(context: StreamFlowContext):
61
+ async def test_workflow(context: StreamFlowContext) -> None:
63
62
  """Test saving and loading Workflow from database"""
64
63
  workflow = get_full_instantiation(
65
64
  cls_=Workflow,
@@ -71,41 +70,41 @@ async def test_workflow(context: StreamFlowContext):
71
70
 
72
71
 
73
72
  @pytest.mark.asyncio
74
- async def test_port(context: StreamFlowContext):
73
+ async def test_port(context: StreamFlowContext) -> None:
75
74
  """Test saving and loading Port from database"""
76
75
  workflow = Workflow(context=context, name=utils.random_name(), config={})
77
- await workflow.save(context)
76
+ await workflow.save(context.database)
78
77
  port = get_full_instantiation(cls_=Port, workflow=workflow, name="my_port")
79
78
  workflow.ports[port.name] = port
80
79
  await save_load_and_test(port, context)
81
80
 
82
81
 
83
82
  @pytest.mark.asyncio
84
- async def test_job_port(context: StreamFlowContext):
83
+ async def test_job_port(context: StreamFlowContext) -> None:
85
84
  """Test saving and loading JobPort from database"""
86
85
  workflow = Workflow(context=context, name=utils.random_name(), config={})
87
- await workflow.save(context)
86
+ await workflow.save(context.database)
88
87
  port = get_full_instantiation(cls_=JobPort, workflow=workflow, name="my_port")
89
88
  workflow.ports[port.name] = port
90
89
  await save_load_and_test(port, context)
91
90
 
92
91
 
93
92
  @pytest.mark.asyncio
94
- async def test_connector_port(context: StreamFlowContext):
93
+ async def test_connector_port(context: StreamFlowContext) -> None:
95
94
  """Test saving and loading ConnectorPort from database"""
96
95
  workflow = Workflow(context=context, name=utils.random_name(), config={})
97
- await workflow.save(context)
96
+ await workflow.save(context.database)
98
97
  port = get_full_instantiation(cls_=ConnectorPort, workflow=workflow, name="my_port")
99
98
  workflow.ports[port.name] = port
100
99
  await save_load_and_test(port, context)
101
100
 
102
101
 
103
102
  @pytest.mark.asyncio
104
- async def test_deploy_step(context: StreamFlowContext):
103
+ async def test_deploy_step(context: StreamFlowContext) -> None:
105
104
  """Test saving and loading DeployStep from database"""
106
105
  workflow = Workflow(context=context, name=utils.random_name(), config={})
107
106
  connector_port = workflow.create_port(cls=ConnectorPort)
108
- await workflow.save(context)
107
+ await workflow.save(context.database)
109
108
 
110
109
  deployment_config = get_docker_deployment_config()
111
110
  step = get_full_instantiation(
@@ -120,7 +119,7 @@ async def test_deploy_step(context: StreamFlowContext):
120
119
 
121
120
 
122
121
  @pytest.mark.asyncio
123
- async def test_schedule_step(context: StreamFlowContext):
122
+ async def test_schedule_step(context: StreamFlowContext) -> None:
124
123
  """Test saving and loading ScheduleStep from database"""
125
124
  workflow, (job_port,) = await create_workflow(context, type_="default", num_port=1)
126
125
  binding_config = get_full_instantiation(
@@ -145,7 +144,7 @@ async def test_schedule_step(context: StreamFlowContext):
145
144
  target.deployment.name: workflow.create_port(ConnectorPort)
146
145
  for target in binding_config.targets
147
146
  }
148
- await workflow.save(context)
147
+ await workflow.save(context.database)
149
148
 
150
149
  step = get_full_instantiation(
151
150
  cls_=ScheduleStep,
@@ -165,10 +164,10 @@ async def test_schedule_step(context: StreamFlowContext):
165
164
 
166
165
 
167
166
  @pytest.mark.asyncio
168
- async def test_execute_step(context: StreamFlowContext):
167
+ async def test_execute_step(context: StreamFlowContext) -> None:
169
168
  """Test saving and loading ExecuteStep from database"""
170
169
  workflow, (job_port,) = await create_workflow(context, type_="default", num_port=1)
171
- await workflow.save(context)
170
+ await workflow.save(context.database)
172
171
 
173
172
  step = get_full_instantiation(
174
173
  cls_=ExecuteStep,
@@ -181,10 +180,10 @@ async def test_execute_step(context: StreamFlowContext):
181
180
 
182
181
 
183
182
  @pytest.mark.asyncio
184
- async def test_gather_step(context: StreamFlowContext):
183
+ async def test_gather_step(context: StreamFlowContext) -> None:
185
184
  """Test saving and loading GatherStep from database"""
186
185
  workflow, (port,) = await create_workflow(context, type_="default", num_port=1)
187
- await workflow.save(context)
186
+ await workflow.save(context.database)
188
187
 
189
188
  step = get_full_instantiation(
190
189
  cls_=GatherStep,
@@ -198,10 +197,10 @@ async def test_gather_step(context: StreamFlowContext):
198
197
 
199
198
 
200
199
  @pytest.mark.asyncio
201
- async def test_scatter_step(context: StreamFlowContext):
200
+ async def test_scatter_step(context: StreamFlowContext) -> None:
202
201
  """Test saving and loading ScatterStep from database"""
203
202
  workflow, (port,) = await create_workflow(context, type_="default", num_port=1)
204
- await workflow.save(context)
203
+ await workflow.save(context.database)
205
204
 
206
205
  step = get_full_instantiation(
207
206
  cls_=ScatterStep,
@@ -218,24 +217,24 @@ async def test_scatter_step(context: StreamFlowContext):
218
217
  "combinator_t",
219
218
  [
220
219
  "cartesian_product_combinator",
221
- "dot_combinator",
220
+ "dot_product_combinator",
222
221
  "loop_combinator",
223
222
  "loop_termination_combinator",
224
223
  ],
225
224
  )
226
- async def test_combinator_step(context: StreamFlowContext, combinator_t: str):
225
+ async def test_combinator_step(context: StreamFlowContext, combinator_t: str) -> None:
227
226
  """
228
227
  Test saving and loading CombinatorStep and LoopCombinatorStep
229
228
  with appropriate Combinator classes from database
230
229
  """
231
230
  workflow = Workflow(context=context, name=utils.random_name(), config={})
232
- await workflow.save(context)
231
+ await workflow.save(context.database)
233
232
  step = get_combinator_step(workflow, combinator_t, inner_combinator=True)
234
233
  await save_load_and_test(step, context)
235
234
 
236
235
 
237
236
  @pytest.mark.asyncio
238
- async def test_target(context: StreamFlowContext):
237
+ async def test_target(context: StreamFlowContext) -> None:
239
238
  """Test saving and loading Target from database"""
240
239
  target = get_full_instantiation(
241
240
  cls_=Target,
@@ -248,14 +247,14 @@ async def test_target(context: StreamFlowContext):
248
247
 
249
248
 
250
249
  @pytest.mark.asyncio
251
- async def test_local_target(context: StreamFlowContext):
250
+ async def test_local_target(context: StreamFlowContext) -> None:
252
251
  """Test saving and loading LocalTarget from database"""
253
252
  target = get_full_instantiation(cls_=LocalTarget, workdir=utils.random_name())
254
253
  await save_load_and_test(target, context)
255
254
 
256
255
 
257
256
  @pytest.mark.asyncio
258
- async def test_token(context: StreamFlowContext):
257
+ async def test_token(context: StreamFlowContext) -> None:
259
258
  """Test saving and loading Token from database"""
260
259
  token = get_full_instantiation(
261
260
  cls_=Token, value=["test", "token"], tag="0.0", recoverable=True
@@ -264,7 +263,7 @@ async def test_token(context: StreamFlowContext):
264
263
 
265
264
 
266
265
  @pytest.mark.asyncio
267
- async def test_job_token(context: StreamFlowContext):
266
+ async def test_job_token(context: StreamFlowContext) -> None:
268
267
  """Test saving and loading JobToken from database"""
269
268
  token = get_full_instantiation(
270
269
  cls_=JobToken,
@@ -283,7 +282,7 @@ async def test_job_token(context: StreamFlowContext):
283
282
 
284
283
 
285
284
  @pytest.mark.asyncio
286
- async def test_list_token(context: StreamFlowContext):
285
+ async def test_list_token(context: StreamFlowContext) -> None:
287
286
  """Test saving and loading ListToken from database"""
288
287
  # The `ListToken` does not accept `recoverable=True` and set its internal attribute to `False`.
289
288
  # However, when using `get_full_instantiation`, passing the `recoverable` value is mandatory.
@@ -298,7 +297,7 @@ async def test_list_token(context: StreamFlowContext):
298
297
 
299
298
 
300
299
  @pytest.mark.asyncio
301
- async def test_object_token(context: StreamFlowContext):
300
+ async def test_object_token(context: StreamFlowContext) -> None:
302
301
  """Test saving and loading ObjectToken from database"""
303
302
  # The `ObjectToken` does not accept `recoverable=True` and set its internal attribute to `False`.
304
303
  # However, when using `get_full_instantiation`, passing the `recoverable` value is mandatory.
@@ -313,21 +312,21 @@ async def test_object_token(context: StreamFlowContext):
313
312
 
314
313
 
315
314
  @pytest.mark.asyncio
316
- async def test_termination_token(context: StreamFlowContext):
315
+ async def test_termination_token(context: StreamFlowContext) -> None:
317
316
  """Test saving and loading TerminationToken from database"""
318
317
  token = get_full_instantiation(cls_=TerminationToken, value=Status.FAILED)
319
318
  await save_load_and_test(token, context)
320
319
 
321
320
 
322
321
  @pytest.mark.asyncio
323
- async def test_iteration_termination_token(context: StreamFlowContext):
322
+ async def test_iteration_termination_token(context: StreamFlowContext) -> None:
324
323
  """Test saving and loading IterationTerminationToken from database"""
325
324
  token = get_full_instantiation(cls_=IterationTerminationToken, tag="0.0")
326
325
  await save_load_and_test(token, context)
327
326
 
328
327
 
329
328
  @pytest.mark.asyncio
330
- async def test_filter_config(context: StreamFlowContext):
329
+ async def test_filter_config(context: StreamFlowContext) -> None:
331
330
  """Test saving and loading filter configuration from database"""
332
331
  config = get_full_instantiation(
333
332
  cls_=FilterConfig,
@@ -339,7 +338,7 @@ async def test_filter_config(context: StreamFlowContext):
339
338
 
340
339
 
341
340
  @pytest.mark.asyncio
342
- async def test_deployment(context: StreamFlowContext):
341
+ async def test_deployment(context: StreamFlowContext) -> None:
343
342
  """Test saving and loading deployment configuration from database"""
344
343
  config = get_full_instantiation(
345
344
  cls_=DeploymentConfig,
@@ -1,2 +0,0 @@
1
- asyncpg==0.31.0
2
- streamflow==0.2.0.dev14