diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 27f87c6638..a3acaba0e3 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -131,6 +131,9 @@ ### Bug fixes +* Fix `liblightning_kokkos_catalyst.so` not copied to correct build path for editable installation. + [(#968)](https://github.com/PennyLaneAI/pennylane-lightning/pull/968) + * Fix PTM stable latest related to `default.qubit.legacy`. [(#966)](https://github.com/PennyLaneAI/pennylane-lightning/pull/966) @@ -156,7 +159,7 @@ This release contains contributions from (in alphabetical order): -Ali Asadi, Amintor Dusko, Luis Alfredo Nuñez Meneses, Vincent Michaud-Rioux, Lee J. O'Riordan, Mudit Pandey, Shuli Shu, Haochen Paul Wang +Ali Asadi, Amintor Dusko, Joseph Lee, Luis Alfredo Nuñez Meneses, Vincent Michaud-Rioux, Lee J. O'Riordan, Mudit Pandey, Shuli Shu, Haochen Paul Wang --- diff --git a/.github/workflows/tests_lkcpu_python.yml b/.github/workflows/tests_lkcpu_python.yml index 6b55a9e734..909831aa83 100644 --- a/.github/workflows/tests_lkcpu_python.yml +++ b/.github/workflows/tests_lkcpu_python.yml @@ -264,6 +264,17 @@ jobs: pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append mv .coverage ${{ github.workspace }}/.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.group }} + - name: Test editable install + run: | + rm -r build + pip uninstall pennylane-lightning pennylane-lightning-kokkos -y + python scripts/configure_pyproject_toml.py + SKIP_COMPILATION=True python -m pip install -e . --config-settings editable_mode=compat + DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` + PL_BACKEND=${DEVICENAME} python scripts/configure_pyproject_toml.py + python -m pip install -e . --config-settings editable_mode=compat -vv + PL_DEVICE=${DEVICENAME} python -m pytest tests/test_device.py $COVERAGE_FLAGS + - name: Upload test durations uses: actions/upload-artifact@v4 with: diff --git a/pennylane_lightning/lightning_kokkos/lightning_kokkos.py b/pennylane_lightning/lightning_kokkos/lightning_kokkos.py index b30ca1ad21..42a27e969e 100644 --- a/pennylane_lightning/lightning_kokkos/lightning_kokkos.py +++ b/pennylane_lightning/lightning_kokkos/lightning_kokkos.py @@ -534,7 +534,7 @@ def get_c_interface(): # lib.--" # To avoid mismatching the folder name, we search for the shared object instead. # TODO: locate where the naming convention of the folder is decided and replicate it here. - editable_mode_path = package_root.parent.parent / "build" + editable_mode_path = package_root.parent.parent / "build_lightning_kokkos" for path, _, files in os.walk(editable_mode_path): if lib_name in files: lib_location = (Path(path) / lib_name).as_posix() diff --git a/setup.py b/setup.py index 0ef706955f..048219ed2b 100644 --- a/setup.py +++ b/setup.py @@ -161,7 +161,7 @@ def build_extension(self, ext: CMakeExtension): if platform.system() in ["Linux", "Darwin"]: shared_lib_ext = {"Linux": ".so", "Darwin": ".dylib"}[platform.system()] source = os.path.join(f"{extdir}", f"lib{backend}_catalyst{shared_lib_ext}") - destination = os.path.join(os.getcwd(), "build") + destination = os.path.join(os.getcwd(), self.build_temp) shutil.copy(source, destination) with open(os.path.join("pennylane_lightning", "core", "_version.py"), encoding="utf-8") as f: