forked from containerbuildsystem/koji-containerbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
61 lines (51 loc) · 1.7 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
import sys
from setuptools import setup
from setuptools.command.sdist import sdist
from setuptools.command.build_py import build_py
import subprocess
class TitoDist(sdist):
def run(self):
subprocess.call(["tito", "build", "--tgz", "-o", "."])
def get_requirements(requirements_file='requirements.txt'):
with open(requirements_file) as f:
return [
line.split('#')[0].rstrip()
for line in f.readlines()
if not line.startswith('#')
]
class Py2CLIOnlyBuild(build_py):
excluded = {
'koji_containerbuild/plugins/builder_containerbuild.py',
'koji_containerbuild/plugins/hub_containerbuild.py',
}
def find_package_modules(self, package, package_dir):
modules = build_py.find_package_modules(self, package, package_dir)
return [
(pkg, mod, file, ) for (pkg, mod, file, ) in modules
if file not in self.excluded
]
setup(
name="koji-containerbuild",
version="1.0.dev0",
author="Pavol Babincak",
author_email="[email protected]",
description="Container build support for Koji buildsystem",
license="LGPLv2+",
url="https://github.com/containerbuildsystem/koji-containerbuild",
packages=[
'koji_containerbuild',
'koji_containerbuild.plugins',
],
install_requires=get_requirements(),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Internet",
"License :: OSI Approved :: GNU Lesser General Public License v2"
" or later (LGPLv2+)",
],
cmdclass={
'sdist': TitoDist,
# Only CLI for Py2
'build_py': build_py if sys.version_info[0] >= 3 else Py2CLIOnlyBuild,
}
)