pgbelt 0.1.1__tar.gz → 0.2.0__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 (27) hide show
  1. {pgbelt-0.1.1 → pgbelt-0.2.0}/PKG-INFO +8 -9
  2. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/convenience.py +3 -5
  3. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/helpers.py +8 -10
  4. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/login.py +1 -2
  5. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/preflight.py +3 -3
  6. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/schema.py +1 -1
  7. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/setup.py +2 -3
  8. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/status.py +4 -5
  9. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/sync.py +3 -4
  10. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/teardown.py +2 -3
  11. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/config/config.py +5 -6
  12. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/config/models.py +10 -11
  13. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/config/remote.py +5 -6
  14. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/main.py +1 -2
  15. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/util/dump.py +6 -12
  16. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/util/postgres.py +2 -3
  17. {pgbelt-0.1.1 → pgbelt-0.2.0}/pyproject.toml +21 -21
  18. pgbelt-0.1.1/setup.py +0 -42
  19. {pgbelt-0.1.1 → pgbelt-0.2.0}/LICENSE +0 -0
  20. {pgbelt-0.1.1 → pgbelt-0.2.0}/README.md +0 -0
  21. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/__init__.py +0 -0
  22. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/cmd/__init__.py +0 -0
  23. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/config/__init__.py +0 -0
  24. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/util/__init__.py +0 -0
  25. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/util/asyncfuncs.py +0 -0
  26. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/util/logs.py +0 -0
  27. {pgbelt-0.1.1 → pgbelt-0.2.0}/pgbelt/util/pglogical.py +0 -0
@@ -1,18 +1,17 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pgbelt
3
- Version: 0.1.1
3
+ Version: 0.2.0
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
7
- Requires-Python: >=3.9,<4.0
7
+ Requires-Python: >=3.11,<4.0
8
8
  Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.9
10
- Classifier: Programming Language :: Python :: 3.10
11
- Requires-Dist: aiofiles (>=0.8.0,<0.9.0)
12
- Requires-Dist: asyncpg (>=0.26.0,<0.27.0)
13
- Requires-Dist: pydantic (>=1.10.1,<1.11.0)
14
- Requires-Dist: tabulate (>=0.8.9,<0.9.0)
15
- Requires-Dist: typer (>=0.6.1,<0.7.0)
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Requires-Dist: aiofiles (>=0.8,<23.2)
11
+ Requires-Dist: asyncpg (>=0.27.0,<0.28.0)
12
+ Requires-Dist: pydantic (>=1.10.0,<2.0.0)
13
+ Requires-Dist: tabulate (>=0.9.0,<0.10.0)
14
+ Requires-Dist: typer (>=0.7.0,<0.8.0)
16
15
  Description-Content-Type: text/markdown
17
16
 
18
17
  # Pgbelt
@@ -1,15 +1,13 @@
1
1
  from asyncio import run
2
2
  from logging import Logger
3
- from typing import Tuple
4
3
 
5
4
  from asyncpg import create_pool
6
- from typer import echo
7
- from typer import Option
8
-
9
5
  from pgbelt.config.config import get_config
10
6
  from pgbelt.config.models import DbupgradeConfig
11
7
  from pgbelt.util.logs import get_logger
12
8
  from pgbelt.util.postgres import analyze_table_pkeys
9
+ from typer import echo
10
+ from typer import Option
13
11
 
14
12
 
15
13
  def src_dsn(
@@ -58,7 +56,7 @@ def dst_dsn(
58
56
 
59
57
  async def _check_pkeys(
60
58
  conf: DbupgradeConfig, logger: Logger
61
- ) -> Tuple[list[str], list[str]]:
59
+ ) -> tuple[list[str], list[str]]:
62
60
  async with create_pool(conf.src.root_uri, min_size=1) as pool:
63
61
  pkey_tables, no_pkey_tables, _ = await analyze_table_pkeys(pool, logger)
64
62
  return pkey_tables, no_pkey_tables
@@ -1,30 +1,28 @@
1
1
  from asyncio import gather
2
2
  from asyncio import run
3
+ from collections.abc import Awaitable
4
+ from collections.abc import Callable
3
5
  from functools import wraps
4
6
  from inspect import iscoroutinefunction
5
7
  from inspect import Parameter
6
8
  from inspect import signature
7
9
  from typing import Any
8
- from typing import Awaitable
9
- from typing import Callable
10
- from typing import Optional
11
10
  from typing import TypeVar
12
11
 
13
- from typer import Argument
14
- from typer import Typer
15
-
16
12
  from pgbelt.config import get_all_configs_async
17
13
  from pgbelt.config import get_config_async
14
+ from typer import Argument
15
+ from typer import Typer
18
16
 
19
17
 
20
18
  T = TypeVar("T")
21
19
 
22
20
 
23
21
  def run_with_configs(
24
- decorated_func: Callable[..., Awaitable[Optional[T]]] = None,
22
+ decorated_func: Callable[..., Awaitable[T | None]] = None,
25
23
  skip_src: bool = False,
26
24
  skip_dst: bool = False,
27
- results_callback: Optional[Callable[[list[T]], Awaitable[Optional[Any]]]] = None,
25
+ results_callback: Callable[[list[T]], Awaitable[Any | None]] | None = None,
28
26
  ) -> Callable:
29
27
  """
30
28
  Decorator for async commands. Implementations should take one Awaitable[DbupgradeConfig] arg
@@ -52,7 +50,7 @@ def run_with_configs(
52
50
 
53
51
  # The name, docstring, and signature of the implementation is preserved. Important for add_command
54
52
  @wraps(func)
55
- async def wrapper(dc: str, db: Optional[str], **kwargs):
53
+ async def wrapper(dc: str, db: str | None, **kwargs):
56
54
  # If db is specified we only want to run on one of them
57
55
  if db is not None:
58
56
  results = [
@@ -102,7 +100,7 @@ def add_command(app: Typer, command: Callable):
102
100
  if iscoroutinefunction(command):
103
101
 
104
102
  @app.command(name=name)
105
- def cmdwrapper(dc: str, db: Optional[str] = Argument(None), **kwargs):
103
+ def cmdwrapper(dc: str, db: str | None = Argument(None), **kwargs):
106
104
  run(command(dc, db, **kwargs))
107
105
 
108
106
  # Synchronous commands can only be run on one db at a time
@@ -1,10 +1,9 @@
1
1
  import asyncio
2
+ from collections.abc import Awaitable
2
3
  from logging import Logger
3
- from typing import Awaitable
4
4
 
5
5
  from asyncpg import create_pool
6
6
  from asyncpg import Pool
7
-
8
7
  from pgbelt.cmd.helpers import run_with_configs
9
8
  from pgbelt.config.models import DbConfig
10
9
  from pgbelt.config.models import DbupgradeConfig
@@ -1,12 +1,12 @@
1
1
  from asyncio import gather
2
+ from collections.abc import Awaitable
3
+
4
+ from asyncpg import create_pool
2
5
  from pgbelt.cmd.helpers import run_with_configs
3
6
  from pgbelt.config.models import DbupgradeConfig
4
7
  from pgbelt.util.logs import get_logger
5
8
  from pgbelt.util.postgres import analyze_table_pkeys
6
9
  from pgbelt.util.postgres import precheck_info
7
- from typing import Awaitable
8
-
9
- from asyncpg import create_pool
10
10
  from tabulate import tabulate
11
11
  from typer import echo
12
12
  from typer import style
@@ -1,4 +1,4 @@
1
- from typing import Awaitable
1
+ from collections.abc import Awaitable
2
2
 
3
3
  from pgbelt.cmd.helpers import run_with_configs
4
4
  from pgbelt.config.models import DbupgradeConfig
@@ -1,12 +1,10 @@
1
1
  from asyncio import create_task
2
2
  from asyncio import gather
3
+ from collections.abc import Awaitable
3
4
  from logging import Logger
4
- from typing import Awaitable
5
5
 
6
6
  from asyncpg import create_pool
7
7
  from asyncpg import Pool
8
- from typer import Option
9
-
10
8
  from pgbelt.cmd.helpers import run_with_configs
11
9
  from pgbelt.config.models import DbupgradeConfig
12
10
  from pgbelt.util.dump import apply_target_schema
@@ -18,6 +16,7 @@ from pgbelt.util.pglogical import configure_replication_set
18
16
  from pgbelt.util.pglogical import configure_subscription
19
17
  from pgbelt.util.pglogical import grant_pgl
20
18
  from pgbelt.util.postgres import analyze_table_pkeys
19
+ from typer import Option
21
20
 
22
21
 
23
22
  async def _dump_and_load_schema(
@@ -1,16 +1,15 @@
1
1
  from asyncio import gather
2
- from typing import Awaitable
2
+ from collections.abc import Awaitable
3
3
 
4
4
  from asyncpg import create_pool
5
- from tabulate import tabulate
6
- from typer import echo
7
- from typer import style
8
-
9
5
  from pgbelt.cmd.helpers import run_with_configs
10
6
  from pgbelt.config.models import DbupgradeConfig
11
7
  from pgbelt.util import get_logger
12
8
  from pgbelt.util.pglogical import dst_status
13
9
  from pgbelt.util.pglogical import src_status
10
+ from tabulate import tabulate
11
+ from typer import echo
12
+ from typer import style
14
13
 
15
14
 
16
15
  async def _print_status_table(results: list[dict[str, str]]) -> list[list[str]]:
@@ -1,11 +1,9 @@
1
1
  from asyncio import gather
2
+ from collections.abc import Awaitable
2
3
  from logging import Logger
3
- from typing import Awaitable
4
4
 
5
5
  from asyncpg import create_pool
6
6
  from asyncpg import Pool
7
- from typer import Option
8
-
9
7
  from pgbelt.cmd.helpers import run_with_configs
10
8
  from pgbelt.config.models import DbupgradeConfig
11
9
  from pgbelt.util.dump import apply_target_constraints
@@ -18,6 +16,7 @@ from pgbelt.util.postgres import compare_latest_100_rows
18
16
  from pgbelt.util.postgres import dump_sequences
19
17
  from pgbelt.util.postgres import load_sequences
20
18
  from pgbelt.util.postgres import run_analyze
19
+ from typer import Option
21
20
 
22
21
 
23
22
  async def _sync_sequences(
@@ -146,7 +145,7 @@ async def analyze(config_future: Awaitable[DbupgradeConfig]) -> None:
146
145
  """
147
146
  conf = await config_future
148
147
  logger = get_logger(conf.db, conf.dc, "sync.dst")
149
- async with create_pool(conf.dst.owner_uri, min_size=1) as dst_pool:
148
+ async with create_pool(conf.dst.root_uri, min_size=1) as dst_pool:
150
149
  await run_analyze(dst_pool, logger)
151
150
 
152
151
 
@@ -1,10 +1,8 @@
1
1
  from asyncio import gather
2
2
  from asyncio import sleep
3
- from typing import Awaitable
3
+ from collections.abc import Awaitable
4
4
 
5
5
  from asyncpg import create_pool
6
- from typer import Option
7
-
8
6
  from pgbelt.cmd.helpers import run_with_configs
9
7
  from pgbelt.config.models import DbupgradeConfig
10
8
  from pgbelt.util.logs import get_logger
@@ -13,6 +11,7 @@ from pgbelt.util.pglogical import teardown_node
13
11
  from pgbelt.util.pglogical import teardown_pgl
14
12
  from pgbelt.util.pglogical import teardown_replication_set
15
13
  from pgbelt.util.pglogical import teardown_subscription
14
+ from typer import Option
16
15
 
17
16
 
18
17
  @run_with_configs(skip_dst=True)
@@ -1,8 +1,7 @@
1
1
  import asyncio
2
+ from collections.abc import AsyncGenerator
3
+ from collections.abc import Awaitable
2
4
  from os.path import join
3
- from typing import AsyncGenerator
4
- from typing import Awaitable
5
- from typing import Optional
6
5
 
7
6
  from pgbelt.config.models import DbupgradeConfig
8
7
  from pgbelt.config.remote import resolve_remote_config
@@ -14,7 +13,7 @@ from pgbelt.util.asyncfuncs import listdir
14
13
 
15
14
  def get_config(
16
15
  db: str, dc: str, skip_src: bool = False, skip_dst: bool = False
17
- ) -> Optional[DbupgradeConfig]:
16
+ ) -> DbupgradeConfig | None:
18
17
  """
19
18
  Get a configuration for one database pair synchronously.
20
19
  """
@@ -28,7 +27,7 @@ def get_config(
28
27
 
29
28
  async def get_config_async(
30
29
  db: str, dc: str, skip_src: bool = False, skip_dst: bool = False
31
- ) -> Optional[DbupgradeConfig]:
30
+ ) -> DbupgradeConfig | None:
32
31
  """
33
32
  Get configuration for one database pair asynchronously. Always prefers
34
33
  locally cached configuration but attempts to resolve any uncached configuration
@@ -84,7 +83,7 @@ async def find_available_configs(confdir: str, dc: str) -> set[str]:
84
83
 
85
84
  async def get_all_configs_async(
86
85
  dc: str, skip_src: bool = False, skip_dst: bool = False
87
- ) -> AsyncGenerator[Awaitable[Optional[DbupgradeConfig]], None]:
86
+ ) -> AsyncGenerator[Awaitable[DbupgradeConfig | None], None]:
88
87
  """
89
88
  A generator that produces Awaitables that resolve to DbupgradeConfigs or None
90
89
 
@@ -1,12 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from os.path import join
4
- from pgbelt.util import get_logger
5
- from pgbelt.util.asyncfuncs import makedirs
6
- from typing import Optional
7
4
 
8
5
  from aiofiles import open as aopen
9
6
  from aiofiles.os import remove
7
+ from pgbelt.util import get_logger
8
+ from pgbelt.util.asyncfuncs import makedirs
10
9
  from pydantic import BaseModel
11
10
  from pydantic import ValidationError
12
11
  from pydantic import validator
@@ -20,7 +19,7 @@ def config_file(db: str, dc: str) -> str:
20
19
  return join(config_dir(db, dc), "config.json")
21
20
 
22
21
 
23
- def not_empty(v) -> Optional[str]:
22
+ def not_empty(v) -> str | None:
24
23
  if v == "":
25
24
  raise ValueError
26
25
  return v
@@ -35,7 +34,7 @@ class User(BaseModel):
35
34
  """
36
35
 
37
36
  name: str
38
- pw: Optional[str] = None
37
+ pw: str | None = None
39
38
 
40
39
  _not_empty = validator("name", "pw", allow_reuse=True)(not_empty)
41
40
 
@@ -62,7 +61,7 @@ class DbConfig(BaseModel):
62
61
  root_user: User
63
62
  owner_user: User
64
63
  pglogical_user: User
65
- other_users: Optional[list[User]] = None
64
+ other_users: list[User] | None = None
66
65
 
67
66
  _not_empty = validator("host", "ip", "db", "port", allow_reuse=True)(not_empty)
68
67
 
@@ -109,10 +108,10 @@ class DbupgradeConfig(BaseModel):
109
108
 
110
109
  db: str
111
110
  dc: str
112
- src: Optional[DbConfig] = None
113
- dst: Optional[DbConfig] = None
114
- tables: Optional[list[str]] = None
115
- sequences: Optional[list[str]] = None
111
+ src: DbConfig | None = None
112
+ dst: DbConfig | None = None
113
+ tables: list[str] | None = None
114
+ sequences: list[str] | None = None
116
115
 
117
116
  _not_empty = validator("db", "dc", allow_reuse=True)(not_empty)
118
117
 
@@ -147,7 +146,7 @@ class DbupgradeConfig(BaseModel):
147
146
  logger.info("Cached config to disk.")
148
147
 
149
148
  @classmethod
150
- async def load(cls, db: str, dc: str) -> Optional[DbupgradeConfig]:
149
+ async def load(cls, db: str, dc: str) -> DbupgradeConfig | None:
151
150
  """
152
151
  Load the specified configuration from disk if present.
153
152
  If the existing config is invalid or does not exist return None.
@@ -1,11 +1,10 @@
1
1
  from importlib import import_module
2
2
  from json import JSONDecodeError
3
3
  from logging import Logger
4
- from pgbelt.config.models import DbupgradeConfig
5
- from pgbelt.util.logs import get_logger
6
- from typing import Optional
7
4
 
8
5
  from aiofiles import open as aopen
6
+ from pgbelt.config.models import DbupgradeConfig
7
+ from pgbelt.util.logs import get_logger
9
8
  from pydantic import BaseModel
10
9
  from pydantic import ValidationError
11
10
 
@@ -60,7 +59,7 @@ class BaseResolver(BaseModel):
60
59
  arbitrary_types_allowed = True
61
60
  extra = "ignore"
62
61
 
63
- async def resolve(self) -> Optional[DbupgradeConfig]:
62
+ async def resolve(self) -> DbupgradeConfig | None:
64
63
  """
65
64
  Called to retrieve the configuration from wherever your resolver gets it.
66
65
  Return configuration as a DbupgradeConfig.
@@ -73,7 +72,7 @@ class BaseResolver(BaseModel):
73
72
 
74
73
  async def load_remote_conf_def(
75
74
  config_file: str, logger: Logger
76
- ) -> Optional[RemoteConfigDefinition]:
75
+ ) -> RemoteConfigDefinition | None:
77
76
  try:
78
77
  logger.debug(f"Reading remote config definition from file {config_file}")
79
78
  async with aopen(config_file, mode="r") as f:
@@ -90,7 +89,7 @@ async def load_remote_conf_def(
90
89
 
91
90
  async def resolve_remote_config(
92
91
  db: str, dc: str, skip_src: bool = False, skip_dst: bool = False
93
- ) -> Optional[DbupgradeConfig]:
92
+ ) -> DbupgradeConfig | None:
94
93
  """
95
94
  Loads the referenced remote configuration json file, tries to import the
96
95
  specified resolver class, executes its resolve method, and returns the
@@ -1,6 +1,5 @@
1
- from typer import Typer
2
-
3
1
  from pgbelt.cmd import add_commands
2
+ from typer import Typer
4
3
 
5
4
  app = Typer(help="A tool to help manage postgres data migrations.")
6
5
  add_commands(app)
@@ -1,16 +1,15 @@
1
1
  import asyncio
2
2
  from logging import Logger
3
3
  from os.path import join
4
- from re import search
5
-
6
- from aiofiles import open as aopen
7
- from asyncpg import create_pool
8
-
9
4
  from pgbelt.config.models import DbupgradeConfig
10
5
  from pgbelt.util.asyncfuncs import isfile
11
6
  from pgbelt.util.asyncfuncs import listdir
12
7
  from pgbelt.util.asyncfuncs import makedirs
13
8
  from pgbelt.util.postgres import table_empty
9
+ from re import search
10
+
11
+ from aiofiles import open as aopen
12
+ from asyncpg import create_pool
14
13
 
15
14
  RAW = "schema"
16
15
  NO_INVALID = "no_invalid_constraints"
@@ -33,7 +32,7 @@ def table_file(db: str, dc: str, name: str) -> str:
33
32
  return join(table_dir(db, dc), f"{name}.sql")
34
33
 
35
34
 
36
- def _parse_dump_commands(out: str, src_owner: str, dst_owner: str) -> list[str]:
35
+ def _parse_dump_commands(out: str) -> list[str]:
37
36
  """
38
37
  Given a string containing output from pg_dump, return a list of strings where
39
38
  each is a complete postgres command. Commands may be multi-line.
@@ -47,9 +46,6 @@ def _parse_dump_commands(out: str, src_owner: str, dst_owner: str) -> list[str]:
47
46
  if not stripped or stripped.startswith("--"):
48
47
  continue
49
48
 
50
- # replace source owner user with target owner user
51
- line = line.replace(src_owner, dst_owner)
52
-
53
49
  # if the last command is terminated or we don't have any yet start a new one
54
50
  if not commands or commands[-1].endswith(";\n"):
55
51
  commands.append(line + "\n")
@@ -172,9 +168,7 @@ async def dump_source_schema(config: DbupgradeConfig, logger: Logger) -> None:
172
168
 
173
169
  out = await _execute_subprocess(command, "Retrieved source schema", logger)
174
170
 
175
- commands_raw = _parse_dump_commands(
176
- out.decode("utf-8"), config.src.owner_user.name, config.dst.owner_user.name
177
- )
171
+ commands_raw = _parse_dump_commands(out.decode("utf-8"))
178
172
 
179
173
  commands = []
180
174
  for c in commands_raw:
@@ -1,5 +1,4 @@
1
1
  from logging import Logger
2
- from typing import Tuple
3
2
 
4
3
  from asyncpg import Pool
5
4
  from asyncpg import Record
@@ -194,7 +193,7 @@ async def compare_latest_100_rows(
194
193
  SELECT *
195
194
  FROM {table}
196
195
  ORDER BY {order_by_pkeys} DESC
197
- LIMIT 1;
196
+ LIMIT 100;
198
197
  """
199
198
 
200
199
  await compare_data(src_pool, dst_pool, query, tables, logger)
@@ -211,7 +210,7 @@ async def table_empty(pool: Pool, table: str, logger: Logger) -> bool:
211
210
 
212
211
  async def analyze_table_pkeys(
213
212
  pool: Pool, logger: Logger
214
- ) -> Tuple[list[str], list[str], Record]:
213
+ ) -> tuple[list[str], list[str], Record]:
215
214
  """
216
215
  return three lists of table names. the first element is all tables
217
216
  with pkeys in public and the second is all tables without pkeys in public.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pgbelt"
3
- version = "0.1.1"
3
+ version = "0.2.0"
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"
@@ -10,35 +10,35 @@ packages = [
10
10
  ]
11
11
 
12
12
  [tool.poetry.dependencies]
13
- python = "^3.9"
14
- aiofiles = "~0.8.0"
15
- asyncpg = "~0.26.0"
16
- pydantic = "~1.10.1"
17
- tabulate = "~0.8.9"
18
- typer = "~0.6.1"
13
+ python = "^3.11"
14
+ aiofiles = ">=0.8,<23.2"
15
+ asyncpg = "^0.27.0"
16
+ pydantic = "^1.10.0"
17
+ tabulate = "^0.9.0"
18
+ typer = "^0.7.0"
19
19
 
20
20
  [tool.poetry.dev-dependencies]
21
- black = "~22.6.0"
22
- pre-commit = "~2.20.0"
23
- flake8 = "~5.0.4"
24
- pytest-cov = "~3.0.0"
25
- pytest = "^7.1.2"
26
- coverage = {extras = ["toml"], version = "^6.4"}
27
- safety = "^2.1.1"
28
- mypy = "^0.971"
29
- xdoctest = {extras = ["colors"], version = "^1.0.2"}
21
+ black = "~23.3.0"
22
+ pre-commit = "~3.2.1"
23
+ flake8 = "^6.0.0"
24
+ pytest-cov = "~4.0.0"
25
+ pytest = "^7.1.3"
26
+ coverage = {extras = ["toml"], version = "^6.5"}
27
+ safety = "^2.3.1"
28
+ mypy = "^1.1"
29
+ xdoctest = {extras = ["colors"], version = "^1.1.0"}
30
30
  flake8-bandit = "~4.1.1"
31
31
  flake8-bugbear = ">=21.9.2"
32
32
  flake8-docstrings = "^1.6.0"
33
- flake8-rst-docstrings = "^0.2.7"
33
+ flake8-rst-docstrings = "^0.3.0"
34
34
  pep8-naming = "^0.13.2"
35
35
  darglint = "^1.8.1"
36
- reorder-python-imports = "^3.8.2"
36
+ reorder-python-imports = "^3.9.0"
37
37
  pre-commit-hooks = "^4.2.0"
38
38
  Pygments = "^2.13.0"
39
- pyupgrade = "^2.37.3"
40
- pylint = "^2.15.0"
41
- pytest-asyncio = "~0.19.0"
39
+ pyupgrade = "^3.3.1"
40
+ pylint = "^2.17.2"
41
+ pytest-asyncio = "~0.21.0"
42
42
 
43
43
  [build-system]
44
44
  requires = ["poetry-core>=1.0.0"]
pgbelt-0.1.1/setup.py DELETED
@@ -1,42 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- from setuptools import setup
3
-
4
- package_dir = \
5
- {'': '.'}
6
-
7
- packages = \
8
- ['pgbelt', 'pgbelt.cmd', 'pgbelt.config', 'pgbelt.util']
9
-
10
- package_data = \
11
- {'': ['*']}
12
-
13
- install_requires = \
14
- ['aiofiles>=0.8.0,<0.9.0',
15
- 'asyncpg>=0.26.0,<0.27.0',
16
- 'pydantic>=1.10.1,<1.11.0',
17
- 'tabulate>=0.8.9,<0.9.0',
18
- 'typer>=0.6.1,<0.7.0']
19
-
20
- entry_points = \
21
- {'console_scripts': ['belt = pgbelt.main:app']}
22
-
23
- setup_kwargs = {
24
- 'name': 'pgbelt',
25
- 'version': '0.1.1',
26
- 'description': 'A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication.',
27
- 'long_description': '# Pgbelt\n\n<p align="center">\n <img src="https://github.com/Autodesk/pgbelt/blob/main/pgbelt.png?raw=true" width="400">\n</p>\n\n<p align="center">\n <a href="https://github.com/autodesk/pgbelt" target="_blank">\n <img src="https://img.shields.io/github/last-commit/autodesk/pgbelt" alt="Latest Commit">\n </a>\n <img src="https://github.com/Autodesk/pgbelt/actions/workflows/ci.yml/badge.svg">\n <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">\n <img src="https://img.shields.io/github/license/Autodesk/pgbelt">\n </a>\n</p>\n\nPgBelt is a CLI tool used to manage Postgres data migrations from beginning to end,\nfor a single database or a fleet, leveraging pglogical replication.\n\nIt was built to assist in migrating data between postgres databases with as\nlittle application downtime as possible. It works in databases running different versions\nof postgres and makes it easy to run many migrations in parallel during a single downtime.\n\n| :exclamation: This is very important |\n| :---------------------------------------------------------------------------------------------------------------------------------------------- |\n| As with all Data Migration tasks, **there is a risk of data loss**. Please ensure you have backed up your data before attempting any migrations |\n\n## Installation\n\n### Install From PyPi\n\nIt is recommended to install pgbelt inside a virtual environment:\n\n- [pyenv](https://github.com/pyenv/pyenv)\n- [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)\n\nYou must also have:\n\n- Postgres Client Tools (pg_dump, pg_restore). Mac: `brew install libpq`. Ubuntu: `sudo apt-get install postgresql-client`\n\nInstall pgbelt locally:\n\n pip3 install pgbelt\n\n## Quickstart with Pgbelt\n\nSee [this doc](docs/quickstart.md)!\n\n## Contributing\n\nWe welcome contributions! See [this doc](CONTRIBUTING.md) on how to do so, including setting up your local development environment.\n',
28
- 'author': 'Varjitt Jeeva',
29
- 'author_email': 'varjitt.jeeva@autodesk.com',
30
- 'maintainer': 'None',
31
- 'maintainer_email': 'None',
32
- 'url': 'None',
33
- 'package_dir': package_dir,
34
- 'packages': packages,
35
- 'package_data': package_data,
36
- 'install_requires': install_requires,
37
- 'entry_points': entry_points,
38
- 'python_requires': '>=3.9,<4.0',
39
- }
40
-
41
-
42
- setup(**setup_kwargs)
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