pum 1.1.8__py3-none-any.whl → 1.1.10__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.
pum/dependency_handler.py CHANGED
@@ -59,10 +59,9 @@ class DependencyHandler:
59
59
  f"Dependency `{self.name}` is not installed. You can activate the installation."
60
60
  ) from e
61
61
  else:
62
- logger.warning(f"Dependency {self.name} is not installed: {e}")
62
+ logger.warning(f"Dependency {self.name} is not installed, trying to install {e}")
63
63
  self.pip_install(install_path=install_path)
64
-
65
- logger.info(f"Dependency {self.name} is now installed in {install_path}")
64
+ logger.warning(f"Dependency {self.name} is now installed in {install_path}")
66
65
 
67
66
  def pip_install(self, install_path: str):
68
67
  """
pum/info.py CHANGED
@@ -3,9 +3,11 @@ import sys
3
3
  import psycopg
4
4
 
5
5
  from .pum_config import PumConfig
6
- from .schema_migrations import SchemaMigrations
6
+ from .schema_migrations import SchemaMigrations, MIGRATION_TABLE_NAME
7
7
 
8
8
  logger = logging.getLogger(__name__)
9
+ # set to info here
10
+ logger.setLevel(logging.INFO)
9
11
 
10
12
 
11
13
  def run_info(connection: psycopg.Connection, config: PumConfig) -> None:
@@ -17,14 +19,20 @@ def run_info(connection: psycopg.Connection, config: PumConfig) -> None:
17
19
 
18
20
  """
19
21
  try:
20
- schema_migrations = SchemaMigrations(connection, config)
21
- if not schema_migrations.exists():
22
+ schema_migrations = SchemaMigrations(config=config)
23
+ if not schema_migrations.exists(connection=connection):
22
24
  logger.info(
23
- f"No migrations found in {config.pum.migration_table_schema}.{config.pum.migration_table_name}."
25
+ f"No migrations found in {config.config.pum.migration_table_schema}.{MIGRATION_TABLE_NAME}."
24
26
  )
25
27
  else:
26
28
  # Add your logic for when migrations exist; for now, we simply print a message.
27
29
  logger.info("Migrations found.")
30
+ logger.info(
31
+ f"Schema migrations table: {config.config.pum.migration_table_schema}.{MIGRATION_TABLE_NAME}"
32
+ )
33
+ logger.info(
34
+ f"Version: {schema_migrations.migration_details(connection=connection)['version']}"
35
+ )
28
36
  except Exception:
29
37
  logger.exception("An error occurred while checking for migrations.")
30
38
  sys.exit(1)
pum/schema_migrations.py CHANGED
@@ -110,7 +110,7 @@ class SchemaMigrations:
110
110
 
111
111
  if not allow_multiple_schemas and len(self.exists_in_other_schemas(connection)) > 0:
112
112
  raise PumException(
113
- f"Another {self.config.config.pum.migration_table_schema}.{self.config.config.pum.migration_table_name} table exists in another schema (). "
113
+ f"Another {self.config.config.pum.migration_table_schema}.{MIGRATION_TABLE_NAME} table exists in another schema (). "
114
114
  "Please use the allow_multiple_schemas option to create a new one."
115
115
  )
116
116
 
pum/upgrader.py CHANGED
@@ -119,6 +119,15 @@ class Upgrader:
119
119
  parameters=parameters,
120
120
  )
121
121
 
122
+ if demo_data:
123
+ demo_data_file = self.config.base_path / self.config.demo_data()[demo_data]
124
+ logger.info("Installing demo data from %s", demo_data_file)
125
+ SqlContent(sql=demo_data_file).execute(
126
+ connection=connection,
127
+ commit=False,
128
+ parameters=parameters_literals,
129
+ )
130
+
122
131
  for post_hook in self.config.post_hook_handlers():
123
132
  post_hook.execute(connection=connection, commit=False, parameters=parameters)
124
133
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pum
3
- Version: 1.1.8
3
+ Version: 1.1.10
4
4
  Summary: Pum stands for "Postgres Upgrades Manager". It is a Database migration management tool very similar to flyway-db or Liquibase, based on metadata tables.
5
5
  Author-email: Denis Rouzaud <denis@opengis.ch>
6
6
  License-Expression: GPL-2.0-or-later
@@ -3,21 +3,21 @@ pum/changelog.py,sha256=yDc5swmMd5gb2vCEAlenoq5gs-ZEGc4uXicBtiGxkOk,3692
3
3
  pum/checker.py,sha256=GT2v7793HP1g94dv0mL6CHtQfblQwAyeFHEWCy44lkc,14379
4
4
  pum/cli.py,sha256=mQtspJUYp6TwKfU6x0L5ke9q_pMxrf9Du8xd2bOtREA,14317
5
5
  pum/config_model.py,sha256=piSQBYp29gnzqmtN50_OUw5o9d7Q5dEzj4q6G7cIFik,6396
6
- pum/dependency_handler.py,sha256=34wvDGWlI-vsMFm1z0XcSDN2cnL_VFAh61GWmeYEzk4,3841
6
+ pum/dependency_handler.py,sha256=AVeemsh6zUumRJKbRLRwP_FRC0x3K16TJiK2i9ogvn0,3861
7
7
  pum/dumper.py,sha256=EJZ8T44JM0GKgdqw1ENOfhZ-RI89OQ4DNdoTZKtLdEw,3404
8
8
  pum/exceptions.py,sha256=xyzzY4ht1nKfrVt59Giulflpmu83nJhxoTygrqiqPlw,1137
9
9
  pum/hook.py,sha256=5MrVa6Xr0o28RfsXylGDatlM_vOKfKtGJmhYx8crC94,9541
10
- pum/info.py,sha256=VSCUZJJ_ae-khKaudwbgqszZXBMKB_yskuQo5Mc1PgY,1024
10
+ pum/info.py,sha256=CGj-Lt4Y2l2ymAl3OFqCWfJD5xZF4aaUSztAiSKwgE4,1395
11
11
  pum/parameter.py,sha256=qdbWk3WZc419AW-qwGMxlgc-7GEhdwIoPBnDk6UsVZU,2485
12
12
  pum/pum_config.py,sha256=xTEdYh-628pnkoqH56NoPIuhIQauc1d6hksM8hcCCU4,11232
13
13
  pum/role_manager.py,sha256=yr-fmytflGqANY3IZIpgJBoMOK98ynTWfemIBhAy79A,10131
14
- pum/schema_migrations.py,sha256=FiaqAbhFX7vd3Rk_R43kd7-QWfil-Q5587EU8xSLBkA,10504
14
+ pum/schema_migrations.py,sha256=MCA40pCptwWeoZQuZb3zyvbLDU7I1YdRbr1Hgpe9hYg,10481
15
15
  pum/sql_content.py,sha256=KoAa3CNVH_Hh6Z3FxpCYJCsG1NEiCRpfzlfP8wPFZHE,10414
16
- pum/upgrader.py,sha256=C0WRNm3A9wqossb-j2kaJBAnJpv7IDXNcc1MKlFg6z0,6684
16
+ pum/upgrader.py,sha256=eWjvdj8OpYLOf-ExLEkOoEqf1UjGWzNRXw0ztkoysGU,7050
17
17
  pum/conf/pum_config_example.yaml,sha256=_nwV_7z6S_Se-mejh_My0JFLY-A0Q4nigeLGPZAfcqg,424
18
- pum-1.1.8.dist-info/licenses/LICENSE,sha256=2ylvL381vKOhdO-w6zkrOxe9lLNBhRQpo9_0EbHC_HM,18046
19
- pum-1.1.8.dist-info/METADATA,sha256=DjE39lMpsDEsgxn_PBgBhebNT9Ro-v5EfEWnJTvtDys,3138
20
- pum-1.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- pum-1.1.8.dist-info/entry_points.txt,sha256=U6dmxSpKs1Pe9vWiR29VPhJMDjrmZeJCSxvfLGR8BD4,36
22
- pum-1.1.8.dist-info/top_level.txt,sha256=ddiI4HLBhY6ql-NNm0Ez0JhoOHdWDIzrHeCdHmmagcc,4
23
- pum-1.1.8.dist-info/RECORD,,
18
+ pum-1.1.10.dist-info/licenses/LICENSE,sha256=2ylvL381vKOhdO-w6zkrOxe9lLNBhRQpo9_0EbHC_HM,18046
19
+ pum-1.1.10.dist-info/METADATA,sha256=YYJBkXCWiiV3zhPlSHb0pTeBlnbJ8mY6f66TYULtUIk,3139
20
+ pum-1.1.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ pum-1.1.10.dist-info/entry_points.txt,sha256=U6dmxSpKs1Pe9vWiR29VPhJMDjrmZeJCSxvfLGR8BD4,36
22
+ pum-1.1.10.dist-info/top_level.txt,sha256=ddiI4HLBhY6ql-NNm0Ez0JhoOHdWDIzrHeCdHmmagcc,4
23
+ pum-1.1.10.dist-info/RECORD,,
File without changes