patch-setup_py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --- Flask-1.1.1.orig/setup.py 2019-07-08 19:59:15.000000000 +0200
  2. +++ Flask-1.1.1/setup.py 2020-04-11 10:54:23.217330259 +0200
  3. @@ -1,8 +1,32 @@
  4. import io
  5. import re
  6. -from setuptools import find_packages
  7. -from setuptools import setup
  8. +try:
  9. + from setuptools import find_packages
  10. +except ImportError:
  11. + import os
  12. + from distutils.util import convert_path
  13. +
  14. + def find_packages(base_path):
  15. + base_path = convert_path(base_path)
  16. + found = []
  17. + for root, dirs, files in os.walk(base_path, followlinks=True):
  18. + dirs[:] = [d for d in dirs if d[0] != '.' and d not in ('ez_setup', '__pycache__')]
  19. + relpath = os.path.relpath(root, base_path)
  20. + parent = relpath.replace(os.sep, '.').lstrip('.')
  21. + if relpath != '.' and parent not in found:
  22. + # foo.bar package but no foo package, skip
  23. + continue
  24. + for dir in dirs:
  25. + if os.path.isfile(os.path.join(root, dir, '__init__.py')):
  26. + package = '.'.join((parent, dir)) if parent else dir
  27. + found.append(package)
  28. + return found
  29. +
  30. +try:
  31. + from setuptools import setup
  32. +except ImportError:
  33. + from distutils.core import setup
  34. with io.open("README.rst", "rt", encoding="utf8") as f:
  35. readme = f.read()