Skip to content

Commit

Permalink
Fix Python compiled module linkage and path under Windows (#400)
Browse files Browse the repository at this point in the history
* Create v0.28.1 RC

* Create release tag

* Update Changelog

* Fix Python modules and locations for Windows wheels.

* Remove local pip install

* Temp enable wheel cahcing for Windows

* Update for release [no ci]

* Modify for merging to master
  • Loading branch information
mlxd authored Jan 11, 2023
1 parent b8213b6 commit 8e34f48
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 9 deletions.
15 changes: 13 additions & 2 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,21 @@

### Contributors

---

# Release 0.28.1

### Bug fixes

* Fix Pybind11 module versioning and locations for Windows wheels.
[(#400)](https://github.com/PennyLaneAI/pennylane-lightning/pull/400)

### Contributors

This release contains contributions from (in alphabetical order):

Lee J. O'Riordan

---

# Release 0.28.0
Expand All @@ -31,8 +44,6 @@ This release contains contributions from (in alphabetical order):
* Improve the stopping condition method.
[(#386)](https://github.com/PennyLaneAI/pennylane-lightning/pull/386)

### Documentation

### Bug fixes

- Pin CMake to 3.24.x in wheel-builder to avoid Python not found error in CMake 3.25, when building wheels for PennyLane-Lightning-GPU.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post_release_version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ jobs:
title: Version Bump
body: updated changelog and _version.py
branch: post-release-version-bump
reviewers: antalszava
reviewers: mlxd
base: master
24 changes: 22 additions & 2 deletions .github/workflows/wheel_win_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
-Destination "D:\a\pennylane-lightning\pennylane-lightning\Kokkos" -Recurse -Force
- name: Install cibuildwheel
run: python -m pip install cibuildwheel~=2.11.0
run: python -m pip install cibuildwheel~=2.11.0 wheel

- name: Build wheels
env:
Expand All @@ -145,7 +145,7 @@ jobs:

# Python build settings
CIBW_BEFORE_BUILD: |
pip install pybind11 cmake~=3.24.0
pip install pybind11 cmake~=3.24.0 build
# Testing of built wheels
CIBW_TEST_REQUIRES: numpy~=1.21 scipy pytest pytest-cov pytest-mock flaky
Expand All @@ -160,8 +160,28 @@ jobs:

CIBW_BUILD_VERBOSITY: 3

CIBW_BUILD_FRONTEND: build

run: python -m cibuildwheel --output-dir wheelhouse

- name: Patch wheels
run: |
cd wheelhouse
$wheels = Get-ChildItem "./" -Filter *.whl
foreach ($i in $wheels){
python -m wheel unpack $i.Name
$name = $i.Name
$dirName = python -c "s = '$name'; print('-'.join(s.split('-')[0:2]))"
if (Test-Path -Path $dirName\pennylane_lightning\RelWithDebInfo) {
Move-Item -Path $dirName\pennylane_lightning\RelWithDebInfo\* -Destination $dirName\pennylane_lightning
Remove-Item $dirName\pennylane_lightning\RelWithDebInfo -Recurse
python -m wheel pack $dirName
echo "Patched $name"
}
Remove-Item $dirName -Recurse
}
cd ..
- uses: actions-ecosystem/action-regex-match@v2
id: rc_build
with:
Expand Down
3 changes: 1 addition & 2 deletions pennylane_lightning/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
Version number (major.minor.patch[-label])
"""


__version__ = "0.29.0-dev"
__version__ = "0.29.0-dev0"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def build_extension(self, ext: CMakeExtension):
# Set Python_EXECUTABLE instead if you use PYBIND11_FINDPYTHON
configure_args = [
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}",
f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DPython_EXECUTABLE={sys.executable}",
"-DENABLE_WARNINGS=OFF", # Ignore warnings
]

Expand Down Expand Up @@ -115,7 +115,7 @@ def build_extension(self, ext: CMakeExtension):
requirements = [
"ninja",
"numpy",
"pennylane>=0.19",
"pennylane>=0.28",
]

info = {
Expand Down

0 comments on commit 8e34f48

Please sign in to comment.