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