Skip to content

Commit

Permalink
Move vectorlite_py to bindings folder (1yefuwang1#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
1yefuwang1 authored Jul 30, 2024
1 parent 40fa64b commit 70fbaa4
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ set_target_properties(vectorlite PROPERTIES PREFIX "")
target_include_directories(vectorlite PUBLIC ${RAPIDJSON_INCLUDE_DIRS} ${HNSWLIB_INCLUDE_DIRS} ${PROJECT_BINARY_DIR})
target_link_libraries(vectorlite PRIVATE unofficial::sqlite3::sqlite3 absl::status absl::statusor absl::strings re2::re2)
# copy the shared library to the python package to make running integration tests easier
add_custom_command(TARGET vectorlite POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:vectorlite> ${PROJECT_SOURCE_DIR}/vectorlite_py/$<TARGET_FILE_NAME:vectorlite>)
add_custom_command(TARGET vectorlite POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:vectorlite> ${PROJECT_SOURCE_DIR}/bindings/python/vectorlite_py/$<TARGET_FILE_NAME:vectorlite>)

include(GoogleTest)
enable_testing()
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ conn.close()

```

More examples can be found in examples and integration_test folder.
More examples can be found in examples and bindings/python/vectorlite_py/test folder.

# Build Instructions
If you want to contribute or compile vectorlite for your own platform, you can follow following instructions to build it.
Expand All @@ -262,7 +262,7 @@ git clone --recurse-submodules [email protected]:1yefuwang1/vectorlite.git

python3 bootstrap_vcpkg.py

# install dependencies for running integration tests
# install dependencies for running python tests
python3 -m pip install -r requirements-dev.txt

sh build.sh # for debug build
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@ def remove_quote(s: str):
file_path = os.path.join(tempdir, 'index.bin')
file_paths = [f'\"{file_path}\"', f'\'{file_path}\'']

# Windows paths always contain ':', which must be quoted by double/single quotes
# Unix paths don't necessarliy contain special charactors that needs to be quoted.
if platform.system().lower() != 'windows':
file_paths.append(file_path)

for index_file_path in file_paths:
assert not os.path.exists(remove_quote(index_file_path))

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cmake --preset dev && cmake --build build/dev -j8 && ctest --test-dir build/dev --output-on-failure && pytest vectorlite_py/test
cmake --preset dev && cmake --build build/dev -j8 && ctest --test-dir build/dev --output-on-failure && pytest bindings/python/vectorlite_py/test
2 changes: 1 addition & 1 deletion build_release.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cmake --preset release && cmake --build build/release -j8 && ctest --test-dir build/release --output-on-failure && pytest vectorlite_py/test
cmake --preset release && cmake --build build/release -j8 && ctest --test-dir build/release --output-on-failure && pytest bindings/python/vectorlite_py/test
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
test-requires = ["pytest", "numpy", "apsw>=3.46"]
test-command = "pytest {project}/integration_test/python/test"
# --import-mode=importlib forces pytest to use installed packages instead of the local source code
test-command = "pytest --import-mode=importlib {project}/bindings/python/vectorlite_py/test"
skip = ["*-win32", "*-win_arm64", "*-manylinux_i686", "*musllinux*", "pp*", "cp36*", "cp37*", "cp38*", "cp39*"]

[tool.cibuildwheel.macos]
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def get_tag(self):
license='Apache License, Version 2.0',
version=VERSION,
packages=['vectorlite_py'],
package_dir={
'vectorlite_py': 'bindings/python/vectorlite_py'
},
# package_data={"vectorlite_py": ['*.so', '*.dylib', '*.dll']},
install_requires=[],
ext_modules=[CMakeExtension('vectorlite')],
Expand Down
1 change: 0 additions & 1 deletion vectorlite_py/test

This file was deleted.

0 comments on commit 70fbaa4

Please sign in to comment.