Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ jobs:
\$ErrorActionPreference = 'Stop'
\$PSNativeCommandUseErrorActionPreference = \$true

# Create a symbolic link to work around path length limitations. This gives a much shorter
# path, as the default checkout directory is deeply nested.
\$workingDir = \$PWD.Path
cd \$Env:GITHUB_WORKSPACE
New-Item -ItemType SymbolicLink -Path tk -Value \$workingDir
cd tk

# Run C++ unit tests
cmake -DCMAKE_BUILD_TYPE=Debug test -Bbuild/test -T ClangCL
cmake --build build/test -j9 --config Debug
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import os
import re
import shutil
import subprocess
import sys
import shutil
from pathlib import Path

from setuptools import Extension, find_packages, setup
Expand Down Expand Up @@ -53,6 +53,7 @@ def build_extension(self, ext): # noqa C901
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON",
]
build_args = ["--target", "pytorch_tokenizers_cpp"]
build_tool_args: list[str] = []

# Use Clang for Windows builds.
if sys.platform == "win32":
Expand Down Expand Up @@ -82,6 +83,7 @@ def build_extension(self, ext): # noqa C901
pass

else:
build_tool_args = ["--", "/p:TrackFileAccess=false"]
# Single config generators are handled "normally"
single_config = any(x in cmake_generator for x in {"NMake", "Ninja"})

Expand Down Expand Up @@ -124,7 +126,9 @@ def build_extension(self, ext): # noqa C901
["cmake", ext.sourcedir] + cmake_args, cwd=build_temp, check=True
)
subprocess.run(
["cmake", "--build", "."] + build_args, cwd=build_temp, check=True
["cmake", "--build", "."] + build_args + build_tool_args,
cwd=build_temp,
check=True,
)


Expand Down