Skip to content

Commit b0e733d

Browse files
authored
Fix packaging version (#276)
* Fix packaging version * Also print tiledb-vector-search version in CI/CD * Remove .git from sdist * Rework config file regeneration
1 parent 64d4194 commit b0e733d

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

.github/workflows/ci-python.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ jobs:
4040
env:
4141
TILEDB_REST_TOKEN: ${{ secrets.TILEDB_CLOUD_HELPER_VAR }}
4242
shell: bash -el {0}
43+
- name: Check tiledb-vector-search version
44+
run: |
45+
python -c "from tiledb.vector_search.version import version; print(version)"

pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,19 @@ wheel.expand-macos-universal-tags = true
4141
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
4242
cmake.source-dir = "src"
4343
cmake.targets = ["skbuild-export"]
44-
# TODO: This should be removed, but currently can't bacause: 'src/src/CMakeLists.txt'
4544
sdist.include = [
46-
".git"
45+
"apis/python/src/tiledb/vector_search/version.py",
46+
"src/config.h"
47+
]
48+
sdist.exclude = [
49+
".github"
4750
]
4851
wheel.packages = ["apis/python/src/tiledb"]
52+
# We need to run cmake during packaging step in order to generate src/config.h and
53+
# thus not including .git to generate it later
54+
sdist.cmake = true
4955

5056
[tool.scikit-build.cmake.define]
51-
#GIT_REPO_NAME = "placeholder"
5257
TILEDB_VS_PYTHON = "ON"
5358

5459
[tool.setuptools_scm]

src/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ include(nlohmann_json)
175175
include (logging)
176176

177177
# Write config file
178-
configure_file(${CMAKE_SOURCE_DIR}/include/config.h.in config.h)
178+
if(LOGGING_INFO_QUERIED)
179+
configure_file(${CMAKE_SOURCE_DIR}/include/config.h.in ${CMAKE_SOURCE_DIR}/config.h)
180+
endif()
179181

180182
# -----------------------------------------------------------------------------
181183
# Interface libraries

src/cmake/logging.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
if(EXISTS ${CMAKE_SOURCE_DIR}/../.git)
22

33
# Get the current date and time
44
string(TIMESTAMP CURRENT_DATETIME "%Y-%m-%d %H:%M:%S")
@@ -58,3 +58,9 @@ execute_process(
5858
)
5959

6060
get_filename_component(IVF_HACK_CXX_COMPILER ${CMAKE_CXX_COMPILER} NAME)
61+
62+
set(LOGGING_INFO_QUERIED True)
63+
64+
elseif(NOT EXISTS ${CMAKE_SOURCE_DIR}/config.h)
65+
message(FATAL_ERROR ".git or pre generated config.h is required")
66+
endif()

0 commit comments

Comments
 (0)