forked from fO-000/bluing
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsetup.py
More file actions
106 lines (88 loc) · 3.18 KB
/
setup.py
File metadata and controls
106 lines (88 loc) · 3.18 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env python3
import os
import sys
import shutil
import logging
from pathlib import Path
from setuptools.command.install import install
from distutils.command.clean import clean
from setuptools import setup, find_packages
from pyclui import Logger
logger = Logger(__name__, logging.INFO)
PROJECT_ROOT = Path(__file__).parent
PROJECT_NAME = 'bluescan'
sys.path.insert(0, str(PROJECT_ROOT/'src'))
from bluescan import VERSION
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class MyInstall(install):
def run(self):
super().run()
# logger.info('install bluescan_prompt.bash')
# shutil.copy(
# 'src/bluescan/bluescan_prompt.bash', '/etc/bash_completion.d'
# )
class MyClean(clean):
def run(self):
super().run()
dirs = [
PROJECT_ROOT/'build'/'bdist.linux-x86_64', # 不直接删除 build 目录,因为 yotta 也会使用该目录。
PROJECT_ROOT/'build'/'lib',
PROJECT_ROOT/'dist',
PROJECT_ROOT/'src'/(PROJECT_NAME+'.egg-info'),
PROJECT_ROOT/'src'/PROJECT_NAME/'__pycache__'
]
for d in dirs:
shutil.rmtree(d, ignore_errors=True)
if __name__ == '__main__':
setup(
name=PROJECT_NAME,
version=VERSION,
license="GPLv3+",
packages=find_packages('src'), # include all packages under src
package_dir={'':'src'}, # tell distutils packages are under src
entry_points={
'console_scripts': [
'bluescan=bluescan.__main__:main'
]
},
package_data={
"bluescan": ['res/*.txt', 'res/*.csv']
},
#scripts=['src/bluescan/bluescan.py'],
install_requires=[
'bthci>=0.0.19', 'btatt>=0.0.2', 'btgatt>=0.0.2', 'btsmp>=0.0.2',
'pyclui>=0.0.10', 'scapy>=2.4.5', 'docopt>=0.6.2', 'pybluez>=0.23',
'bluepy>=1.3.0', 'pyserial>=3.5', 'dbus-python>=1.2.16', 'PyGObject>=3.40.1',
'halo>=0.0.31',
],
python_requires='>=3.9',
# metadata to display on PyPI
author="fO_000",
author_email="fO_000@protonmail.com",
description='A powerful Bluetooth scanner',
long_description=read('README.md'),
long_description_content_type='text/markdown',
url='https://github.com/fO-000/'+PROJECT_NAME,
# project_urls={
# "Bug Tracker": "None",
# "Documentation": "None",
# "Source Code": "None",
# },
cmdclass={
'install': MyInstall,
'clean': MyClean
},
classifiers=[
'Environment :: Console',
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"Intended Audience :: Telecommunications Industry",
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python :: 3.9',
'Topic :: Security',
'Topic :: System :: Networking',
]
)