pum 1.2.1__tar.gz → 1.2.2__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.
Files changed (35) hide show
  1. {pum-1.2.1 → pum-1.2.2}/PKG-INFO +1 -1
  2. {pum-1.2.1 → pum-1.2.2}/pum/pum_config.py +1 -1
  3. {pum-1.2.1 → pum-1.2.2}/pum/upgrader.py +7 -0
  4. {pum-1.2.1 → pum-1.2.2}/pum.egg-info/PKG-INFO +1 -1
  5. {pum-1.2.1 → pum-1.2.2}/LICENSE +0 -0
  6. {pum-1.2.1 → pum-1.2.2}/README.md +0 -0
  7. {pum-1.2.1 → pum-1.2.2}/pum/__init__.py +0 -0
  8. {pum-1.2.1 → pum-1.2.2}/pum/changelog.py +0 -0
  9. {pum-1.2.1 → pum-1.2.2}/pum/checker.py +0 -0
  10. {pum-1.2.1 → pum-1.2.2}/pum/cli.py +0 -0
  11. {pum-1.2.1 → pum-1.2.2}/pum/config_model.py +0 -0
  12. {pum-1.2.1 → pum-1.2.2}/pum/dependency_handler.py +0 -0
  13. {pum-1.2.1 → pum-1.2.2}/pum/dumper.py +0 -0
  14. {pum-1.2.1 → pum-1.2.2}/pum/exceptions.py +0 -0
  15. {pum-1.2.1 → pum-1.2.2}/pum/hook.py +0 -0
  16. {pum-1.2.1 → pum-1.2.2}/pum/info.py +0 -0
  17. {pum-1.2.1 → pum-1.2.2}/pum/parameter.py +0 -0
  18. {pum-1.2.1 → pum-1.2.2}/pum/role_manager.py +0 -0
  19. {pum-1.2.1 → pum-1.2.2}/pum/schema_migrations.py +0 -0
  20. {pum-1.2.1 → pum-1.2.2}/pum/sql_content.py +0 -0
  21. {pum-1.2.1 → pum-1.2.2}/pum.egg-info/SOURCES.txt +0 -0
  22. {pum-1.2.1 → pum-1.2.2}/pum.egg-info/dependency_links.txt +0 -0
  23. {pum-1.2.1 → pum-1.2.2}/pum.egg-info/entry_points.txt +0 -0
  24. {pum-1.2.1 → pum-1.2.2}/pum.egg-info/requires.txt +0 -0
  25. {pum-1.2.1 → pum-1.2.2}/pum.egg-info/top_level.txt +0 -0
  26. {pum-1.2.1 → pum-1.2.2}/pyproject.toml +0 -0
  27. {pum-1.2.1 → pum-1.2.2}/requirements/base.txt +0 -0
  28. {pum-1.2.1 → pum-1.2.2}/requirements/development.txt +0 -0
  29. {pum-1.2.1 → pum-1.2.2}/setup.cfg +0 -0
  30. {pum-1.2.1 → pum-1.2.2}/test/test_changelog.py +0 -0
  31. {pum-1.2.1 → pum-1.2.2}/test/test_config.py +0 -0
  32. {pum-1.2.1 → pum-1.2.2}/test/test_dumper.py +0 -0
  33. {pum-1.2.1 → pum-1.2.2}/test/test_roles.py +0 -0
  34. {pum-1.2.1 → pum-1.2.2}/test/test_schema_migrations.py +0 -0
  35. {pum-1.2.1 → pum-1.2.2}/test/test_upgrader.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pum
3
- Version: 1.2.1
3
+ Version: 1.2.2
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
@@ -231,7 +231,7 @@ class PumConfig:
231
231
  """Return a RoleManager instance based on the roles defined in the configuration."""
232
232
  if not self.config.roles:
233
233
  logger.warning("No roles defined in the configuration. Returning an empty RoleManager.")
234
- return RoleManager()
234
+ return RoleManager([])
235
235
  return RoleManager([role.model_dump() for role in self.config.roles])
236
236
 
237
237
  def pre_hook_handlers(self) -> list[HookHandler]:
@@ -133,6 +133,7 @@ class Upgrader:
133
133
  name: str,
134
134
  *,
135
135
  parameters: dict | None = None,
136
+ grant: bool = True,
136
137
  ) -> None:
137
138
  """Install demo data for the module.
138
139
 
@@ -140,6 +141,7 @@ class Upgrader:
140
141
  connection: The database connection to use.
141
142
  name: The name of the demo data to install.
142
143
  parameters: The parameters to pass to the demo data SQL.
144
+ grant: If True, grant permissions to the roles after installing the demo data. Default is True.
143
145
  """
144
146
  if name not in self.config.demo_data():
145
147
  raise PumException(f"Demo data '{name}' not found in the configuration.")
@@ -167,4 +169,9 @@ class Upgrader:
167
169
 
168
170
  connection.commit()
169
171
 
172
+ if grant:
173
+ self.config.role_manager().grant_permissions(connection=connection, commit=False)
174
+
175
+ connection.commit()
176
+
170
177
  logger.info("Demo data '%s' installed successfully.", name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pum
3
- Version: 1.2.1
3
+ Version: 1.2.2
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes