From 780583b18ea8c042ab153ea490944f786670fa57 Mon Sep 17 00:00:00 2001 From: gpotter2 Date: Tue, 15 May 2018 18:23:02 +0200 Subject: [PATCH] Add PyPi description --- README.md | 1 + setup.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index e41ef30e0..fb1738b24 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ Python modules, such as `matplotlib` or `cryptography`. See the [documentation](http://scapy.readthedocs.io/en/latest/installation.html) and follow the instructions to install them. +[//]: # (stop_pypi_description) ## Contributing ## Want to contribute? Great! Please take a few minutes to diff --git a/setup.py b/setup.py index 801a7aaf4..81b2a4afa 100755 --- a/setup.py +++ b/setup.py @@ -9,6 +9,7 @@ from distutils import archive_util from distutils import sysconfig from distutils.core import setup from distutils.command.sdist import sdist +import io import os @@ -40,6 +41,13 @@ def make_ezipfile(base_name, base_dir, verbose=0, dry_run=0, **kwargs): archive_util.ARCHIVE_FORMATS["ezip"] = ( make_ezipfile, [], 'Executable ZIP file') +def get_long_description(): + try: + with io.open("README.md", encoding="utf-8") as f: + return f.read().partition("[//]: # (stop_pypi_description)")[0] + except IOError: + return None + SCRIPTS = ['bin/scapy', 'bin/UTscapy'] # On Windows we also need additional batch files to run the above scripts if os.name == "nt": @@ -73,6 +81,8 @@ setup( author_email='phil(at)secdev.org', maintainer='Pierre LALET, Guillaume VALADON', description='Scapy: interactive packet manipulation tool', + long_description=get_long_description(), + long_description_content_type='text/markdown', license='GPLv2', url='http://www.secdev.org/projects/scapy', download_url='https://github.com/secdev/scapy/tarball/master',