postgrespro / pg_probackup

Backup and recovery manager for PostgreSQL
https://postgrespro.github.io/pg_probackup/
Other
712 stars 86 forks source link

Python tests require setuptools module #628

Open dmitry-lipetsk opened 3 months ago

dmitry-lipetsk commented 3 months ago

Hello,

When I run probackup tests, I get the the following error - ModuleNotFoundError: No module named 'distutils'

(env) dima@ubuntu-work:~/.MY/GitHUB2/PostgresPro/pg_probackup/work2$ python -m unittest tests
/home/dima/.MY/GitHUB2/PostgresPro/pg_probackup/work2/tests/merge_test.py:1953: SyntaxWarning: invalid escape sequence '\ '
  """
E
======================================================================
ERROR: tests (unittest.loader._FailedTest.tests)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests
Traceback (most recent call last):
  File "/usr/lib/python3.12/unittest/loader.py", line 137, in loadTestsFromName
    module = __import__(module_name)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dima/.MY/GitHUB2/PostgresPro/pg_probackup/work2/tests/__init__.py", line 4, in <module>
    from . import init_test, merge_test, option_test, show_test, compatibility_test, \
  File "/home/dima/.MY/GitHUB2/PostgresPro/pg_probackup/work2/tests/backup_test.py", line 7, in <module>
    from distutils.dir_util import copy_tree
ModuleNotFoundError: No module named 'distutils'

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)

This problem can be fixed with adding "setuptools" in tests/requirements.txt file.