forked from OSInside/kiwi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·106 lines (95 loc) · 3.06 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
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 python
# -*- encoding: utf-8 -*-
from os import path
from setuptools import setup
from setuptools.command import sdist as setuptools_sdist
import distutils
import subprocess
from kiwi.version import __version__
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as readme:
long_description = readme.read()
class sdist(setuptools_sdist.sdist):
"""
Custom sdist command
Host requirements: git
"""
def run(self):
"""
Run first the git commit format update $Format:%H$
and after that the usual Python sdist
"""
# git attributes
command = ['make', 'git_attributes']
self.announce(
'Running make git_attributes target: %s' % str(command),
level=distutils.log.INFO
)
self.announce(
subprocess.check_output(command).decode(),
level=distutils.log.INFO
)
# standard sdist process
setuptools_sdist.sdist.run(self)
# cleanup attributes
command = ['make', 'clean_git_attributes']
self.announce(
subprocess.check_output(command).decode(),
level=distutils.log.INFO
)
config = {
'name': 'kiwi',
'long_description': long_description,
'long_description_content_type': 'text/x-rst',
'python_requires': '>=3.6',
'description': 'KIWI - Appliance Builder (next generation)',
'author': 'Marcus Schaefer',
'url': 'https://osinside.github.io/kiwi',
'download_url':
'https://download.opensuse.org/repositories/'
'Virtualization:/Appliances:/Builder',
'author_email': '[email protected]',
'version': __version__,
'license' : 'GPLv3+',
'install_requires': [
'docopt>=0.6.2',
'lxml',
'pyxattr',
'requests',
'PyYAML'
],
'packages': ['kiwi'],
'cmdclass': {
'sdist': sdist
},
'entry_points': {
'kiwi.tasks': [
'image_info=kiwi.tasks.image_info',
'image_resize=kiwi.tasks.image_resize',
'result_bundle=kiwi.tasks.result_bundle',
'result_list=kiwi.tasks.result_list',
'system_build=kiwi.tasks.system_build',
'system_create=kiwi.tasks.system_create',
'system_prepare=kiwi.tasks.system_prepare',
'system_update=kiwi.tasks.system_update'
],
'console_scripts': [
'kiwi-ng=kiwi.kiwi:main',
'kiwicompat=kiwi.kiwi_compat:main'
]
},
'include_package_data': True,
'zip_safe': False,
'classifiers': [
# classifier: http://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: '
'GNU General Public License v3 or later (GPLv3+)',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: System :: Operating System',
]
}
setup(**config)