oarepo-runtime 1.5.123__py3-none-any.whl → 1.5.125__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.
@@ -24,7 +24,7 @@ def fixtures():
24
24
 
25
25
 
26
26
  @fixtures.command()
27
- @click.argument("fixture_dir", required=False)
27
+ @click.argument("fixture_dir_or_catalogue", required=False)
28
28
  @click.option("--include", multiple=True)
29
29
  @click.option("--exclude", multiple=True)
30
30
  @click.option("--system-fixtures/--no-system-fixtures", default=True, is_flag=True)
@@ -43,7 +43,7 @@ def fixtures():
43
43
  )
44
44
  @with_appcontext
45
45
  def load(
46
- fixture_dir=None,
46
+ fixture_dir_or_catalogue=None,
47
47
  include=None,
48
48
  exclude=None,
49
49
  system_fixtures=None,
@@ -61,7 +61,7 @@ def load(
61
61
  else:
62
62
  callback = fixtures_asynchronous_callback.s()
63
63
 
64
- if fixture_dir:
64
+ if fixture_dir_or_catalogue:
65
65
  system_fixtures = False
66
66
 
67
67
  if not identity:
@@ -84,7 +84,7 @@ def load(
84
84
 
85
85
  with current_app.wsgi_app.mounts["/api"].app_context():
86
86
  load_fixtures(
87
- fixture_dir,
87
+ fixture_dir_or_catalogue,
88
88
  _make_list(include),
89
89
  _make_list(exclude),
90
90
  system_fixtures=system_fixtures,
@@ -110,7 +110,12 @@ def dump(fixture_dir, include, exclude, verbose):
110
110
  callback = TQDMCallback(verbose=verbose)
111
111
 
112
112
  with current_app.wsgi_app.mounts["/api"].app_context():
113
- dump_fixtures(fixture_dir, _make_list(include), _make_list(exclude))
113
+ dump_fixtures(
114
+ fixture_dir,
115
+ _make_list(include),
116
+ _make_list(exclude),
117
+ callback=TQDMCallback(verbose=verbose),
118
+ )
114
119
  _show_stats(callback, "Dump fixtures")
115
120
 
116
121
 
@@ -28,7 +28,7 @@ class FixturesCallback(StatsKeepingDataStreamCallback):
28
28
 
29
29
 
30
30
  def load_fixtures(
31
- fixture_dir=None,
31
+ fixture_dir_or_catalogue=None,
32
32
  include=None,
33
33
  exclude=None,
34
34
  system_fixtures=True,
@@ -54,8 +54,13 @@ def load_fixtures(
54
54
  exclude = [re.compile(x) for x in (exclude or [])]
55
55
  fixtures = set()
56
56
 
57
- if fixture_dir:
58
- catalogue = DataStreamCatalogue(Path(fixture_dir) / "catalogue.yaml")
57
+ if fixture_dir_or_catalogue:
58
+ if Path(fixture_dir_or_catalogue).is_dir():
59
+ fixture_catalogue = Path(fixture_dir_or_catalogue) / "catalogue.yaml"
60
+ else:
61
+ fixture_catalogue = Path(fixture_dir_or_catalogue)
62
+
63
+ catalogue = DataStreamCatalogue(fixture_catalogue)
59
64
  _load_fixtures_from_catalogue(
60
65
  catalogue,
61
66
  fixtures,
@@ -201,7 +206,7 @@ def default_config_generator(service_id, use_files=False):
201
206
  ]
202
207
  if use_files:
203
208
  writers.append(
204
- {"writer": "attachments_file", "target": f"files"},
209
+ {"writer": "attachments_file", "target": "files"},
205
210
  )
206
211
 
207
212
  yield service_id, [
@@ -229,11 +234,11 @@ def fixtures_asynchronous_callback(*args, callback, **kwargs):
229
234
  )
230
235
  else:
231
236
  batch = None
232
- log.info(f"Fixtures progress: %s", callback)
237
+ log.info("Fixtures progress: %s", callback)
233
238
 
234
239
  if "error" in callback:
235
240
  log.error(
236
- f"Error in loading fixtures: %s\n%s\n%s",
241
+ "Error in loading fixtures: %s\n%s\n%s",
237
242
  callback,
238
243
  "\n".join(args),
239
244
  "\n".join(f"{kwarg}: {value}" for kwarg, value in kwargs.items()),
@@ -250,11 +255,11 @@ def fixtures_asynchronous_callback(*args, callback, **kwargs):
250
255
  for entry in batch.entries:
251
256
  if entry.errors:
252
257
  log.error(
253
- f"Errors in entry %s of batch %s:\npayload %s\n",
258
+ "Errors in entry %s of batch %s:\npayload %s\n",
254
259
  entry.seq,
255
260
  batch.seq,
256
261
  entry.entry,
257
262
  "\n".join(str(x) for x in entry.errors),
258
263
  )
259
- except Exception as e:
264
+ except Exception:
260
265
  print(f"Error in fixtures callback: {callback=}, {args=}, {kwargs=}")
@@ -39,7 +39,7 @@ class OaiHarvesterPermissionPolicy(RecordPermissionPolicy):
39
39
  can_draft_commit_files = [SystemProcess()]
40
40
  can_draft_read_files = [SystemProcess()]
41
41
  can_draft_update_files = [SystemProcess()]
42
-
42
+ can_draft_delete_files = [SystemProcess()]
43
43
 
44
44
 
45
45
  class ReadOnlyPermissionPolicy(RecordPermissionPolicy):
@@ -76,6 +76,7 @@ class ReadOnlyPermissionPolicy(RecordPermissionPolicy):
76
76
  can_draft_commit_files = [SystemProcess()]
77
77
  can_draft_read_files = [SystemProcess()]
78
78
  can_draft_update_files = [SystemProcess()]
79
+ can_draft_delete_files = [SystemProcess()]
79
80
 
80
81
  can_add_community = [SystemProcess()]
81
82
  can_remove_community = [SystemProcess()]
@@ -85,7 +86,6 @@ class ReadOnlyPermissionPolicy(RecordPermissionPolicy):
85
86
  can_lift_embargo = [SystemProcess()]
86
87
 
87
88
 
88
-
89
89
  class EveryonePermissionPolicy(RecordPermissionPolicy):
90
90
  """record policy for read only repository"""
91
91
 
@@ -120,6 +120,7 @@ class EveryonePermissionPolicy(RecordPermissionPolicy):
120
120
  can_draft_commit_files = [SystemProcess(), AnyUser()]
121
121
  can_draft_read_files = [SystemProcess(), AnyUser()]
122
122
  can_draft_update_files = [SystemProcess(), AnyUser()]
123
+ can_draft_delete_files = [SystemProcess(), AnyUser()]
123
124
 
124
125
  can_add_community = [SystemProcess(), AnyUser()]
125
126
  can_remove_community = [SystemProcess(), AnyUser()]
@@ -148,6 +149,7 @@ class AuthenticatedPermissionPolicy(RecordPermissionPolicy):
148
149
  can_update_files = [SystemProcess(), AuthenticatedUser()]
149
150
  can_list_files = [SystemProcess(), AuthenticatedUser()]
150
151
  can_manage_files = [SystemProcess(), AuthenticatedUser()]
152
+ can_delete_files = [SystemProcess(), AuthenticatedUser()]
151
153
 
152
154
  can_edit = [SystemProcess(), AuthenticatedUser()]
153
155
  can_new_version = [SystemProcess(), AuthenticatedUser()]
@@ -163,10 +165,10 @@ class AuthenticatedPermissionPolicy(RecordPermissionPolicy):
163
165
  can_draft_commit_files = [SystemProcess(), AuthenticatedUser()]
164
166
  can_draft_read_files = [SystemProcess(), AuthenticatedUser()]
165
167
  can_draft_update_files = [SystemProcess(), AuthenticatedUser()]
168
+ can_draft_delete_files = [SystemProcess(), AuthenticatedUser()]
166
169
 
167
170
  can_add_community = [SystemProcess(), AuthenticatedUser()]
168
171
  can_remove_community = [SystemProcess(), AuthenticatedUser()]
169
172
 
170
- can_delete_files = [SystemProcess(), AuthenticatedUser()]
171
173
  can_manage_record_access = [SystemProcess(), AuthenticatedUser()]
172
174
  can_lift_embargo = [SystemProcess(), AuthenticatedUser()]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: oarepo-runtime
3
- Version: 1.5.123
3
+ Version: 1.5.125
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -11,7 +11,7 @@ oarepo_runtime/cli/base.py,sha256=94RBTa8TOSPxEyEUmYLGXaWen-XktP2-MIbTtZSlCZo,54
11
11
  oarepo_runtime/cli/cf.py,sha256=W0JEJK2JqKubQw8qtZJxohmADDRUBode4JZAqYLDGvc,339
12
12
  oarepo_runtime/cli/check.py,sha256=sCe2PeokSHvNOXHFZ8YHF8NMhsu5nYjyuZuvXHJ6X18,5092
13
13
  oarepo_runtime/cli/configuration.py,sha256=M_19zrS0vo-7uHi047a3i4rQsK6pmp4QS0IEBAxMLZ0,2039
14
- oarepo_runtime/cli/fixtures.py,sha256=l6zHpz1adjotrbFy_wcN2TOL8x20i-1jbQmaoEEo-UU,5419
14
+ oarepo_runtime/cli/fixtures.py,sha256=_aMQqPnspG0JuL5ewYTBa3HY1RaoOAI0V2R5q7e5frw,5570
15
15
  oarepo_runtime/cli/index.py,sha256=8Q2KZlAWjoMyZ9Ft9WIBJDws0ce15VF12o1tdYUP7AI,8936
16
16
  oarepo_runtime/cli/validate.py,sha256=HpSvHQCGHlrdgdpKix9cIlzlBoJEiT1vACZdMnOUGEY,2827
17
17
  oarepo_runtime/cli/permissions/__init__.py,sha256=2qufYdUoCb9kG7Zy0gKNW5lpRyqbVQSNsf7shLwrThM,198
@@ -25,7 +25,7 @@ oarepo_runtime/datastreams/catalogue.py,sha256=D6leq-FPT3RP3SniEAXPm66v3q8ZdQnaU
25
25
  oarepo_runtime/datastreams/datastreams.py,sha256=N9XXwIaBTADkPhE-XG6uotMwd-8Kn0vEZOoeV2BnMGI,4679
26
26
  oarepo_runtime/datastreams/errors.py,sha256=WyZLU53EdFJTLv6K2ooM_M6ISjLS-U1dDw6B7guOLSc,1540
27
27
  oarepo_runtime/datastreams/ext.py,sha256=ivugdVMCqwugK-5SeX14a-dMq6VaTt7DM2wFU357tR4,1406
28
- oarepo_runtime/datastreams/fixtures.py,sha256=LTzRLoS3hkdP7a7wX3fCNWplaxh0DQQjxGto3p1_Luk,8691
28
+ oarepo_runtime/datastreams/fixtures.py,sha256=oc3b1XP7gJmEXVskZTltZUasdeTux-wbgxox66OyIT8,8901
29
29
  oarepo_runtime/datastreams/json.py,sha256=OkIkGKUawtYoGelyS5V92DVk7Ei7SlkMMny2Ue2dDWc,132
30
30
  oarepo_runtime/datastreams/semi_asynchronous.py,sha256=kNc6BBnV6oFoY9kHgf5l8fd1wibRfI0dwyzLtu4fmUA,2940
31
31
  oarepo_runtime/datastreams/synchronous.py,sha256=t5lfnMkLqy3jK5zMl-nIuA0HlMPiHGjwCqZ8XQP-3GM,2595
@@ -91,7 +91,7 @@ oarepo_runtime/services/search.py,sha256=t0WEe2VrbCzZ06-Jgz7C9-pc9y27BqAgTEXldEH
91
91
  oarepo_runtime/services/service.py,sha256=TI2ulEVlSR7HZnfPYltLl8Vf4O9fhJ7rHaV6G4HWbrc,1893
92
92
  oarepo_runtime/services/config/__init__.py,sha256=559w4vphVAipa420OwTsxGUP-b7idoqSIX13FSJyVz0,783
93
93
  oarepo_runtime/services/config/link_conditions.py,sha256=evPRd5XU76Ok4J-08bBfplbHZ019rl74FpJmO8iM5yg,3298
94
- oarepo_runtime/services/config/permissions_presets.py,sha256=jV3Ft7xFdBaeShoa3Q3Q-HHWP-wOX4XYDTRzWwUVL7g,7151
94
+ oarepo_runtime/services/config/permissions_presets.py,sha256=b1wm3JjL8KgkaH7VMkNfdMk5fXtf3X87rB7gkvaNxns,7369
95
95
  oarepo_runtime/services/config/service.py,sha256=s-dVbGkLICpsce6jgu7b5kzYFz9opWjSQFDBgbIhKio,4002
96
96
  oarepo_runtime/services/custom_fields/__init__.py,sha256=_gqMcA_I3rdEZcBtCuDjO4wdVCqFML5NzaccuPx5a3o,2565
97
97
  oarepo_runtime/services/custom_fields/mappings.py,sha256=3CIvjWzVRO3fZ2r-3taK1rwuLH9wj5Lguo-GvsbLBf4,7515
@@ -148,9 +148,9 @@ tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
148
148
  tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
149
149
  tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
150
150
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
151
- oarepo_runtime-1.5.123.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
152
- oarepo_runtime-1.5.123.dist-info/METADATA,sha256=Ok2PX70f0gD-GXzoQfwRbvppr-Vz6Ibpy6KJ5QrwU1w,4721
153
- oarepo_runtime-1.5.123.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
154
- oarepo_runtime-1.5.123.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
155
- oarepo_runtime-1.5.123.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
156
- oarepo_runtime-1.5.123.dist-info/RECORD,,
151
+ oarepo_runtime-1.5.125.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
152
+ oarepo_runtime-1.5.125.dist-info/METADATA,sha256=LQFLVbz1YZOvnokTHZgnnQNcUK6RfeTDLeG7hyAJFC4,4721
153
+ oarepo_runtime-1.5.125.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
154
+ oarepo_runtime-1.5.125.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
155
+ oarepo_runtime-1.5.125.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
156
+ oarepo_runtime-1.5.125.dist-info/RECORD,,