File: setup.py.in

package info (click to toggle)
dune-common 2.10.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 5,804 kB
  • sloc: cpp: 52,256; python: 3,979; sh: 1,658; makefile: 17
file content (35 lines) | stat: -rw-r--r-- 1,342 bytes parent folder | download
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
# SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
# SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception

from setuptools import setup, find_namespace_packages

pkg = '${RequiredPythonModules}'.replace(';',' ').split(' ')

# convert cmake bool to python bool
def cmake_to_bool(str):
  if str in ['1', 'ON', 'YES', 'TRUE', 'Y']:
    return True
  else:
    return False

# if MPI is found dune-common will be linked to MPI
# in that case we require mpi4py for MPI support from the Python side
# This will not install mpi4py when installing in build-isolation but
# will install it into the (internal) venv during a source build.
# The case of a package installation is taken care of in
# `python/dune/common/__init__.py'.
if cmake_to_bool("${HAVE_MPI}") and not cmake_to_bool("${SKBUILD}"):
  pkg += ['mpi4py']

setup(name="${ProjectName}",
    # only add 'dune' here in dune-common other packages shouldn't add file # directly to 'dune'
    packages=find_namespace_packages(include=['dune','dune.*']),
    description="${ProjectDescription}",
    version="${ProjectVersionString}",
    author="${ProjectAuthor}",
    author_email="${ProjectMaintainerEmail}",
    zip_safe = 0,
    package_data = {'': ['*.so']},
    install_requires = pkg,
    include_package_data=True,
  )