File: add-scripts.patch

package info (click to toggle)
python-portpicker 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 200 kB
  • ctags: 101
  • sloc: python: 680; makefile: 22; sh: 14
file content (53 lines) | stat: -rw-r--r-- 1,602 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Description: add portserver script
Author: Sascha Steinbiss <satta@debian.org>
--- a/setup.py
+++ b/setup.py
@@ -14,14 +14,15 @@
 #
 """Simple distutils setup for the pure Python portpicker."""
 
-import distutils.core
+from setuptools import setup
 import sys
 import textwrap
 
 
 def main():
     requires = []
-    scripts = []
+    my_entry_points = {}
+    my_modules = ['portpicker']
     py_version = sys.version_info[:2]
     if py_version < (3, 3):
         requires.append('mock(>=1.0)')
@@ -29,9 +30,15 @@
         requires.append('asyncio(>=3.4)')
     if py_version >= (3, 3):
         # The example portserver implementation requires Python 3 and asyncio.
-        scripts.append('src/portserver.py')
+        #scripts.append('src/portserver.py')
+        my_entry_points = {
+            'console_scripts': [
+                'portserver=portserver:main'
+            ]
+        }
+        my_modules.append('portserver')
 
-    distutils.core.setup(
+    setup(
         name='portpicker',
         version='1.1.1',
         description='A library to choose unique available network ports.',
@@ -44,10 +51,10 @@
         maintainer_email='greg@krypto.org',
         url='https://github.com/google/python_portpicker',
         package_dir={'': 'src'},
-        py_modules=['portpicker'],
+        py_modules=my_modules,
         platforms=['POSIX'],
         requires=requires,
-        scripts=scripts,
+        entry_points=my_entry_points,
         classifiers=
         ['Development Status :: 5 - Production/Stable',
          'License :: OSI Approved :: Apache Software License',