forked from easybuilders/easybuild-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
145 lines (130 loc) · 5.36 KB
/
setup.py
File metadata and controls
145 lines (130 loc) · 5.36 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
##
# Copyright 2012-2026 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (FWO) (http://www.fwo.be/en)
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
#
# https://github.com/easybuilders/easybuild
#
# EasyBuild is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation v2.
#
# EasyBuild is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
##
"""
This script can be used to install easybuild-framework, e.g. using:
python setup.py install --prefix=$HOME/easybuild
@author: Kenneth Hoste (Ghent University)
"""
import glob
import os
import logging
try:
from distutils.core import setup
except ImportError:
from setuptools import setup
from easybuild.tools.version import VERSION
API_VERSION = str(VERSION).split('.')[0]
# Utility function to read README file
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
log = logging.getLogger("EasyBuild")
# log levels: NOTSET (default), DEBUG, INFO, WARNING, ERROR, CRITICAL
log.setLevel(logging.INFO)
log.info("Installing version %s (API version %s)" % (VERSION, API_VERSION))
def find_rel_test():
"""Return list of files recursively from basedir (aka find -type f)"""
basedir = os.path.join(os.path.dirname(__file__), "test", "framework")
current = os.getcwd()
os.chdir(basedir)
res = []
for subdir in ["easyconfigs", "easystacks", "modules", "sandbox"]:
res.extend([os.path.join(root, filename)
for root, dirnames, filenames in os.walk(subdir)
for filename in filenames if os.path.isfile(os.path.join(root, filename))])
os.chdir(current)
return res
easybuild_packages = [
"easybuild", "easybuild.base",
"easybuild.framework", "easybuild.framework.easyconfig", "easybuild.framework.easyconfig.format",
"easybuild.toolchains", "easybuild.toolchains.compiler", "easybuild.toolchains.mpi",
"easybuild.toolchains.fft", "easybuild.toolchains.linalg", "easybuild.tools", "easybuild.tools.containers",
"easybuild.tools.deprecated", "easybuild.tools.job", "easybuild.tools.toolchain",
"easybuild.tools.module_naming_scheme", "easybuild.tools.package", "easybuild.tools.package.package_naming_scheme",
"easybuild.tools.py2vs3", "easybuild.tools.repository",
"easybuild.tools.tomllib", "easybuild.tools.tomllib.tomli", "easybuild.tools._toml_writer",
"test.framework", "test",
]
# Verify the above list is complete, if setuptools is installed
try:
import setuptools
except ImportError:
pass
else:
packages = set(setuptools.find_packages())
easybuild_packages_set = set(easybuild_packages)
if easybuild_packages_set != packages:
# Warning only
print("="*80 + "\n"
"=== WARNING: Wrong list of easybuild_packages.\n"
f"Missing: {packages - easybuild_packages_set}\n"
f"Unneccessary: {easybuild_packages_set - packages}"
"\n" + "="*80 + "\n")
setup(
name="easybuild-framework",
version=str(VERSION),
author="EasyBuild community",
author_email="easybuild@lists.ugent.be",
description="""The EasyBuild framework supports the creation of custom easyblocks that \
implement support for installing particular (groups of) software packages.""",
license="GPLv2",
keywords="software build building installation installing compilation HPC scientific",
url="https://easybuild.io",
packages=easybuild_packages,
package_dir={'test.framework': 'test/framework'},
package_data={'test.framework': find_rel_test()},
scripts=[
'eb',
# bash completion
'optcomplete.bash',
'minimal_bash_completion.bash',
'eb_bash_completion.bash',
'eb_bash_completion_local.bash',
# utility scripts
'easybuild/scripts/install_eb_dep.sh',
],
data_files=[
('easybuild/scripts', glob.glob('easybuild/scripts/*')),
('etc', glob.glob('etc/*')),
('contrib/hooks', glob.glob('contrib/hooks/*')),
],
long_description=read('README.rst'),
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: System Administrators",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Build Tools",
],
platforms="Linux",
)