-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
55 lines (50 loc) · 1.39 KB
/
setup.py
File metadata and controls
55 lines (50 loc) · 1.39 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
"""
Script to make or install a package.
You should copy cpplint-cpp and version.h
from a build directory to ./dist before executing setup.py.
"""
from setuptools import setup, find_packages
import sys
import platform
from packaging.tags import sys_tags
# Get version and platform tag
version = "0.0.0"
plat_name = ''
version_header = open('dist/version.h').readlines()
for line in version_header:
if not line.startswith('#define'):
continue
name = line.split()[1]
val = line.split()[2][1:-1]
if name == 'CPPLINT_VERSION':
version = val
if name == 'PLATFORM_TAG':
plat_name = val
if (not plat_name or plat_name == 'unknown'):
# Get system's platform tag
plat_name = list(sys_tags())[0].platform
# Get exe_path
if sys.platform.startswith('win32'):
exe_path = 'dist/cpplint-cpp.exe'
else:
exe_path = 'dist/cpplint-cpp'
setup(
name='cpplint-cpp',
version=version,
description='C++ reimplementation of cpplint 2.0',
long_description=open('docs/README.md').read(),
long_description_content_type='text/markdown',
author='matyalatte',
author_email='matyalatte@gmail.com',
url='https://github.com/matyalatte/cpplint-cpp',
license=open('LICENSE').read(),
include_package_data=True,
data_files=[
('bin', [exe_path])
],
options={
'bdist_wheel': {
'plat_name': plat_name,
},
},
)