ecodev-core 0.0.32__py3-none-any.whl → 0.0.34__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.

Potentially problematic release.


This version of ecodev-core might be problematic. Click here for more details.

ecodev_core/backup.py CHANGED
@@ -80,8 +80,10 @@ def _get_old_backups(file_to_backup: Path, nb_saves: int) -> List[str]:
80
80
  """
81
81
  Retrieve old versions of file_to_backup in order to erase them (more than nb_saves ago)
82
82
  """
83
- output = run(['lftp', '-c', f'open {BACKUP_URL}; ls {file_to_backup.name.split(".")[0]}*'],
83
+ output = run(['lftp', '-c', f'open {BACKUP_URL}; ls'],
84
84
  capture_output=True, text=True)
85
- all_backups = sorted([x.split(' ')[-1] for x in output.stdout.splitlines()])
85
+ filename_base = file_to_backup.name.split('.')[0]
86
+ all_backups = sorted([x.split(' ')[-1]
87
+ for x in output.stdout.splitlines() if filename_base in x])
86
88
  log.info(f'existing remote backups {all_backups}')
87
89
  return all_backups[:-nb_saves]
@@ -0,0 +1,16 @@
1
+ """
2
+ module implementing SQLModel related helper methods. Related to validation
3
+ """
4
+ from sqlmodel import SQLModel
5
+
6
+
7
+ class SQLModelWithVal(SQLModel):
8
+ """
9
+ Helper class to ease validation in SQLModel classes with table=True
10
+ """
11
+ @classmethod
12
+ def create(cls, **kwargs):
13
+ """
14
+ Forces validation to take place, even for SQLModel classes with table=True
15
+ """
16
+ return cls(**cls.__bases__[0](**kwargs).model_dump())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ecodev-core
3
- Version: 0.0.32
3
+ Version: 0.0.34
4
4
  Summary: Low level sqlmodel/fastapi/pydantic building blocks
5
5
  License: MIT
6
6
  Author: Thomas Epelbaum
@@ -4,7 +4,7 @@ ecodev_core/app_rights.py,sha256=RZPdDtydFqc_nFj96huKAc56BS0qS6ScKv4Kghqd6lc,726
4
4
  ecodev_core/app_user.py,sha256=r1bqA4H08x53XmxmjwyGKl_PFjYQazzBbVErdkztqeE,2947
5
5
  ecodev_core/auth_configuration.py,sha256=R8XH674J1HQSxMr-abvrG0zRqANRf07eMLiG4yB04gM,447
6
6
  ecodev_core/authentication.py,sha256=aLMk2_fn1Fodrby2ywZraB3JTSsSrPsBiQq0ag0ySiY,10023
7
- ecodev_core/backup.py,sha256=8fwBHic6hE8swNESIayZqqWZFHFz5f-puBWSt5f_ZLw,3119
7
+ ecodev_core/backup.py,sha256=GA_a3T8QkB97IzOMD3C57Aw7VE51hP7KdVEZ-PuT9DM,3183
8
8
  ecodev_core/check_dependencies.py,sha256=aFn8GI4eBbuJT8RxsfhSSnlpNYYj_LPOH-tZF0EqfKQ,6917
9
9
  ecodev_core/custom_equal.py,sha256=2gRn0qpyJ8-Kw9GQSueu0nLngLrRrwyMPlP6zqPac0U,899
10
10
  ecodev_core/db_connection.py,sha256=bc5MujZ57f204wTsuNVdn1JdP-zBzkDJxHmdxBDTiNs,2286
@@ -20,7 +20,8 @@ ecodev_core/permissions.py,sha256=WAx-ilMu8LlQp2sjJVdkhNQieytEaEm8577ZF1HWeTY,50
20
20
  ecodev_core/pydantic_utils.py,sha256=e3GH50JmcpTmd2UgrB94QSwWOlOCW3WIlVdyX9C4T-U,741
21
21
  ecodev_core/read_write.py,sha256=auJ5bBJTVGkLRkiP_vZxVCX64B0Y-9qpsaDhovHmbas,996
22
22
  ecodev_core/safe_utils.py,sha256=JCfxo6fcznjsL-XHNJ1TKo1UvfJB83WT5jpTFmtJwsE,6160
23
- ecodev_core-0.0.32.dist-info/LICENSE.md,sha256=jebQDe1ib9LAODuNvcSoo2CoqS6P0_q8--mMTICh_kI,1074
24
- ecodev_core-0.0.32.dist-info/METADATA,sha256=Uy4lhKuQ_euDjiVQEmpBNAItotolBTm8iFrYLqeJGfk,3385
25
- ecodev_core-0.0.32.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
- ecodev_core-0.0.32.dist-info/RECORD,,
23
+ ecodev_core/sqlmodel_utils.py,sha256=t57H3QPtKRy4ujic1clMK_2L4p0yjGJLZbDjHPZ8M94,453
24
+ ecodev_core-0.0.34.dist-info/LICENSE.md,sha256=jebQDe1ib9LAODuNvcSoo2CoqS6P0_q8--mMTICh_kI,1074
25
+ ecodev_core-0.0.34.dist-info/METADATA,sha256=2wRebyF6ttEEeXjJtRrcu6sYsMbUWcBObY8wahQ0Ncw,3385
26
+ ecodev_core-0.0.34.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
27
+ ecodev_core-0.0.34.dist-info/RECORD,,