Skip to content

Commit 2eb4935

Browse files
gpotter2KOLANICH
andcommitted
Migrate to pyproject.toml
Co-authored-by: KOLANICH <[email protected]>
1 parent eba8ce4 commit 2eb4935

File tree

5 files changed

+100
-99
lines changed

5 files changed

+100
-99
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ Other useful resources:
6565

6666
- [Scapy in 20 minutes](https://github.com/secdev/scapy/blob/master/doc/notebooks/Scapy%20in%2015%20minutes.ipynb)
6767
- [Interactive tutorial](https://scapy.readthedocs.io/en/latest/usage.html#interactive-tutorial) (part of the documentation)
68-
- [The quick demo: an interactive session](https://scapy.readthedocs.io/en/latest/introduction.html#quick-demo)
69-
(some examples may be outdated)
68+
- [The quick demo: an interactive session](https://scapy.readthedocs.io/en/latest/introduction.html#quick-demo) (some examples may be outdated)
7069
- [HTTP/2 notebook](https://github.com/secdev/scapy/blob/master/doc/notebooks/HTTP_2_Tuto.ipynb)
7170
- [TLS notebooks](https://github.com/secdev/scapy/blob/master/doc/notebooks/tls)
7271

pyproject.toml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
[build-system]
2+
requires = [ "setuptools>=61.1" ]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "scapy"
7+
dynamic = [ "version", "readme" ]
8+
authors = [
9+
{ name="Philippe BIONDI" },
10+
]
11+
maintainers = [
12+
{ name="Pierre LALET" },
13+
{ name="Gabriel POTTER" },
14+
{ name="Guillaume VALADON" },
15+
]
16+
license = { text="GPL-2.0-only" }
17+
requires-python = ">=3.7, <4"
18+
description = "Scapy: interactive packet manipulation tool"
19+
keywords = [ "network" ]
20+
classifiers = [
21+
"Development Status :: 5 - Production/Stable",
22+
"Environment :: Console",
23+
"Intended Audience :: Developers",
24+
"Intended Audience :: Information Technology",
25+
"Intended Audience :: Science/Research",
26+
"Intended Audience :: System Administrators",
27+
"Intended Audience :: Telecommunications Industry",
28+
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
29+
"Programming Language :: Python :: 3",
30+
"Programming Language :: Python :: 3 :: Only",
31+
"Programming Language :: Python :: 3.7",
32+
"Programming Language :: Python :: 3.8",
33+
"Programming Language :: Python :: 3.9",
34+
"Programming Language :: Python :: 3.10",
35+
"Topic :: Security",
36+
"Topic :: System :: Networking",
37+
"Topic :: System :: Networking :: Monitoring",
38+
]
39+
40+
[project.urls]
41+
homepage = "https://scapy.net"
42+
documentation = "https://scapy.readthedocs.io"
43+
repository = "https://github.com/secdev/scapy"
44+
changelog = "https://github.com/secdev/scapy/releases"
45+
46+
[project.scripts]
47+
scapy = "scapy.main:interact"
48+
49+
[project.optional-dependencies]
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+
# setuptools specific
64+
65+
[tool.setuptools]
66+
zip-safe = false # We use __file__ in scapy/__init__.py, therefore Scapy isn't zip safe
67+
68+
[tool.setuptools.packages.find]
69+
include = [ "scapy" ]
70+
71+
[tool.setuptools.dynamic]
72+
version = { attr="scapy.VERSION" }
73+
74+
# coverage
75+
76+
[tool.coverage]
77+
concurrency = "multiprocessing"
78+
omit = [
79+
# Scapy specific paths
80+
"scapy/tools/UTscapy.py",
81+
"test/*",
82+
# Scapy external modules
83+
"scapy/libs/six.py",
84+
"scapy/libs/winpcapy.py",
85+
"scapy/libs/ethertypes.py",
86+
# .tox specific path
87+
".tox/*",
88+
# OS specific paths
89+
"/private/*",
90+
]

setup.cfg

Lines changed: 0 additions & 26 deletions
This file was deleted.

setup.py

Lines changed: 8 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
#! /usr/bin/env python
22

33
"""
4-
Distutils setup file for Scapy.
4+
Setuptools setup file for Scapy.
55
"""
66

7+
import os
8+
79
try:
8-
from setuptools import setup, find_packages
10+
from setuptools import setup
911
except:
1012
raise ImportError("setuptools is required to install scapy !")
11-
import io
12-
import os
1313

1414

1515
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+
"""
1719
def process_ignore_tags(buffer):
1820
return "\n".join(
1921
x for x in buffer.split("\n") if "<!-- ignore_ppi -->" not in x
2022
)
2123
try:
2224
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:
2426
readme = f.read()
2527
desc = readme.partition("<!-- start_ppi_description -->")[2]
2628
desc = desc.partition("<!-- stop_ppi_description -->")[0]
@@ -29,71 +31,7 @@ def process_ignore_tags(buffer):
2931
return None
3032

3133

32-
# https://packaging.python.org/guides/distributing-packages-using-setuptools/
3334
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',
7135
long_description=get_long_description(),
7236
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-
]
9937
)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ deps = mock
2828
setuptools>=18.5
2929
ipython
3030
cryptography
31-
coverage
31+
coverage[toml]
3232
python-can
3333
# disabled on windows because they require c++ dependencies
3434
brotli ; sys_platform != 'win32'

0 commit comments

Comments
 (0)