pum 1.1.2__py3-none-any.whl → 1.1.3__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/pum_config.py CHANGED
@@ -18,7 +18,6 @@ from .config_model import ConfigModel
18
18
  from .hook import HookHandler
19
19
  import tempfile
20
20
  import sys
21
- import atexit
22
21
 
23
22
 
24
23
  try:
@@ -250,6 +249,15 @@ class PumConfig:
250
249
  """Return a dictionary of demo data files defined in the configuration."""
251
250
  return {dm.name: dm.file for dm in self.config.demo_data}
252
251
 
252
+ def __del__(self):
253
+ # Cleanup temporary directories and sys.path modifications
254
+ if self.dependency_path:
255
+ # Remove from sys.path if present
256
+ sys.path = [p for p in sys.path if p != str(self.dependency_path)]
257
+ # Remove the directory if it exists and is a TemporaryDirectory
258
+ if hasattr(self, "_temp_dir") and self._temp_dir:
259
+ self.dependency_tmp.cleanup()
260
+
253
261
  def validate(self, install_dependencies: bool = False) -> None:
254
262
  """Validate the changelogs and hooks.
255
263
 
@@ -258,16 +266,10 @@ class PumConfig:
258
266
  """
259
267
 
260
268
  if install_dependencies and self.config.dependencies:
261
- temp_dir = tempfile.TemporaryDirectory()
262
- self.dependency_path = Path(temp_dir.name)
269
+ self.dependency_tmp = tempfile.TemporaryDirectory()
270
+ self.dependency_path = Path(self.dependency_tmp.name)
263
271
  sys.path.insert(0, str(self.dependency_path))
264
272
 
265
- def cleanup():
266
- sys.path = [p for p in sys.path if p != str(self.dependency_path)]
267
- temp_dir.cleanup()
268
-
269
- atexit.register(cleanup)
270
-
271
273
  parameter_defaults = {}
272
274
  for parameter in self.config.parameters:
273
275
  parameter_defaults[parameter.name] = psycopg.sql.Literal(parameter.default)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pum
3
- Version: 1.1.2
3
+ Version: 1.1.3
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
@@ -9,15 +9,15 @@ pum/exceptions.py,sha256=xyzzY4ht1nKfrVt59Giulflpmu83nJhxoTygrqiqPlw,1137
9
9
  pum/hook.py,sha256=L4Cnr34zrgPzxso9CdsUYWmtuOXRmFccQZ9Lp4IYCBM,9326
10
10
  pum/info.py,sha256=VSCUZJJ_ae-khKaudwbgqszZXBMKB_yskuQo5Mc1PgY,1024
11
11
  pum/parameter.py,sha256=e9f80kMZpART9laeImW_YECeTvwDyDSmZlTeJGvpS_8,2449
12
- pum/pum_config.py,sha256=7rGPaLreOOLl3kuBK_FzYxW02PiWHT4ayenWzOiJWJA,10566
12
+ pum/pum_config.py,sha256=CpvYWstLTlb7S1VW4O2vIKF2WKP7EYSLwMq7mmA1DGs,10823
13
13
  pum/role_manager.py,sha256=yr-fmytflGqANY3IZIpgJBoMOK98ynTWfemIBhAy79A,10131
14
14
  pum/schema_migrations.py,sha256=FiaqAbhFX7vd3Rk_R43kd7-QWfil-Q5587EU8xSLBkA,10504
15
15
  pum/sql_content.py,sha256=gwgvcdXOXxNz3RvLtL8Bqr5WO3KKq3sluhbj4OAEnQs,9756
16
16
  pum/upgrader.py,sha256=jvl6vmpgxGyYiw8rrWC_bDC7Zd4wHJqGLXCK8EMt9wY,7109
17
17
  pum/conf/pum_config_example.yaml,sha256=_nwV_7z6S_Se-mejh_My0JFLY-A0Q4nigeLGPZAfcqg,424
18
- pum-1.1.2.dist-info/licenses/LICENSE,sha256=2ylvL381vKOhdO-w6zkrOxe9lLNBhRQpo9_0EbHC_HM,18046
19
- pum-1.1.2.dist-info/METADATA,sha256=TcW5O8n3DvCKSUPPiIyCk3zu-7cZJrIJuHyZ4RGtHzg,3138
20
- pum-1.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- pum-1.1.2.dist-info/entry_points.txt,sha256=U6dmxSpKs1Pe9vWiR29VPhJMDjrmZeJCSxvfLGR8BD4,36
22
- pum-1.1.2.dist-info/top_level.txt,sha256=ddiI4HLBhY6ql-NNm0Ez0JhoOHdWDIzrHeCdHmmagcc,4
23
- pum-1.1.2.dist-info/RECORD,,
18
+ pum-1.1.3.dist-info/licenses/LICENSE,sha256=2ylvL381vKOhdO-w6zkrOxe9lLNBhRQpo9_0EbHC_HM,18046
19
+ pum-1.1.3.dist-info/METADATA,sha256=by7AyhgM96XfhiZo3bKomPlDD19sewYqORvTIdn26w8,3138
20
+ pum-1.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ pum-1.1.3.dist-info/entry_points.txt,sha256=U6dmxSpKs1Pe9vWiR29VPhJMDjrmZeJCSxvfLGR8BD4,36
22
+ pum-1.1.3.dist-info/top_level.txt,sha256=ddiI4HLBhY6ql-NNm0Ez0JhoOHdWDIzrHeCdHmmagcc,4
23
+ pum-1.1.3.dist-info/RECORD,,
File without changes