Skip to content

Commit

Permalink
Merge pull request #44 from vikshiv/main
Browse files Browse the repository at this point in the history
change python library to [d]igest
  • Loading branch information
vikshiv authored Jan 3, 2025
2 parents 3c16f70 + 10899e6 commit c19b62c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 37 deletions.
4 changes: 2 additions & 2 deletions pybind/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace py = pybind11;

PYBIND11_MODULE(Digest, m) {
m.doc() = "bindings for Digest";
PYBIND11_MODULE(digest, m) {
m.doc() = "bindings for digest";
m.def("window_minimizer", &window_minimizer,
"A function that runs window minimizer digestion", py::arg("seq"),
py::arg("k") = 31, py::arg("w") = 11,
Expand Down
37 changes: 2 additions & 35 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __str__(self):
return pybind11.get_include()

digest = Pybind11Extension(
"Digest",
"digest",
sources = ['pybind/bindings.cpp'],
include_dirs = [
'build/include',
Expand All @@ -38,46 +38,13 @@ def __str__(self):
extra_compile_args=['-std=c++17', '-fPIC']
)

# class MesonBuildExt(build_ext):
# def run(self):
# # Check for Meson and Ninja installation
# try:
# subprocess.check_output(['meson', '--version'])
# except FileNotFoundError:
# raise RuntimeError("Meson must be installed to build the extensions")

# try:
# subprocess.check_output(['ninja', '--version'])
# except FileNotFoundError:
# raise RuntimeError("Ninja must be installed to build the extensions")

# def build_extension(self):
# build_temp = os.path.abspath(self.build_temp)
# # ext_fullpath = self.get_ext_fullpath(ext.name)
# # ext_dir = os.path.abspath(os.path.dirname(ext_fullpath))
# ext_dir = os.path.abspath(os.path.join(ROOT_DIR, 'build'))
# meson_build_dir = os.path.join(build_temp, 'meson_build')

# # Create build directory if it doesn't exist
# if not os.path.exists(meson_build_dir):
# os.makedirs(meson_build_dir)

# meson_args = [
# 'meson', 'setup', '--prefix', ext_dir,
# '--buildtype=release', meson_build_dir
# ]

# subprocess.check_call(meson_args)
# subprocess.check_call(['meson', 'install', '-C', meson_build_dir])

setup(
name = 'Digest',
name = 'digest',
version = '0.2',
python_requires=">=3.8",
setup_requires=['setuptools', 'pybind11>=2.6.0', 'meson','ninja'],
install_requires=['pybind11>=2.6.0'],
packages=find_packages(),
ext_modules = [digest],
include_package_data=True,
# cmdclass={'build_ext': MesonBuildExt},
)

0 comments on commit c19b62c

Please sign in to comment.