Coverage for setup.py : 0%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2Basic setuptools description.
4This is not a complete definition.
6* Version number is not correct.
7* The shared library and include files are not installed. This makes it
8 unusable with other python packages that directly reference the C++
9 interface.
10"""
12from setuptools import setup
13from setuptools_cpp import ExtensionBuilder, Pybind11Extension
14import os
15import glob
17# Importing this automatically enables parallelized builds
18import numpy.distutils.ccompiler # noqa: F401
20# Currently a fake version for testing
21version = '0.0.1'
23# To enable consistency with sconsUtils we write the version to the
24# same location
25with open("./python/lsst/sphgeom/version.py", "w") as f:
26 print(f"""
27__all__ = ("__version__", )
28__version__ = '{version}'""", file=f)
31# read the contents of the README file
32this_directory = os.path.abspath(os.path.dirname(__file__))
33with open(os.path.join(this_directory, "README.md"), encoding='utf-8') as f:
34 long_description = f.read()
36# Find the source code -- we can combine it into a single module
37pybind_src = sorted(glob.glob("python/lsst/sphgeom/*.cc"))
38cpp_src = sorted(glob.glob("src/*.cc"))
40# Very inefficient approach since this compiles the maing sphgeom
41# library code for every extension rather than building everything once
42ext_modules = [Pybind11Extension("lsst.sphgeom._sphgeom",
43 sorted(cpp_src + pybind_src),
44 include_dirs=["include"])]
46setup(
47 version=version,
48 long_description=long_description,
49 ext_modules=ext_modules,
50 long_description_content_type="text/markdown",
51 cmdclass={'build_ext': ExtensionBuilder},
52)