Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
be36713
[prepare] rename: testgres -> src
dmitry-lipetsk Aug 16, 2025
a36f485
Using an testgres.os_ops
dmitry-lipetsk Aug 16, 2025
594fdb5
setup.py is corrected [install_requires: testgres.os_ops]
dmitry-lipetsk Aug 16, 2025
4170212
cleanup
dmitry-lipetsk Sep 10, 2025
0d5d30f
cleanup (__init__.py, pg_probackup2)
dmitry-lipetsk Sep 10, 2025
54082f8
[rollback] src/__init__.py is restored
dmitry-lipetsk Sep 14, 2025
dd1c2a2
flake8
dmitry-lipetsk Sep 15, 2025
674026d
tests/requirements.txt is added
dmitry-lipetsk Sep 15, 2025
1a70df7
Usage of testgres.os_ops from postgrespro is begun
dmitry-lipetsk Sep 15, 2025
36acc38
GITHUB_TESTGRES_TOKEN_RO is used
dmitry-lipetsk Sep 22, 2025
5937003
setup.py is updated [secret]
dmitry-lipetsk Sep 22, 2025
cce238a
cleanup
dmitry-lipetsk Sep 23, 2025
801ae9a
Merge branch 'master' into D20250816_001--external_os_ops_v001
dmitry-lipetsk Sep 23, 2025
e58698a
testgres.os_ops is open now
dmitry-lipetsk Sep 30, 2025
7f3c512
requirements.txt is updated
dmitry-lipetsk Sep 30, 2025
2266d99
cleanup [garbage]
dmitry-lipetsk Sep 30, 2025
e7dc9f3
[CI] Docker files are updated (git)
dmitry-lipetsk Sep 30, 2025
611943d
[CI] Docker file for Ubuntu 24.04 is fixed.
dmitry-lipetsk Oct 1, 2025
ebe8a08
[CI] Docker file for Ubuntu 24.04 is fixed [one more time]
dmitry-lipetsk Oct 1, 2025
f13d4ae
A problem with documentation is fixed [Sphinx]
dmitry-lipetsk Oct 1, 2025
6b408fb
fix: testgres/exceptions.py is deleted (again)
dmitry-lipetsk Nov 1, 2025
de73028
req: testgres.os_ops>=0.0.2,<1.0.0
dmitry-lipetsk Nov 1, 2025
5d3ec71
Merge branch 'master' into D20250816_001--external_os_ops_v001
dmitry-lipetsk Nov 1, 2025
3084635
Merge branch 'master' into D20250816_001--external_os_ops_v001
dmitry-lipetsk Nov 3, 2025
4219763
dockerfiles: git is not required to get python packages
dmitry-lipetsk Nov 3, 2025
2b44d99
Merge branch 'master' into D20250816_001--external_os_ops_v001
dmitry-lipetsk Nov 3, 2025
a1037aa
Merge branch 'master' into D20250816_001--external_os_ops_v001
dmitry-lipetsk Nov 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@pip install --force-reinstall ..
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
10 changes: 9 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
import testgres

assert testgres.__path__ is not None
assert len(testgres.__path__) == 1
assert type(testgres.__path__[0] == str) # noqa: E721
p = os.path.dirname(testgres.__path__[0])
assert type(p) == str # noqa: E721
sys.path.insert(0, os.path.abspath(p))

# -- Project information -----------------------------------------------------

project = u'testgres'
package_name = u'testgres'
copyright = u'2016-2023, Postgres Professional'
author = u'Postgres Professional'

Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"port-for>=0.4",
"six>=1.9.0",
"psutil",
"packaging"
"packaging",
"testgres.os_ops>=0.0.2,<1.0.0"
]

# Add compatibility enum class
Expand All @@ -29,7 +30,8 @@
setup(
version='1.11.1',
name='testgres',
packages=['testgres', 'testgres.operations', 'testgres.impl'],
packages=['testgres', 'testgres.impl'],
package_dir={"testgres": "src"},
description='Testing utility for PostgreSQL and its extensions',
url='https://github.com/postgrespro/testgres',
long_description=readme,
Expand Down
6 changes: 3 additions & 3 deletions testgres/__init__.py → src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@

from .config import testgres_config

from .operations.os_ops import OsOperations, ConnectionParams
from .operations.local_ops import LocalOperations
from .operations.remote_ops import RemoteOperations
from testgres.operations.os_ops import OsOperations, ConnectionParams
from testgres.operations.local_ops import LocalOperations
from testgres.operations.remote_ops import RemoteOperations

__all__ = [
"get_new_node",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion testgres/backup.py → src/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from .exceptions import BackupException

from .operations.os_ops import OsOperations
from testgres.operations.os_ops import OsOperations

from .utils import \
get_bin_path2, \
Expand Down
4 changes: 2 additions & 2 deletions testgres/cache.py → src/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
get_bin_path2, \
execute_utility2

from .operations.local_ops import LocalOperations
from .operations.os_ops import OsOperations
from testgres.operations.local_ops import LocalOperations
from testgres.operations.os_ops import OsOperations


def cached_initdb(data_dir, logfile=None, params=None, os_ops: OsOperations = None, bin_path=None, cached=True):
Expand Down
4 changes: 2 additions & 2 deletions testgres/config.py → src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from contextlib import contextmanager

from .consts import TMP_CACHE
from .operations.os_ops import OsOperations
from .operations.local_ops import LocalOperations
from testgres.operations.os_ops import OsOperations
from testgres.operations.local_ops import LocalOperations

log_level = os.getenv('LOGGING_LEVEL', 'WARNING').upper()
log_format = os.getenv('LOGGING_FORMAT', '%(asctime)s - %(levelname)s - %(message)s')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
71 changes: 71 additions & 0 deletions src/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# coding: utf-8

import six

from testgres.operations.exceptions import TestgresException
from testgres.operations.exceptions import ExecUtilException
from testgres.operations.exceptions import InvalidOperationException


class PortForException(TestgresException):
pass


@six.python_2_unicode_compatible
class QueryException(TestgresException):
def __init__(self, message=None, query=None):
super(QueryException, self).__init__(message)

self.message = message
self.query = query

def __str__(self):
msg = []

if self.message:
msg.append(self.message)

if self.query:
msg.append(u'Query: {}'.format(self.query))

return six.text_type('\n').join(msg)


class TimeoutException(QueryException):
pass


class CatchUpException(QueryException):
pass


@six.python_2_unicode_compatible
class StartNodeException(TestgresException):
def __init__(self, message=None, files=None):
super(StartNodeException, self).__init__(message)

self.message = message
self.files = files

def __str__(self):
msg = []

if self.message:
msg.append(self.message)

for f, lines in self.files or []:
msg.append(u'{}\n----\n{}\n'.format(f, lines))

return six.text_type('\n').join(msg)


class InitNodeException(TestgresException):
pass


class BackupException(TestgresException):
pass


assert ExecUtilException.__name__ == "ExecUtilException"
assert InvalidOperationException.__name__ == "InvalidOperationException"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..operations.os_ops import OsOperations
from testgres.operations.os_ops import OsOperations

from ..port_manager import PortManager
from ..exceptions import PortForException
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions testgres/node.py → src/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@

from .backup import NodeBackup

from .operations.os_ops import ConnectionParams
from .operations.os_ops import OsOperations
from .operations.local_ops import LocalOperations
from testgres.operations.os_ops import ConnectionParams
from testgres.operations.os_ops import OsOperations
from testgres.operations.local_ops import LocalOperations

InternalError = pglib.InternalError
ProgrammingError = pglib.ProgrammingError
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions testgres/utils.py → src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

from .exceptions import ExecUtilException
from .config import testgres_config as tconf
from .operations.os_ops import OsOperations
from .operations.remote_ops import RemoteOperations
from .operations.local_ops import LocalOperations
from .operations.helpers import Helpers as OsHelpers
from testgres.operations.os_ops import OsOperations
from testgres.operations.remote_ops import RemoteOperations
from testgres.operations.local_ops import LocalOperations
from testgres.operations.helpers import Helpers as OsHelpers

from .impl.port_manager__generic import PortManager__Generic

Expand Down
113 changes: 0 additions & 113 deletions testgres/exceptions.py

This file was deleted.

Empty file removed testgres/operations/__init__.py
Empty file.
55 changes: 0 additions & 55 deletions testgres/operations/helpers.py

This file was deleted.

Loading