pentoo-overlay/net-analyzer/owtf/files/owtf-setup.patch
2018-07-31 16:02:45 +08:00

73 lines
2.1 KiB
Diff

--- setup.py.orig 2018-05-16 08:54:51.000000000 +0800
+++ setup.py 2018-07-31 15:38:03.413783774 +0800
@@ -4,7 +4,6 @@
import ast
from subprocess import call
import io
-import pip
try:
from setuptools import setup, find_packages
except ImportError:
@@ -26,22 +25,6 @@
contents = fo.read()
return contents
-links = []
-requires = []
-
-# new versions of pip requires a session
-requirements = pip.req.parse_requirements('requirements.txt', session=pip.download.PipSession())
-
-for item in requirements:
- if getattr(item, 'url', None): # older pip has url
- links.append(str(item.url))
- if getattr(item, 'link', None): # newer pip has link
- links.append(str(item.link))
- if item.req:
- requires.append(str(item.req)) # always the package name
-
-post_script = os.path.join(ROOT_DIR, "owtf/install/install.py")
-
tests_requires = [
'PyHamcrest==1.9.0',
'mock>=1.3.0',
@@ -52,21 +35,6 @@
'sphinx_py3doc_enhanced_theme'
]
-class PostDevelopCommand(develop):
- """Post-installation for development mode."""
- def run(self):
- develop.run(self)
- print('Running post install')
- call([sys.executable, post_script])
-
-class PostInstallCommand(install):
- """Post-installation for installation mode."""
- def run(self):
- # Need because of a setuptools bug: https://github.com/pypa/setuptools/issues/456
- self.do_egg_install()
- print('Running post install')
- call([sys.executable, post_script])
-
setup(
name='owtf',
version=version,
@@ -80,16 +48,10 @@
include_package_data=True,
zip_safe=False,
platforms='any',
- install_requires=sorted(requires, key=lambda s: s.split("==")[0].lower()),
- dependency_links=links,
extras_require={
- 'test': tests_requires + requires,
+ 'test': tests_requires,
'docs': docs_requires
},
- cmdclass={
- 'develop': PostDevelopCommand,
- 'install': PostInstallCommand,
- },
entry_points={
'console_scripts': [
'owtf = owtf.__main__:main'