1
1
#! /usr/bin/env python
2
2
3
3
"""
4
- Distutils setup file for Scapy.
4
+ Setuptools setup file for Scapy.
5
5
"""
6
6
7
+ import io
8
+ import os
9
+ import sys
10
+
11
+ if sys .version_info [0 ] <= 2 :
12
+ raise OSError ("Scapy no longer supports Python 2 ! Please use Scapy 2.5.0" )
13
+
7
14
try :
8
- from setuptools import setup , find_packages
15
+ from setuptools import setup
9
16
from setuptools .command .sdist import sdist
10
17
except :
11
18
raise ImportError ("setuptools is required to install scapy !" )
12
- import io
13
- import os
14
19
15
20
16
21
def get_long_description ():
17
- """Extract description from README.md, for PyPI's usage"""
22
+ """
23
+ Extract description from README.md, for PyPI's usage
24
+ """
18
25
def process_ignore_tags (buffer ):
19
26
return "\n " .join (
20
27
x for x in buffer .split ("\n " ) if "<!-- ignore_ppi -->" not in x
@@ -31,78 +38,18 @@ def process_ignore_tags(buffer):
31
38
32
39
33
40
class SDist (sdist ):
34
-
35
- def make_release_tree (self , base_dir , files ):
36
- sdist .make_release_tree (self , base_dir , files )
41
+ """
42
+ Modified sdist to create scapy/VERSION file
43
+ """
44
+ def make_release_tree (self , base_dir , * args , ** kwargs ):
45
+ super (SDist , self ).make_release_tree (base_dir , * args , ** kwargs )
37
46
# ensure there's a scapy/VERSION file
38
47
fn = os .path .join (base_dir , 'scapy' , 'VERSION' )
39
48
with open (fn , 'w' ) as f :
40
49
f .write (__import__ ('scapy' ).VERSION )
41
50
42
-
43
- # https://packaging.python.org/guides/distributing-packages-using-setuptools/
44
51
setup (
45
- name = 'scapy' ,
46
- version = __import__ ('scapy' ).VERSION ,
47
- packages = find_packages (exclude = ["test" ]),
48
- data_files = [('share/man/man1' , ["doc/scapy.1" ])],
49
52
cmdclass = {'sdist' : SDist },
50
- # Build starting scripts automatically
51
- entry_points = {
52
- 'console_scripts' : [
53
- 'scapy = scapy.main:interact'
54
- ]
55
- },
56
- python_requires = '>=3.7, <4' ,
57
- # pip > 9 handles all the versioning
58
- extras_require = {
59
- 'basic' : ["ipython" ],
60
- 'complete' : [
61
- 'ipython' ,
62
- 'pyx' ,
63
- 'cryptography>=2.0' ,
64
- 'matplotlib'
65
- ],
66
- 'docs' : [
67
- 'sphinx>=3.0.0' ,
68
- 'sphinx_rtd_theme>=0.4.3' ,
69
- 'tox>=3.0.0'
70
- ]
71
- },
72
- # We use __file__ in scapy/__init__.py, therefore Scapy isn't zip safe
73
- zip_safe = False ,
74
-
75
- # Metadata
76
- author = 'Philippe BIONDI' ,
77
- author_email = 'phil(at)secdev.org' ,
78
- maintainer = 'Pierre LALET, Gabriel POTTER, Guillaume VALADON' ,
79
- description = 'Scapy: interactive packet manipulation tool' ,
80
53
long_description = get_long_description (),
81
54
long_description_content_type = 'text/markdown' ,
82
- license = 'GPL-2.0-only' ,
83
- url = 'https://scapy.net' ,
84
- project_urls = {
85
- 'Documentation' : 'https://scapy.readthedocs.io' ,
86
- 'Source Code' : 'https://github.com/secdev/scapy/' ,
87
- },
88
- download_url = 'https://github.com/secdev/scapy/tarball/master' ,
89
- keywords = ["network" ],
90
- classifiers = [
91
- "Development Status :: 5 - Production/Stable" ,
92
- "Environment :: Console" ,
93
- "Intended Audience :: Developers" ,
94
- "Intended Audience :: Information Technology" ,
95
- "Intended Audience :: Science/Research" ,
96
- "Intended Audience :: System Administrators" ,
97
- "Intended Audience :: Telecommunications Industry" ,
98
- "License :: OSI Approved :: GNU General Public License v2 (GPLv2)" ,
99
- "Programming Language :: Python :: 3" ,
100
- "Programming Language :: Python :: 3.7" ,
101
- "Programming Language :: Python :: 3.8" ,
102
- "Programming Language :: Python :: 3.9" ,
103
- "Programming Language :: Python :: 3.10" ,
104
- "Topic :: Security" ,
105
- "Topic :: System :: Networking" ,
106
- "Topic :: System :: Networking :: Monitoring" ,
107
- ]
108
55
)
0 commit comments