forked from ambitus/pyzkiln
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·49 lines (43 loc) · 1.55 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
from setuptools import find_packages, setup
from setuptools.command.build_py import build_py
class PyracfInstallError(Exception):
pass
class Build(build_py):
"""Customized setuptools install command - builds pyracf code on install."""
def run(self):
# temporarily set environment variable PYRACF_HOME
pyracf_dir = f"{os.path.dirname(__file__)}/pyzkiln_core/pyracf"
os.environ['PYRACF_HOME'] = pyracf_dir
cmd = f"make -c {os.path.dirname(__file__)}/pyzkiln_core/pyracf"
try:
subprocess.check_output(cmd, shell=True)
except subprocess.CalledProcessError as e:
raise PyracfInstallError(f"Error while installing pyracf dependencies, returncode: {e.returncode}")
build_py.run(self)
setup(
name = "pyzkiln_core",
version = "0.1",
author = "Luisa Martinez, Frank De Gilio",
author_email = "[email protected], [email protected]",
description = ("A set of basic bricks "
"to build new capabilities for Z" ),
license = "Apache",
url = "https://github.com/ambitus/pyzkiln",
packages = find_packages(),
long_description = open("README.md", "r").read(),
long_description_content_type = 'text/markdown',
classifiers = [
"Programming Language :: Python :: 3",
"License :: Apache License",
"Operating System :: z/OS ",
],
python_requires = '>=3.6',
cmdclass = {
'build_py': Build,
},
include_package_data = True
)