-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
16 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = sigpyproc | ||
version = 0.5.7 | ||
version = 0.6.0 | ||
author = Ewan Barr | ||
author_email = [email protected] | ||
maintainer = Pravir Kumar | ||
|
@@ -12,11 +12,9 @@ long_description_content_type = text/markdown | |
classifiers = | ||
Operating System :: OS Independent | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: C++ | ||
Programming Language :: Python :: 3.10 | ||
Intended Audience :: Science/Research | ||
Topic :: Scientific/Engineering :: Astronomy | ||
|
||
|
@@ -31,7 +29,9 @@ install_requires = | |
rich | ||
attrs | ||
bidict | ||
importlib_metadata; python_version<'3.8' | ||
scipy | ||
bottleneck | ||
numba | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
|
@@ -47,7 +47,7 @@ tests = | |
pytest-benchmark | ||
docs = | ||
sphinx>=3.2.1 | ||
sphinx_rtd_theme>=0.5.0 | ||
sphinx-book-theme | ||
pandoc | ||
ipython | ||
breathe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,2 @@ | ||
import os | ||
import sys | ||
import sysconfig | ||
import platform | ||
|
||
from setuptools import setup | ||
|
||
# Available at setup time due to pyproject.toml | ||
from pybind11.setup_helpers import Pybind11Extension, build_ext | ||
|
||
|
||
MACOS = sys.platform.startswith("darwin") | ||
TRIPLET = sysconfig.get_config_var("MULTIARCH") or "" # x86_64-linux-gnu | ||
BITS = platform.architecture()[0][:-3] | ||
|
||
|
||
def append_path(dirs_list, *args): | ||
entry = os.path.normpath(os.path.join(*args)) | ||
if os.path.isdir(entry): | ||
if entry not in dirs_list: | ||
dirs_list.append(entry) | ||
|
||
|
||
def get_include_dirs(): | ||
prefix_dirs = ["/usr", "/usr/local"] | ||
dirs = [] | ||
sys_include = sysconfig.get_config_var("INCLUDEDIR") | ||
if sys_include is not None: | ||
append_path(dirs, sys_include, TRIPLET) | ||
append_path(dirs, sys_include) | ||
for prefix in prefix_dirs: | ||
append_path(dirs, prefix, "include", TRIPLET) | ||
append_path(dirs, prefix, "include") | ||
return dirs | ||
|
||
|
||
def get_library_dirs(): | ||
prefix_dirs = ["/usr", "/usr/local"] | ||
dirs = [] | ||
sys_lib = sysconfig.get_config_var("LIBDIR") | ||
if sys_lib is not None: | ||
append_path(dirs, sys_lib, TRIPLET) | ||
append_path(dirs, sys_lib) | ||
for prefix in prefix_dirs: | ||
append_path(dirs, prefix, f"lib{BITS}") | ||
append_path(dirs, prefix, "lib", TRIPLET) | ||
append_path(dirs, prefix, "lib") | ||
return dirs | ||
|
||
|
||
def get_compile_flags(): | ||
cflags = ["-Wall", "-Wextra"] | ||
if MACOS: | ||
cflags += ["-Xpreprocessor", "-fopenmp"] | ||
else: | ||
cflags += ["-fopenmp"] | ||
return cflags | ||
|
||
|
||
def get_link_flags(): | ||
lflags = ["-lm"] | ||
if MACOS: | ||
lflags += ["-lomp"] | ||
else: | ||
lflags += ["-lgomp"] | ||
return lflags | ||
|
||
|
||
# The main interface is through Pybind11Extension. | ||
# * You can add cxx_std=11/14/17, and then build_ext can be removed. | ||
# * You can set include_pybind11=false to add the include directory yourself, | ||
# say from a submodule. | ||
# | ||
# Note: | ||
# Sort input source files if you glob sources to ensure bit-for-bit | ||
# reproducible builds (https://github.com/pybind/python_example/pull/53) | ||
|
||
ext_modules = [ | ||
Pybind11Extension( | ||
"sigpyproc.libcpp", | ||
sources=["sigpyproc/cpp/bindings.cpp"], | ||
include_dirs=get_include_dirs(), | ||
library_dirs=get_library_dirs(), | ||
extra_link_args=get_link_flags(), | ||
extra_compile_args=get_compile_flags(), | ||
), | ||
] | ||
|
||
setup( | ||
ext_modules=ext_modules, | ||
cmdclass={"build_ext": build_ext}, | ||
) | ||
import setuptools | ||
setuptools.setup() |