Browse Source

Merge pull request #90 from RonnyPfannschmidt/entrypoints

use entrypoints instead of scripts, for better use of the wheel format and modern installs
TW 10 years ago
parent
commit
6ed086498d
2 changed files with 7 additions and 9 deletions
  1. 0 4
      scripts/borg
  2. 7 5
      setup.py

+ 0 - 4
scripts/borg

@@ -1,4 +0,0 @@
-#!/usr/bin/env python
-from borg.archiver import main
-main()
-

+ 7 - 5
setup.py

@@ -16,10 +16,8 @@ if sys.version_info < min_python:
     print("Borg requires Python %d.%d or later" % min_python)
     sys.exit(1)
 
-try:
-    from setuptools import setup, Extension
-except ImportError:
-    from distutils.core import setup, Extension
+
+from setuptools import setup, Extension
 
 crypto_source = 'borg/crypto.pyx'
 chunker_source = 'borg/chunker.pyx'
@@ -129,7 +127,11 @@ setup(
         'Topic :: System :: Archiving :: Backup',
     ],
     packages=['borg', 'borg.testsuite'],
-    scripts=['scripts/borg'],
+    entry_points={
+        'console_scripts': [
+            'borg = borg.archiver:main',
+        ]
+    },
     cmdclass=cmdclass,
     ext_modules=ext_modules,
     # msgpack pure python data corruption was fixed in 0.4.6.