pgbelt 0.7.3__tar.gz → 0.7.5__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 (26) hide show
  1. {pgbelt-0.7.3 → pgbelt-0.7.5}/PKG-INFO +2 -2
  2. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/login.py +6 -1
  3. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/teardown.py +3 -3
  4. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/config/models.py +13 -3
  5. {pgbelt-0.7.3 → pgbelt-0.7.5}/pyproject.toml +17 -17
  6. {pgbelt-0.7.3 → pgbelt-0.7.5}/LICENSE +0 -0
  7. {pgbelt-0.7.3 → pgbelt-0.7.5}/README.md +0 -0
  8. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/__init__.py +0 -0
  9. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/__init__.py +0 -0
  10. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/convenience.py +0 -0
  11. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/helpers.py +0 -0
  12. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/preflight.py +0 -0
  13. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/schema.py +0 -0
  14. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/setup.py +0 -0
  15. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/status.py +0 -0
  16. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/cmd/sync.py +0 -0
  17. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/config/__init__.py +0 -0
  18. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/config/config.py +0 -0
  19. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/config/remote.py +0 -0
  20. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/main.py +0 -0
  21. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/util/__init__.py +0 -0
  22. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/util/asyncfuncs.py +0 -0
  23. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/util/dump.py +0 -0
  24. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/util/logs.py +0 -0
  25. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/util/pglogical.py +0 -0
  26. {pgbelt-0.7.3 → pgbelt-0.7.5}/pgbelt/util/postgres.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pgbelt
3
- Version: 0.7.3
3
+ Version: 0.7.5
4
4
  Summary: A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication.
5
5
  Author: Varjitt Jeeva
6
6
  Author-email: varjitt.jeeva@autodesk.com
@@ -10,7 +10,7 @@ Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: aiofiles (>=0.8,<23.3)
13
+ Requires-Dist: aiofiles (>=0.8,<24.2)
14
14
  Requires-Dist: asyncpg (>=0.27,<0.30)
15
15
  Requires-Dist: pydantic (>=2.0,<3.0)
16
16
  Requires-Dist: tabulate (>=0.9.0,<0.10.0)
@@ -55,7 +55,12 @@ async def revoke_logins(config_future: Awaitable[DbupgradeConfig]) -> None:
55
55
  await _populate_logins(conf.src, pool, logger)
56
56
  save_task = asyncio.create_task(conf.save())
57
57
 
58
- to_disable = [conf.src.owner_user.name]
58
+ to_disable = []
59
+ # Sometimes the owner user is the same as the root user.
60
+ # When that happens, we don't want to disable the owner user.
61
+ # If the owner user is different, we want to disable the owner user.
62
+ if conf.src.owner_user.name != conf.src.root_user.name:
63
+ to_disable.append(conf.src.owner_user.name)
59
64
 
60
65
  if conf.src.other_users is not None:
61
66
  to_disable += [
@@ -42,13 +42,13 @@ async def teardown_forward_replication(config_future: Awaitable[DbupgradeConfig]
42
42
  @run_with_configs
43
43
  async def teardown(
44
44
  config_future: Awaitable[DbupgradeConfig],
45
- full: bool = Option(False, help="Remove pglogical user and extension"),
45
+ full: bool = Option(False, help="Remove pglogical extension"),
46
46
  ):
47
47
  """
48
48
  Removes all pglogical configuration from both databases. If any replication is
49
- configured this will stop it.
49
+ configured this will stop it. It will also drop the pglogical user.
50
50
 
51
- If run with --full the pglogical users and extension will be dropped.
51
+ If run with --full the pglogical extension will be dropped.
52
52
 
53
53
  WARNING: running with --full may cause the database to lock up. You should be
54
54
  prepared to reboot the database if you do this.
@@ -10,6 +10,7 @@ from pgbelt.util.asyncfuncs import makedirs
10
10
  from pydantic import BaseModel
11
11
  from pydantic import ValidationError
12
12
  from pydantic import field_validator
13
+ from urllib.parse import quote
13
14
 
14
15
 
15
16
  def config_dir(db: str, dc: str) -> str:
@@ -86,15 +87,24 @@ class DbConfig(BaseModel):
86
87
 
87
88
  @property
88
89
  def root_uri(self) -> str:
89
- return f"postgresql://{self.root_user.name}:{self.root_user.pw}@{self.ip}:{self.port}/{self.db}"
90
+ password = quote(
91
+ self.root_user.pw
92
+ ) # https://github.com/encode/databases/issues/145#issuecomment-1303792343 need this to handle special characters
93
+ return f"postgresql://{self.root_user.name}:{password}@{self.ip}:{self.port}/{self.db}"
90
94
 
91
95
  @property
92
96
  def owner_uri(self) -> str:
93
- return f"postgresql://{self.owner_user.name}:{self.owner_user.pw}@{self.ip}:{self.port}/{self.db}"
97
+ password = quote(
98
+ self.owner_user.pw
99
+ ) # https://github.com/encode/databases/issues/145#issuecomment-1303792343 need this to handle special characters
100
+ return f"postgresql://{self.owner_user.name}:{password}@{self.ip}:{self.port}/{self.db}"
94
101
 
95
102
  @property
96
103
  def pglogical_uri(self) -> str:
97
- return f"postgresql://{self.pglogical_user.name}:{self.pglogical_user.pw}@{self.ip}:{self.port}/{self.db}"
104
+ password = quote(
105
+ self.pglogical_user.pw
106
+ ) # https://github.com/encode/databases/issues/145#issuecomment-1303792343 need this to handle special characters
107
+ return f"postgresql://{self.pglogical_user.name}:{password}@{self.ip}:{self.port}/{self.db}"
98
108
 
99
109
 
100
110
  class DbupgradeConfig(BaseModel):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pgbelt"
3
- version = "0.7.3"
3
+ version = "0.7.5"
4
4
  description = "A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication."
5
5
  authors = ["Varjitt Jeeva <varjitt.jeeva@autodesk.com>"]
6
6
  readme = "README.md"
@@ -11,34 +11,34 @@ packages = [
11
11
 
12
12
  [tool.poetry.dependencies]
13
13
  python = ">=3.9,<4.0"
14
- aiofiles = ">=0.8,<23.3"
14
+ aiofiles = ">=0.8,<24.2"
15
15
  asyncpg = ">=0.27,<0.30"
16
16
  pydantic = ">=2.0,<3.0"
17
17
  tabulate = "^0.9.0"
18
18
  typer = ">=0.9,<0.13"
19
19
 
20
20
  [tool.poetry.dev-dependencies]
21
- black = "~24.3.0"
22
- pre-commit = "~3.7.0"
23
- flake8 = "^7.0.0"
21
+ black = "~24.4.2"
22
+ pre-commit = "~3.7.1"
23
+ flake8 = "^7.1.0"
24
24
  pytest-cov = "~5.0.0"
25
- pytest = "^8.1.1"
26
- coverage = {extras = ["toml"], version = "^7.4"}
27
- safety = "^3.1.0"
28
- mypy = "^1.9"
29
- xdoctest = {extras = ["colors"], version = "^1.1.3"}
25
+ pytest = "^8.2.2"
26
+ coverage = {extras = ["toml"], version = "^7.5"}
27
+ safety = "^3.2.4"
28
+ mypy = "^1.10"
29
+ xdoctest = {extras = ["colors"], version = "^1.1.5"}
30
30
  flake8-bandit = "~4.1.1"
31
31
  flake8-bugbear = ">=21.9.2"
32
32
  flake8-docstrings = "^1.6.0"
33
33
  flake8-rst-docstrings = "^0.3.0"
34
- pep8-naming = "^0.13.2"
34
+ pep8-naming = "^0.14.1"
35
35
  darglint = "^1.8.1"
36
- reorder-python-imports = "^3.9.0"
37
- pre-commit-hooks = "^4.5.0"
38
- Pygments = "^2.17.2"
39
- pyupgrade = "^3.15.2"
40
- pylint = "^3.1.0"
41
- pytest-asyncio = "~0.23.6"
36
+ reorder-python-imports = "^3.13.0"
37
+ pre-commit-hooks = "^4.6.0"
38
+ Pygments = "^2.18.0"
39
+ pyupgrade = "^3.16.0"
40
+ pylint = "^3.2.5"
41
+ pytest-asyncio = "~0.23.7"
42
42
 
43
43
  [build-system]
44
44
  requires = ["poetry-core>=1.0.0", "setuptools"]
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