makeprov 0.2.2__tar.gz → 0.2.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: makeprov
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: An provenance tracking library for simple Python workflows
5
5
  Author-email: Benno Kruit <b.b.kruit@amsterdamumc.nl>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "makeprov"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "An provenance tracking library for simple Python workflows"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -20,7 +20,8 @@ GLOBAL_CONFIG = ProvenanceConfig()
20
20
 
21
21
  def main(subcommands=None, conf_obj=None, parsers=None):
22
22
  from .core import COMMANDS, flush_prov_buffer, start_prov_buffer
23
-
23
+ global GLOBAL_CONFIG
24
+
24
25
  subcommands = subcommands or COMMANDS
25
26
  conf_obj = conf_obj or GLOBAL_CONFIG
26
27
 
@@ -64,7 +65,7 @@ def main(subcommands=None, conf_obj=None, parsers=None):
64
65
  )
65
66
 
66
67
  ns = apply_globals(sys.argv[1:]) # apply effects early
67
- logging.debug(f"Config: {conf_obj}")
68
+ logging.debug(f"Config: {GLOBAL_CONFIG}")
68
69
  try:
69
70
  if ns.merge_prov:
70
71
  start_prov_buffer()
@@ -110,18 +110,9 @@ def rule(
110
110
  Decorator that infers inputs/outputs from type annotations
111
111
  (InPath / OutPath, including Optional[...] unions) and writes provenance.
112
112
  """
113
- base_config = config or GLOBAL_CONFIG
114
- rule_config = ProvenanceConfig(
115
- base_iri=base_iri if base_iri is not None else base_config.base_iri,
116
- prov_dir=prov_dir if prov_dir is not None else base_config.prov_dir,
117
- prov_path=base_config.prov_path,
118
- force=force if force is not None else base_config.force,
119
- dry_run=dry_run if dry_run is not None else base_config.dry_run,
120
- out_fmt=out_fmt if out_fmt is not None else base_config.out_fmt,
121
- jsonld_with_context=base_config.jsonld_with_context,
122
- )
123
113
 
124
114
  def decorator(func):
115
+
125
116
  sig = inspect.signature(func)
126
117
  hints = get_type_hints(func)
127
118
 
@@ -168,6 +159,18 @@ def rule(
168
159
  bound = sig.bind_partial(*args, **kwargs)
169
160
  bound.apply_defaults()
170
161
 
162
+ global GLOBAL_CONFIG
163
+ base_config = config or GLOBAL_CONFIG
164
+ rule_config = ProvenanceConfig(
165
+ base_iri=base_iri if base_iri is not None else base_config.base_iri,
166
+ prov_dir=prov_dir if prov_dir is not None else base_config.prov_dir,
167
+ prov_path=base_config.prov_path,
168
+ force=force if force is not None else base_config.force,
169
+ dry_run=dry_run if dry_run is not None else base_config.dry_run,
170
+ out_fmt=out_fmt if out_fmt is not None else base_config.out_fmt,
171
+ jsonld_with_context=base_config.jsonld_with_context,
172
+ )
173
+
171
174
  effective_jsonld_with_context = (
172
175
  jsonld_with_context
173
176
  if jsonld_with_context is not None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: makeprov
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: An provenance tracking library for simple Python workflows
5
5
  Author-email: Benno Kruit <b.b.kruit@amsterdamumc.nl>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes