Skip to content

Commit 82edabe

Browse files
committed
Try again
1 parent 6797b13 commit 82edabe

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

.github/workflows/pull.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
3131
# Install tokenizers
3232
pip install . -v
33+
pip install pytest
3334
3435
# Run tests
3536
pytest

.github/workflows/trunk.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
3838
# Install tokenizers
3939
${CONDA_RUN} pip install . -v
40+
${CONDA_RUN} pip install pytest
41+
4042
4143
# Run tests
4244
${CONDA_RUN} pytest

CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,13 @@ if(TOKENIZERS_BUILD_PYTHON)
142142
# Set properties for the Python extension
143143
target_compile_definitions(pytorch_tokenizers_cpp PRIVATE VERSION_INFO=${PROJECT_VERSION})
144144

145-
# Set the output name and location
145+
# Set the output name - let setuptools handle the output directory
146146
set_target_properties(pytorch_tokenizers_cpp PROPERTIES
147147
OUTPUT_NAME "pytorch_tokenizers_cpp"
148148
)
149149

150-
# Install the Python extension
151-
install(TARGETS pytorch_tokenizers_cpp
152-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
153-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
154-
)
150+
# Don't install the Python extension here - let setuptools handle it
151+
# The install() command is not needed for Python extensions built via setuptools
155152
endif()
156153

157154
# Installation rules

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class CMakeBuild(build_ext):
2929
def build_extension(self, ext):
3030
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
3131

32+
# Ensure the extension goes into the pytorch_tokenizers package directory
33+
extdir = os.path.join(extdir, "pytorch_tokenizers")
34+
3235
# Required for auto-detection & inclusion of auxiliary "native" libs
3336
if not extdir.endswith(os.path.sep):
3437
extdir += os.path.sep

0 commit comments

Comments
 (0)