Skip to content

Commit

Permalink
Expand testing to cover Python 3.11 (#361)
Browse files Browse the repository at this point in the history
Further replaces `PurePath.relative_to` as the `walk_up` parameter was
added with Python 3.12 and the old behavior defaults to `False`.

Progress on #357
  • Loading branch information
marbre authored Oct 29, 2024
1 parent 652c5ed commit d8f39a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci_linux_x64-libshortfin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.11", "3.12"]

steps:
- name: Install dependencies
Expand Down Expand Up @@ -67,10 +70,10 @@ jobs:
git submodule update --init --depth 1 -- third_party/googletest
git submodule update --init --depth 1 -- third_party/hip-build-deps/
- name: Setup Python
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.12"
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install Python packages
# TODO: Switch to `pip install -r requirements.txt -e shortfin/`.
Expand Down
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 d8f39a9

Please sign in to comment.