forked from mspraggs/pyQCD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
62 lines (56 loc) · 2.11 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
from setuptools import setup, Extension, find_packages
from setuptools.command import build_ext
import os
import io
def read(*filenames, **kwargs):
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('sep', '\n')
buf = []
for filename in filenames:
with io.open(filename, encoding=encoding) as f:
buf.append(f.read())
return sep.join(buf)
long_description = read('README.md')
class my_build_ext(build_ext.build_ext):
def build_extension(self, ext):
import shutil
import os.path
try:
import pyQCD.core.kernel.lattice
module_file = pyQCD.core.kernel.lattice.__file__
shutil.copyfile(module_file,
self.get_ext_fullpath(ext.name))
except ImportError:
print("Notice: lattice.so binary missing. Installing analysis modules only.")
# Exclude the lattice.py and simulation.py files if lattice.so
# hasn't been built.
setup(
name='pyQCD',
version='',
packages=find_packages(exclude=["*test*"]),
url='https://github.com/mspraggs/pyqcd/',
license='Apache Software License',
author='Matt Spraggs',
install_requires=['numpy', 'scipy'],
author_email='[email protected]',
description='pyQCD provides a Python library for running coarse lattice '
'QCD simulations on desktop and workstation computers.',
long_description=long_description,
cmdclass = {'build_ext': my_build_ext},
ext_modules = [Extension('pyQCD/core/kernel/lattice',
sources = ['pyQCD/core/kernel/src/wrapper.cpp'])],
package_dir={'': '.'},
package_data={
'pyQCD.codegen': ['templates/*.cpp', 'templates/*.hpp'],
},
classifiers = [
'Programming Language :: Python',
'Programming Language :: C++',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: OS Independent',
'Topic :: Scientific/Engineering :: Physics',
],
)