Skip to content

Commit 8805cc5

Browse files
Usage of external testgres.os_ops and testgres.common (#289)
This patch splits testgres into tree parts: - testgres - testgres.os_ops - testgres.common testgres.os_ops and testgres.common are packed into separated packages.
1 parent a060d47 commit 8805cc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+158
-3690
lines changed

docs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ help:
1717
# Catch-all target: route all unknown targets to Sphinx using the new
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
20+
@pip install --force-reinstall ..
2021
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/source/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@
1414
#
1515
import os
1616
import sys
17-
sys.path.insert(0, os.path.abspath('../..'))
17+
import testgres
18+
19+
assert testgres.__path__ is not None
20+
assert len(testgres.__path__) == 1
21+
assert type(testgres.__path__[0] == str) # noqa: E721
22+
p = os.path.dirname(testgres.__path__[0])
23+
assert type(p) == str # noqa: E721
24+
sys.path.insert(0, os.path.abspath(p))
1825

1926
# -- Project information -----------------------------------------------------
2027

2128
project = u'testgres'
29+
package_name = u'testgres'
2230
copyright = u'2016-2023, Postgres Professional'
2331
author = u'Postgres Professional'
2432

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"port-for>=0.4",
1212
"six>=1.9.0",
1313
"psutil",
14-
"packaging"
14+
"packaging",
15+
"testgres.os_ops>=0.0.2,<1.0.0"
1516
]
1617

1718
# Add compatibility enum class
@@ -29,7 +30,8 @@
2930
setup(
3031
version='1.11.1',
3132
name='testgres',
32-
packages=['testgres', 'testgres.operations', 'testgres.impl'],
33+
packages=['testgres', 'testgres.impl'],
34+
package_dir={"testgres": "src"},
3335
description='Testing utility for PostgreSQL and its extensions',
3436
url='https://github.com/postgrespro/testgres',
3537
long_description=readme,

testgres/__init__.py renamed to src/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151

5252
from .config import testgres_config
5353

54-
from .operations.os_ops import OsOperations, ConnectionParams
55-
from .operations.local_ops import LocalOperations
56-
from .operations.remote_ops import RemoteOperations
54+
from testgres.operations.os_ops import OsOperations, ConnectionParams
55+
from testgres.operations.local_ops import LocalOperations
56+
from testgres.operations.remote_ops import RemoteOperations
5757

5858
__all__ = [
5959
"get_new_node",
File renamed without changes.

testgres/backup.py renamed to src/backup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from .exceptions import BackupException
1515

16-
from .operations.os_ops import OsOperations
16+
from testgres.operations.os_ops import OsOperations
1717

1818
from .utils import \
1919
get_bin_path2, \

testgres/cache.py renamed to src/cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
get_bin_path2, \
1717
execute_utility2
1818

19-
from .operations.local_ops import LocalOperations
20-
from .operations.os_ops import OsOperations
19+
from testgres.operations.local_ops import LocalOperations
20+
from testgres.operations.os_ops import OsOperations
2121

2222

2323
def cached_initdb(data_dir, logfile=None, params=None, os_ops: OsOperations = None, bin_path=None, cached=True):

testgres/config.py renamed to src/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from contextlib import contextmanager
1010

1111
from .consts import TMP_CACHE
12-
from .operations.os_ops import OsOperations
13-
from .operations.local_ops import LocalOperations
12+
from testgres.operations.os_ops import OsOperations
13+
from testgres.operations.local_ops import LocalOperations
1414

1515
log_level = os.getenv('LOGGING_LEVEL', 'WARNING').upper()
1616
log_format = os.getenv('LOGGING_FORMAT', '%(asctime)s - %(levelname)s - %(message)s')
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)