You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.0 KiB

  1. From 196c55e93103d1e56d1336f27a5f2591b4e54fef Mon Sep 17 00:00:00 2001
  2. From: sebres <info@sebres.de>
  3. Date: Sun, 19 Sep 2021 18:49:18 +0200
  4. Subject: [PATCH] fix gh-3098: build fails with error in fail2ban setup
  5. command: use_2to3 is invalid (setuptools 58+)
  6. ---
  7. setup.py | 16 +---------------
  8. 1 file changed, 1 insertion(+), 15 deletions(-)
  9. --- a/setup.py
  10. +++ b/setup.py
  11. @@ -56,7 +56,7 @@ import warnings
  12. from glob import glob
  13. from fail2ban.setup import updatePyExec
  14. -
  15. +from fail2ban.version import version
  16. source_dir = os.path.realpath(os.path.dirname(
  17. # __file__ seems to be overwritten sometimes on some python versions (e.g. bug of 2.6 by running under cProfile, etc.):
  18. @@ -120,22 +120,12 @@ class install_scripts_f2b(install_script
  19. # Wrapper to specify fail2ban own options:
  20. class install_command_f2b(install):
  21. user_options = install.user_options + [
  22. - ('disable-2to3', None, 'Specify to deactivate 2to3, e.g. if the install runs from fail2ban test-cases.'),
  23. ('without-tests', None, 'without tests files installation'),
  24. ]
  25. def initialize_options(self):
  26. - self.disable_2to3 = None
  27. self.without_tests = not with_tests
  28. install.initialize_options(self)
  29. def finalize_options(self):
  30. - global _2to3
  31. - ## in the test cases 2to3 should be already done (fail2ban-2to3):
  32. - if self.disable_2to3:
  33. - _2to3 = False
  34. - if _2to3:
  35. - cmdclass = self.distribution.cmdclass
  36. - cmdclass['build_py'] = build_py_2to3
  37. - cmdclass['build_scripts'] = build_scripts_2to3
  38. if self.without_tests:
  39. self.distribution.scripts.remove('bin/fail2ban-testcases')
  40. @@ -186,7 +176,6 @@ commands.'''
  41. if setuptools:
  42. setup_extra = {
  43. 'test_suite': "fail2ban.tests.utils.gatherTests",
  44. - 'use_2to3': True,
  45. }
  46. else:
  47. setup_extra = {}
  48. @@ -210,9 +199,6 @@ if platform_system in ('linux', 'solaris
  49. ('/usr/share/doc/fail2ban', doc_files)
  50. )
  51. -# Get version number, avoiding importing fail2ban.
  52. -# This is due to tests not functioning for python3 as 2to3 takes place later
  53. -exec(open(join("fail2ban", "version.py")).read())
  54. setup(
  55. name = "fail2ban",