dsw-database 4.20.1__tar.gz → 4.21.0__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: dsw-database
3
- Version: 4.20.1
3
+ Version: 4.21.0
4
4
  Summary: Library for managing DSW database
5
5
  Author-email: Marek Suchánek <marek.suchanek@ds-wizard.org>
6
6
  License: Apache License 2.0
@@ -11,16 +11,16 @@ Keywords: dsw,database
11
11
  Classifier: Development Status :: 5 - Production/Stable
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3.11
15
14
  Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Topic :: Database
17
17
  Classifier: Topic :: Utilities
18
- Requires-Python: <4,>=3.11
18
+ Requires-Python: <4,>=3.12
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: psycopg[binary]
22
22
  Requires-Dist: tenacity
23
- Requires-Dist: dsw-config==4.20.1
23
+ Requires-Dist: dsw-config==4.21.0
24
24
  Dynamic: license-file
25
25
 
26
26
  # Data Stewardship Wizard: Database
@@ -9,9 +9,9 @@ BuildInfo = namedtuple(
9
9
  )
10
10
 
11
11
  BUILD_INFO = BuildInfo(
12
- version='v4.20.1~0e2ea82',
13
- built_at='2025-07-23 08:04:38Z',
14
- sha='0e2ea82aa69b9aae205f7715cf9606bbf75f9f20',
12
+ version='v4.21.0~12713f1',
13
+ built_at='2025-08-05 09:21:07Z',
14
+ sha='12713f1988c2a33d5c40dd2cb899cdac7be35668',
15
15
  branch='HEAD',
16
- tag='v4.20.1',
16
+ tag='v4.21.0',
17
17
  )
@@ -13,7 +13,7 @@ from dsw.config.model import DatabaseConfig
13
13
 
14
14
  from .model import DBDocumentTemplate, DBDocumentTemplateFile, \
15
15
  DBDocumentTemplateAsset, DBDocument, DBComponent, \
16
- DocumentState, DBTenantConfig, DBTenantLimits, DBSubmission, \
16
+ DocumentState, DBTenantLimits, DBSubmission, \
17
17
  DBInstanceConfigMail, DBQuestionnaireSimple, \
18
18
  DBUserEntity, DBLocale
19
19
 
@@ -44,8 +44,6 @@ class Database:
44
44
  'WHERE d.questionnaire_uuid = %s AND d.tenant_uuid = %s;')
45
45
  SELECT_QTN_SIMPLE = ('SELECT qtn.* FROM questionnaire qtn '
46
46
  'WHERE qtn.uuid = %s AND qtn.tenant_uuid = %s;')
47
- SELECT_TENANT_CONFIG = ('SELECT * FROM tenant_config '
48
- 'WHERE uuid = %(tenant_uuid)s LIMIT 1;')
49
47
  SELECT_TENANT_LIMIT = ('SELECT uuid, storage FROM tenant_limit_bundle '
50
48
  'WHERE uuid = %(tenant_uuid)s LIMIT 1;')
51
49
  UPDATE_DOCUMENT_STATE = 'UPDATE document SET state = %s, worker_log = %s WHERE uuid = %s;'
@@ -152,16 +150,6 @@ class Database:
152
150
  return None
153
151
  return DBDocument.from_dict_row(result[0])
154
152
 
155
- @tenacity.retry(
156
- reraise=True,
157
- wait=tenacity.wait_exponential(multiplier=RETRY_QUERY_MULTIPLIER),
158
- stop=tenacity.stop_after_attempt(RETRY_QUERY_TRIES),
159
- before=tenacity.before_log(LOG, logging.DEBUG),
160
- after=tenacity.after_log(LOG, logging.DEBUG),
161
- )
162
- def fetch_tenant_config(self, tenant_uuid: str) -> DBTenantConfig | None:
163
- return self.get_tenant_config(tenant_uuid)
164
-
165
153
  @tenacity.retry(
166
154
  reraise=True,
167
155
  wait=tenacity.wait_exponential(multiplier=RETRY_QUERY_MULTIPLIER),
@@ -375,29 +363,6 @@ class Database:
375
363
  row = cursor.fetchone()
376
364
  return row[0]
377
365
 
378
- @tenacity.retry(
379
- reraise=True,
380
- wait=tenacity.wait_exponential(multiplier=RETRY_QUERY_MULTIPLIER),
381
- stop=tenacity.stop_after_attempt(RETRY_QUERY_TRIES),
382
- before=tenacity.before_log(LOG, logging.DEBUG),
383
- after=tenacity.after_log(LOG, logging.DEBUG),
384
- )
385
- def get_tenant_config(self, tenant_uuid: str) -> DBTenantConfig | None:
386
- if not self._check_table_exists(table_name='tenant_config'):
387
- return None
388
- with self.conn_query.new_cursor(use_dict=True) as cursor:
389
- try:
390
- cursor.execute(
391
- query=self.SELECT_TENANT_CONFIG,
392
- params={'tenant_uuid': tenant_uuid},
393
- )
394
- result = cursor.fetchone()
395
- return DBTenantConfig.from_dict_row(data=result)
396
- except Exception as e:
397
- LOG.warning('Could not retrieve tenant_config for tenant "%s": %s',
398
- tenant_uuid, str(e))
399
- return None
400
-
401
366
  @tenacity.retry(
402
367
  reraise=True,
403
368
  wait=tenacity.wait_exponential(multiplier=RETRY_QUERY_MULTIPLIER),
@@ -216,55 +216,6 @@ class PersistentCommand:
216
216
  )
217
217
 
218
218
 
219
- @dataclasses.dataclass
220
- class DBTenantConfig:
221
- uuid: str
222
- organization: dict | None
223
- authentication: dict | None
224
- privacy_and_support: dict | None
225
- dashboard: dict | None
226
- look_and_feel: dict | None
227
- registry: dict | None
228
- knowledge_model: dict | None
229
- questionnaire: dict | None
230
- submission: dict | None
231
- owl: dict | None
232
- mail_config_uuid: str | None
233
- created_at: datetime.datetime
234
- updated_at: datetime.datetime
235
-
236
- @property
237
- def app_title(self) -> str | None:
238
- if self.look_and_feel is None:
239
- return None
240
- return self.look_and_feel.get('appTitle', None)
241
-
242
- @property
243
- def support_email(self) -> str | None:
244
- if self.privacy_and_support is None:
245
- return None
246
- return self.privacy_and_support.get('supportEmail', None)
247
-
248
- @staticmethod
249
- def from_dict_row(data: dict):
250
- return DBTenantConfig(
251
- uuid=str(data['uuid']),
252
- organization=data.get('organization', None),
253
- authentication=data.get('authentication', None),
254
- privacy_and_support=data.get('privacy_and_support', None),
255
- dashboard=data.get('dashboard_and_login_screen', None),
256
- look_and_feel=data.get('look_and_feel', None),
257
- registry=data.get('registry', None),
258
- knowledge_model=data.get('knowledge_model', None),
259
- questionnaire=data.get('questionnaire', None),
260
- submission=data.get('submission', None),
261
- owl=data.get('owl', None),
262
- mail_config_uuid=data.get('mail_config_uuid', None),
263
- created_at=data['created_at'],
264
- updated_at=data['updated_at'],
265
- )
266
-
267
-
268
219
  @dataclasses.dataclass
269
220
  class DBTenantLimits:
270
221
  tenant_uuid: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dsw-database
3
- Version: 4.20.1
3
+ Version: 4.21.0
4
4
  Summary: Library for managing DSW database
5
5
  Author-email: Marek Suchánek <marek.suchanek@ds-wizard.org>
6
6
  License: Apache License 2.0
@@ -11,16 +11,16 @@ Keywords: dsw,database
11
11
  Classifier: Development Status :: 5 - Production/Stable
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3.11
15
14
  Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Topic :: Database
17
17
  Classifier: Topic :: Utilities
18
- Requires-Python: <4,>=3.11
18
+ Requires-Python: <4,>=3.12
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: psycopg[binary]
22
22
  Requires-Dist: tenacity
23
- Requires-Dist: dsw-config==4.20.1
23
+ Requires-Dist: dsw-config==4.21.0
24
24
  Dynamic: license-file
25
25
 
26
26
  # Data Stewardship Wizard: Database
@@ -1,3 +1,3 @@
1
1
  psycopg[binary]
2
2
  tenacity
3
- dsw-config==4.20.1
3
+ dsw-config==4.21.0
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
4
4
 
5
5
  [project]
6
6
  name = 'dsw-database'
7
- version = "4.20.1"
7
+ version = "4.21.0"
8
8
  description = 'Library for managing DSW database'
9
9
  readme = 'README.md'
10
10
  keywords = ['dsw', 'database']
@@ -16,17 +16,17 @@ classifiers = [
16
16
  'Development Status :: 5 - Production/Stable',
17
17
  'License :: OSI Approved :: Apache Software License',
18
18
  'Programming Language :: Python',
19
- 'Programming Language :: Python :: 3.11',
20
19
  'Programming Language :: Python :: 3.12',
20
+ 'Programming Language :: Python :: 3.13',
21
21
  'Topic :: Database',
22
22
  'Topic :: Utilities',
23
23
  ]
24
- requires-python = '>=3.11, <4'
24
+ requires-python = '>=3.12, <4'
25
25
  dependencies = [
26
26
  'psycopg[binary]',
27
27
  'tenacity',
28
28
  # DSW
29
- "dsw-config==4.20.1",
29
+ "dsw-config==4.21.0",
30
30
  ]
31
31
 
32
32
  [project.urls]
File without changes
File without changes
File without changes
File without changes