Skip to content

Commit 6b8dbac

Browse files
authored
Fix clobbering with multi-backend packaging (#504)
* update dev version * anti-clobbering maneuver * update changelog * fix backend installation for tests without binary
1 parent 67aaaf6 commit 6b8dbac

File tree

4 files changed

+29
-17
lines changed

4 files changed

+29
-17
lines changed

.github/CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
### Breaking changes
99

10-
* Cast integral-valued arrays to the device's complex type on entry in `_preprocess_state_vector` to ensure the state is correctly represented with floating-point numbers.
10+
* Cast integral-valued arrays to the device's complex type on entry in `_preprocess_state_vector` to ensure the state is correctly represented with floating-point numbers.
1111
[(#501)](https://github.com/PennyLaneAI/pennylane-lightning/pull/501)
1212

1313
* Update DefaultQubit to DefaultQubitLegacy on Lightning fallback.
@@ -21,6 +21,9 @@
2121

2222
### Improvements
2323

24+
* Update setup.py to allow for multi-package co-existence. The PennyLane_Lightning package now is the responsible for the core functionality, and will be depended upon by all other extensions.
25+
[(#504)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/504)
26+
2427
* Refactor LKokkos `StateVectorKokkos` class to use Kokkos `RangePolicy` together with special functors in `applyMultiQubitOp` to apply 1- to 4-wire generic unitary gates. For more than 4 wires, the general implementation using Kokkos `TeamPolicy` is employed to yield the best all-around performance.
2528
[(#490)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/490)
2629

.github/workflows/tests_without_binary.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ jobs:
3737
cd main
3838
python -m pip install -r requirements-dev.txt
3939
40-
- name: Install lightning.qubit device
40+
- name: Install the pennylane_lightning package
41+
if: ${{ matrix.pl_backend == 'lightning_kokkos'}}
42+
run: |
43+
cd main
44+
SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv
45+
46+
- name: Install backend device
4147
env:
4248
SKIP_COMPILATION: True
4349
PL_BACKEND: ${{ matrix.pl_backend }}
4450
run: |
4551
cd main
4652
python -m pip install -e . -vv
4753
48-
- name: Install the new pennylane_lightning package
49-
if: ${{ matrix.pl_backend == 'lightning_kokkos'}}
50-
run: |
51-
cd main
52-
SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv
53-
5454
- name: Run PennyLane-Lightning unit tests
5555
run: |
5656
cd main/

pennylane_lightning/core/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
Version number (major.minor.patch[-label])
1717
"""
1818

19-
__version__ = "0.33.0-dev11"
19+
__version__ = "0.33.0-dev12"

setup.py

+17-8
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ def build_extension(self, ext: CMakeExtension):
171171
"pennylane>=0.32",
172172
]
173173

174+
packages_list = ['pennylane_lightning.'+backend]
175+
176+
if backend == "lightning_qubit":
177+
packages_list += ['pennylane_lightning.core']
178+
else:
179+
requirements += ["pennylane_lightning=="+version]
180+
174181
suffix = backend.replace("lightning_", "")
175182
suffix = suffix[0].upper() + suffix[1:]
176183

@@ -185,14 +192,7 @@ def build_extension(self, ext: CMakeExtension):
185192
"maintainer_email": "[email protected]",
186193
"url": "https://github.com/XanaduAI/pennylane-lightning",
187194
"license": "Apache License 2.0",
188-
"packages": find_namespace_packages(include=['pennylane_lightning.core',
189-
'pennylane_lightning.'+backend]),
190-
"package_data": {
191-
'pennylane_lightning.core': [
192-
os.path.join("src", "*"),
193-
os.path.join("src", "**", "*"),
194-
]
195-
},
195+
"packages": find_namespace_packages(include=packages_list),
196196
"include_package_data": True,
197197
"entry_points": {"pennylane.plugins": pennylane_plugins},
198198
"description": "PennyLane-Lightning plugin",
@@ -206,6 +206,15 @@ def build_extension(self, ext: CMakeExtension):
206206
"ext_package": "pennylane_lightning",
207207
}
208208

209+
if backend == "lightning_qubit":
210+
info = info | {
211+
"package_data": {
212+
'pennylane_lightning.core': [
213+
os.path.join("src", "*"),
214+
os.path.join("src", "**", "*"),
215+
]
216+
},}
217+
209218
classifiers = [
210219
"Development Status :: 4 - Beta",
211220
"Environment :: Console",

0 commit comments

Comments
 (0)