pum 1.1.11__py3-none-any.whl → 1.1.13__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/cli.py CHANGED
@@ -351,7 +351,6 @@ def cli() -> int: # noqa: PLR0912
351
351
  max_version=args.max_version,
352
352
  roles=args.roles,
353
353
  grant=args.grant,
354
- demo_data=args.demo_data,
355
354
  beta_testing=args.beta_testing,
356
355
  )
357
356
  conn.commit()
pum/config_model.py CHANGED
@@ -36,10 +36,11 @@ class ParameterDefinitionModel(PumCustomBaseModel):
36
36
  class HookModel(PumCustomBaseModel):
37
37
  """
38
38
  HookModel represents a migration hook configuration.
39
+ It can either execute a file (SQL or Python script) or run inline SQL code.
39
40
 
40
41
  Attributes:
41
- file: Optional path to a SQL file to execute as a hook.
42
- code: Optional Python code to execute as a hook.
42
+ file: Optional path to a SQL file or a Python script to execute as a hook.
43
+ code: Optional SQL code to execute as a hook.
43
44
  """
44
45
 
45
46
  file: Optional[str] = None
pum/pum_config.py CHANGED
@@ -262,7 +262,7 @@ class PumConfig:
262
262
 
263
263
  def __del__(self):
264
264
  # Cleanup temporary directories and sys.path modifications
265
- if self.dependency_path:
265
+ if self.dependency_path and sys.path:
266
266
  # Remove from sys.path if present
267
267
  sys.path = [p for p in sys.path if p != str(self.dependency_path)]
268
268
  # Remove the directory if it exists and is a TemporaryDirectory
pum/sql_content.py CHANGED
@@ -161,6 +161,10 @@ class SqlContent:
161
161
  sql: The SQL statement to execute or a path to a SQL file.
162
162
 
163
163
  """
164
+ if not isinstance(sql, (str, psycopg.sql.SQL, Path)):
165
+ raise PumSqlError(
166
+ f"SQL must be a string, psycopg.sql.SQL object or a Path object, not {type(sql)}."
167
+ )
164
168
  self.sql = sql
165
169
 
166
170
  def validate(self, parameters: dict | None) -> bool:
pum/upgrader.py CHANGED
@@ -70,8 +70,6 @@ class Upgrader:
70
70
  If True, roles will be created.
71
71
  grant:
72
72
  If True, permissions will be granted to the roles.
73
- demo_data:
74
- The name of the demo data to load. If None, no demo data is loaded.
75
73
  beta_testing:
76
74
  If True, the module is installed in beta testing mode.
77
75
  This means that the module will not be able to receive any future updates.
@@ -137,6 +135,7 @@ class Upgrader:
137
135
  parameters: dict | None = None,
138
136
  ) -> None:
139
137
  """Install demo data for the module.
138
+
140
139
  Args:
141
140
  connection: The database connection to use.
142
141
  name: The name of the demo data to install.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pum
3
- Version: 1.1.11
3
+ Version: 1.1.13
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
@@ -1,23 +1,23 @@
1
1
  pum/__init__.py,sha256=P-NHd6_SYpk9aypefLI62QCZ3f5APOMCwSzrFFCKAew,759
2
2
  pum/changelog.py,sha256=yDc5swmMd5gb2vCEAlenoq5gs-ZEGc4uXicBtiGxkOk,3692
3
3
  pum/checker.py,sha256=GT2v7793HP1g94dv0mL6CHtQfblQwAyeFHEWCy44lkc,14379
4
- pum/cli.py,sha256=mQtspJUYp6TwKfU6x0L5ke9q_pMxrf9Du8xd2bOtREA,14317
5
- pum/config_model.py,sha256=piSQBYp29gnzqmtN50_OUw5o9d7Q5dEzj4q6G7cIFik,6396
4
+ pum/cli.py,sha256=p5dMF4PyaM9iKpjd5QQATJLEZRiwhGDjB0oFElibwjE,14275
5
+ pum/config_model.py,sha256=l8PmaP_UJ5gbZH-p8EcE8W4J1wMhS0wPPr01a8wKlsA,6492
6
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
10
  pum/info.py,sha256=CGj-Lt4Y2l2ymAl3OFqCWfJD5xZF4aaUSztAiSKwgE4,1395
11
11
  pum/parameter.py,sha256=qdbWk3WZc419AW-qwGMxlgc-7GEhdwIoPBnDk6UsVZU,2485
12
- pum/pum_config.py,sha256=xTEdYh-628pnkoqH56NoPIuhIQauc1d6hksM8hcCCU4,11232
12
+ pum/pum_config.py,sha256=bnL3rxgd7YNLD9u8Yyl7lNPxt7YtRXC0cpDP-l1Rw9w,11245
13
13
  pum/role_manager.py,sha256=yr-fmytflGqANY3IZIpgJBoMOK98ynTWfemIBhAy79A,10131
14
14
  pum/schema_migrations.py,sha256=MCA40pCptwWeoZQuZb3zyvbLDU7I1YdRbr1Hgpe9hYg,10481
15
- pum/sql_content.py,sha256=KoAa3CNVH_Hh6Z3FxpCYJCsG1NEiCRpfzlfP8wPFZHE,10414
16
- pum/upgrader.py,sha256=vA_JMaiVDJVvNcXx9iu6RTX0V_ljyzoK2vlYJZ22maA,6410
15
+ pum/sql_content.py,sha256=-0h3caJlvkyEjZwjPVrKh5ZYaDctC-5lklBvZ-zgRzA,10620
16
+ pum/upgrader.py,sha256=mUbXXT9bwuCmhg7jZUFSV_BrAuHDjd9pSCBXjcwysgQ,6304
17
17
  pum/conf/pum_config_example.yaml,sha256=_nwV_7z6S_Se-mejh_My0JFLY-A0Q4nigeLGPZAfcqg,424
18
- pum-1.1.11.dist-info/licenses/LICENSE,sha256=2ylvL381vKOhdO-w6zkrOxe9lLNBhRQpo9_0EbHC_HM,18046
19
- pum-1.1.11.dist-info/METADATA,sha256=WolZB8eJ3_lZSnpQdvL8O6l-SAIYvOz_B-mjeHPyAFw,3139
20
- pum-1.1.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- pum-1.1.11.dist-info/entry_points.txt,sha256=U6dmxSpKs1Pe9vWiR29VPhJMDjrmZeJCSxvfLGR8BD4,36
22
- pum-1.1.11.dist-info/top_level.txt,sha256=ddiI4HLBhY6ql-NNm0Ez0JhoOHdWDIzrHeCdHmmagcc,4
23
- pum-1.1.11.dist-info/RECORD,,
18
+ pum-1.1.13.dist-info/licenses/LICENSE,sha256=2ylvL381vKOhdO-w6zkrOxe9lLNBhRQpo9_0EbHC_HM,18046
19
+ pum-1.1.13.dist-info/METADATA,sha256=xPvHhm6_H8usHV2_HTv4mKrFDrJQeFyk2gHRn-Ndh00,3139
20
+ pum-1.1.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ pum-1.1.13.dist-info/entry_points.txt,sha256=U6dmxSpKs1Pe9vWiR29VPhJMDjrmZeJCSxvfLGR8BD4,36
22
+ pum-1.1.13.dist-info/top_level.txt,sha256=ddiI4HLBhY6ql-NNm0Ez0JhoOHdWDIzrHeCdHmmagcc,4
23
+ pum-1.1.13.dist-info/RECORD,,
File without changes