forked from tuhh-softsec/vul4j
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
54 lines (45 loc) · 1.48 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import os
import shutil
from setuptools import setup
from setuptools.command.install import install
class Vul4JConfigure(install):
user_options = install.user_options + [
("location=", None, "Specify location for vul4j data directory (default: ~/vul4j_data).")
]
def initialize_options(self):
install.initialize_options(self)
self.location = None
def finalize_options(self):
install.finalize_options(self)
if self.location is None:
self.location = os.path.expanduser("~/vul4j_data")
if os.path.exists(self.location):
print(f"ERROR: Directory already exists: {self.location}")
exit(1)
os.environ["VUL4J_DATA"] = self.location
def run(self):
os.makedirs(self.location, exist_ok=True)
shutil.copy(os.path.join("vul4j", "vul4j.ini"), self.location)
print(f"Data directory and files setup at: {self.location}")
install.run(self)
setup(
name='vul4j',
version='2.0',
description='Vul4J: A Dataset of Reproducible Java Vulnerabilities',
author='Quang-Cuong Bui, Bence Bogenfuerst',
author_email='[email protected], [email protected]',
url='https://github.com/bqcuong/vul4j',
license='MIT',
packages=['vul4j'],
install_requires=[
'unidiff',
'loguru',
'GitPython'
],
cmdclass={
'install': Vul4JConfigure
},
entry_points={
'console_scripts': ['vul4j = vul4j.main:main']
},
)