-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
61 lines (56 loc) · 2.68 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
###################################################################################
# Copyright 2021 National Technology & Engineering Solutions of Sandia, #
# LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the #
# U.S. Government retains certain rights in this software. #
# If you want to use this code, please refer to the README.rst and LICENSE files. #
###################################################################################
import os
import importlib
from setuptools import setup
from pathlib import Path
requirements = ['numpy', 'Cython>=0.29.32']
# We do this dance, so that we can install everything in editable mode
# as well. Otherwise installing PyNucleus in editable mode replaces
# the subpackages with their non-editable installs.
lclDir = os.getcwd().replace('\\', '/')
for pkg, srcLocation in [
# These are just in the same git repo.
('packageTools', 'file://localhost/{lclDir}/packageTools'.format(lclDir=lclDir)),
('base', 'file://localhost/{lclDir}/base'.format(lclDir=lclDir)),
('metisCy', 'file://localhost/{lclDir}/metisCy'.format(lclDir=lclDir)),
('fem', 'file://localhost/{lclDir}/fem'.format(lclDir=lclDir)),
('multilevelSolver', 'file://localhost/{lclDir}/multilevelSolver'.format(lclDir=lclDir)),
('nl', 'file://localhost/{lclDir}/nl'.format(lclDir=lclDir)),
]:
fullPkgName = 'PyNucleus_'+pkg
try:
importlib.import_module(fullPkgName)
requirements += [fullPkgName]
except ImportError:
requirements += ['{} @ {}'.format(fullPkgName, srcLocation)]
version = '0.0.0'
if Path('VERSION').exists():
with open('VERSION', 'r') as f:
for line in f.readlines():
if not line[0].isnumeric():
continue
version = line
break
setup(name='PyNucleus',
version=version,
packages=['PyNucleus'],
data_files=[('drivers', [str(p) for p in Path('drivers').glob('*.py')])],
description='A finite element code that specifically targets nonlocal operators.',
long_description=''.join(open('README.rst').readlines()),
long_description_content_type='text/x-rst',
author="Christian Glusa",
author_email='[email protected]',
platforms='any',
license='MIT',
license_files=['LICENSE'],
python_requires='>=3.10',
install_requires=requirements,
extras_require={'testing': ['pytest', 'pytest-html', 'pytest-xdist'],
'docs': ['Sphinx', 'sphinxcontrib-programoutput', 'sphinx-gallery', 'sphinx-rtd-theme'],
'dev': ['flake8', 'flake8-junit-report', 'cython-lint']},
zip_safe=False)