This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
setup.py
56 lines (43 loc) · 1.61 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
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import os
import os.path as osp
import Cython.Compiler.Options
import numpy
from Cython.Build import cythonize
from setuptools import Extension, find_packages, setup
Cython.Compiler.Options.annotate = True
cython_aug_root = "mpa/modules/datasets/pipelines/transforms/cython_augments"
cython_aug_modl = cython_aug_root.replace("/", ".")
ext_modules = []
for fname in os.listdir(cython_aug_root):
name, ext = osp.splitext(fname)
if ext == ".pyx":
ext_modules += [
Extension(f"{cython_aug_modl}.{name}", [osp.join(cython_aug_root, fname)],
include_dirs=[numpy.get_include()], extra_compile_args=["-O3"])
]
ext_modules = cythonize(ext_modules, annotate=True)
with open("README.md", "r") as fh:
long_description = fh.read()
def get_requirements(filename='requirements.txt'):
here = osp.dirname(osp.realpath(__file__))
with open(osp.join(here, filename), 'r') as f:
requires = [line.replace('\n', '') for line in f.readlines()]
return requires
def find_version():
version_file = 'mpa/version.py'
with open(version_file, 'r') as f:
exec(compile(f.read(), version_file, 'exec'))
return locals()['__version__']
setup(
name='mpa',
version=find_version(),
url='https://github.com/openvinotoolkit/model_preparation_algorithm',
packages=find_packages(include=('mpa', 'recipes', 'samples')),
description='Model Preperation Algorithms',
long_description=long_description,
install_requires=get_requirements(),
ext_modules=ext_modules,
)