Skip to content

Commit 3f7c190

Browse files
authored
Merge pull request #1781 from gpotter2/fixsetup
Fix PyPi dist
2 parents 6dc8da7 + 7f321c6 commit 3f7c190

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ matrix:
66
- os: linux
77
python: 2.7
88
env:
9-
- TOXENV=flake8,docs,spell
9+
- TOXENV=flake8,twine,docs,spell
1010

1111
# Run as a regular user
1212
- os: linux

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
include MANIFEST.in
22
include run_scapy
33
recursive-include bin *
4-
recursive-include doc *
5-
recursive-include test *
64
include scapy/VERSION

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<p align="center">
2-
<img src="doc/scapy_logo.png" width=200>
2+
<img src="doc/scapy_logo.png" width=200>
33
</p>
44

5+
<!-- start_ppi_description -->
6+
57
# Scapy
68

79
[![Travis Build Status](https://travis-ci.org/secdev/scapy.svg?branch=master)](https://travis-ci.org/secdev/scapy)
810
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/secdev/scapy?svg=true)](https://ci.appveyor.com/project/secdev/scapy)
911
[![Codecov Status](https://codecov.io/gh/secdev/scapy/branch/master/graph/badge.svg)](https://codecov.io/gh/secdev/scapy)
10-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/30ee6772bb264a689a2604f5cdb0437b)](https://www.codacy.com/app/secdev/scapy?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=secdev/scapy&amp;utm_campaign=Badge_Grade)
12+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/30ee6772bb264a689a2604f5cdb0437b)](https://www.codacy.com/app/secdev/scapy?utm_source=github.com&utm_medium=referral&utm_content=secdev/scapy&utm_campaign=Badge_Grade)
1113
[![PyPI Version](https://img.shields.io/pypi/v/scapy.svg)](https://pypi.python.org/pypi/scapy/)
1214
[![Python Versions](https://img.shields.io/pypi/pyversions/scapy.svg)](https://pypi.python.org/pypi/scapy/)
1315
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](LICENSE)
@@ -57,13 +59,12 @@ Received 2 packets, got 1 answers, remaining 0 packets
5759
### Python module
5860

5961
It is straightforward to use Scapy as a regular Python module, for example to
60-
check if a TCP port is opened. First, save the following code in a file names
61-
`send_tcp_syn.py`
62+
check if a TCP port is opened.
63+
First, save the following code in a file names e.g. `send_tcp_syn.py`
6264

6365
```python
6466
from scapy.all import *
6567
conf.verb = 0
66-
6768
p = IP(dst="github.com")/TCP()
6869
r = sr1(p)
6970
print(r.summary())
@@ -110,7 +111,7 @@ Python modules, such as `matplotlib` or `cryptography`. See the
110111
[documentation](http://scapy.readthedocs.io/en/latest/installation.html) and
111112
follow the instructions to install them.
112113

113-
<!--- stop_ppi_description -->
114+
<!-- stop_ppi_description -->
114115

115116
## Contributing
116117

setup.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77

88
from distutils import archive_util
9-
from distutils import sysconfig
10-
from distutils.core import setup
11-
from distutils.command.sdist import sdist
9+
try:
10+
from setuptools import setup
11+
except ImportError:
12+
from distutils.core import setup
1213
import io
1314
import os
1415

@@ -41,13 +42,18 @@ def make_ezipfile(base_name, base_dir, verbose=0, dry_run=0, **kwargs):
4142
archive_util.ARCHIVE_FORMATS["ezip"] = (
4243
make_ezipfile, [], 'Executable ZIP file')
4344

45+
4446
def get_long_description():
4547
try:
4648
with io.open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8") as f:
47-
return f.read().partition("<!--- stop_ppi_description -->")[0]
49+
readme = f.read()
50+
desc = readme.partition("<!-- start_ppi_description -->")[2]
51+
desc = desc.partition("<!-- stop_ppi_description -->")[0]
52+
return desc.strip()
4853
except IOError:
4954
return None
5055

56+
5157
SCRIPTS = ['bin/scapy', 'bin/UTscapy']
5258
# On Windows we also need additional batch files to run the above scripts
5359
if os.name == "nt":

tox.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ deps = codespell
9797
# inet6, dhcp6 and the ipynb files contains french: ignore them
9898
commands = codespell --ignore-words=.travis/codespell_ignore.txt --skip="*.pyc,*.png,*.raw,*.pdf,*.pcap,*.js,*.html,*.der,*_build*,*inet6.py,*dhcp6.py,*.ipynb" scapy/ doc/ test/ .github/
9999

100+
[testenv:twine]
101+
description = "Check Scapy code distribution"
102+
skip_install = true
103+
deps = twine
104+
setuptools>=38.6.0
105+
cmarkgfm
106+
commands = python setup.py sdist
107+
twine check dist/*
108+
100109
[testenv:flake8]
101110
description = "Check Scapy code style & quality"
102111
skip_install = true

0 commit comments

Comments
 (0)