Skip to content

Commit

Permalink
Replace PurePath.relative_to
Browse files Browse the repository at this point in the history
The `walk_up` paramter was added with Python 3.12.
  • Loading branch information
marbre committed Oct 29, 2024
1 parent 848c19c commit abb8ae8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions shortfin/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ def is_cpp_prebuilt():

# Due to a quirk of setuptools, that package_dir map must only contain
# paths relative to the directory containing setup.py. Why? No one knows.
REL_SOURCE_DIR = SOURCE_DIR.relative_to(SETUPPY_DIR, walk_up=True)
REL_BINARY_DIR = BINARY_DIR.relative_to(SETUPPY_DIR, walk_up=True)
REL_CMAKE_DEFAULT_BUILD_DIR = CMAKE_DEFAULT_BUILD_DIR.relative_to(
SETUPPY_DIR, walk_up=True
REL_SOURCE_DIR = Path(os.path.relpath(SOURCE_DIR, SETUPPY_DIR))
REL_BINARY_DIR = Path(os.path.relpath(BINARY_DIR, SETUPPY_DIR))
REL_CMAKE_DEFAULT_BUILD_DIR = Path(
os.path.relpath(CMAKE_DEFAULT_BUILD_DIR, SETUPPY_DIR)
)
REL_CMAKE_TRACY_BUILD_DIR = CMAKE_TRACY_BUILD_DIR.relative_to(SETUPPY_DIR, walk_up=True)
REL_CMAKE_TRACY_BUILD_DIR = Path(os.path.relpath(CMAKE_TRACY_BUILD_DIR, SETUPPY_DIR))


class CMakeExtension(Extension):
Expand Down

0 comments on commit abb8ae8

Please sign in to comment.