setup.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env python3
  2. # Allow execution from anywhere
  3. import os
  4. import sys
  5. sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
  6. import warnings
  7. if sys.argv[1:2] == ['py2exe']:
  8. warnings.warn(DeprecationWarning('`setup.py py2exe` is deprecated and will be removed in a future version. '
  9. 'Use `bundle.py2exe` instead'))
  10. import bundle.py2exe
  11. bundle.py2exe.main()
  12. elif 'build_lazy_extractors' in sys.argv:
  13. warnings.warn(DeprecationWarning('`setup.py build_lazy_extractors` is deprecated and will be removed in a future version. '
  14. 'Use `devscripts.make_lazy_extractors` instead'))
  15. import subprocess
  16. os.chdir(sys.path[0])
  17. print('running build_lazy_extractors')
  18. subprocess.run([sys.executable, 'devscripts/make_lazy_extractors.py'])
  19. else:
  20. print(
  21. 'ERROR: Building by calling `setup.py` is deprecated. '
  22. 'Use a build frontend like `build` instead. ',
  23. 'Refer to https://build.pypa.io for more info', file=sys.stderr)
  24. sys.exit(1)