Skip to content

Commit

Permalink
Merge pull request #1349 from CQCL/release/1.27.0
Browse files Browse the repository at this point in the history
Release/1.27.0
  • Loading branch information
cqc-alec authored Apr 16, 2024
2 parents 4f68f92 + 7d79e1c commit 791e613
Show file tree
Hide file tree
Showing 133 changed files with 4,391 additions and 2,339 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build-with-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ jobs:
build_and_test:
strategy:
matrix:
os: ['ubuntu-22.04', 'macos-13-xlarge']
os: ['ubuntu-22.04', 'macos-14']
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/cachix-action@v14
with:
name: tket
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build and test tket
run: nix flake check -L
12 changes: 6 additions & 6 deletions .github/workflows/build-without-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ jobs:
- name: Install catch2
run: |
cd ${TMP_DIR}
wget https://github.com/catchorg/Catch2/archive/refs/tags/v3.5.2.tar.gz
tar xzvf v3.5.2.tar.gz
cd Catch2-3.5.2/
wget https://github.com/catchorg/Catch2/archive/refs/tags/v3.5.4.tar.gz
tar xzvf v3.5.4.tar.gz
cd Catch2-3.5.4/
mkdir build
cd build
cmake -GNinja -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
Expand All @@ -96,9 +96,9 @@ jobs:
- name: Install pybind11
run: |
cd ${TMP_DIR}
wget https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.tar.gz
tar xzvf v2.11.1.tar.gz
cd pybind11-2.11.1/
wget https://github.com/pybind/pybind11/archive/refs/tags/v2.12.0.tar.gz
tar xzvf v2.12.0.tar.gz
cd pybind11-2.12.0/
mkdir build
cd build
cmake -GNinja -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DPYBIND11_TEST=OFF ..
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
if: needs.check_changes.outputs.tket_or_workflow_changed == 'true'
strategy:
matrix:
os: ['ubuntu-22.04', 'macos-12', 'macos-13-xlarge']
os: ['ubuntu-22.04', 'macos-12', 'macos-14']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -330,7 +330,7 @@ jobs:
if: needs.check_changes.outputs.tket_or_workflow_changed == 'true' || needs.check_changes.outputs.pytket_or_workflow_changed == 'true'
strategy:
matrix:
os: ['macos-12', 'macos-13-xlarge']
os: ['macos-12', 'macos-14']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -401,10 +401,9 @@ jobs:
python -m pip install -r requirements.txt
python -m pytest --ignore=simulator/
- name: Check type stubs are up-to-date and run mypy
if: matrix.os == 'macos-13-xlarge' && (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch')
if: matrix.os == 'macos-14' && (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch')
run: |
python -m pip install -U mypy
python -m pip install pybind11-stubgen==2.3.6 # https://github.com/CQCL/tket/issues/1135
python -m pip install -U mypy pybind11-stubgen
cd pytket
./stub_generation/regenerate_stubs
git diff --quiet pytket/_tket && echo "Stubs are up-to-date" || exit 1 # fail if stubs change after regeneration
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
if: ${{ needs.changes.outputs.libs != '[]' && needs.changes.outputs.libs != '' }}
strategy:
matrix:
os: ['ubuntu-22.04', 'macos-12', 'windows-2022', 'macos-13-xlarge']
os: ['ubuntu-22.04', 'macos-12', 'windows-2022', 'macos-14']
lib: ${{ fromJson(needs.changes.outputs.libs) }}
build_type: ['Release', 'Debug']
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Build
strategy:
matrix:
os: ['ubuntu-22.04', 'macos-12', 'windows-2022', 'macos-13-xlarge']
os: ['ubuntu-22.04', 'macos-12', 'windows-2022', 'macos-14']
runs-on: ${{ matrix.os }}
steps:

Expand Down
40 changes: 21 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ jobs:
name: Linux_aarch64_3.${{ matrix.python3-version }}_wheel
path: wheelhouse/

build_macos_wheels:
name: Build macos wheels
build_macos_x86_wheels:
name: Build macos x86 wheels
runs-on: macos-12
strategy:
matrix:
Expand Down Expand Up @@ -101,12 +101,12 @@ jobs:
delocate-wheel -v -w "$GITHUB_WORKSPACE/wheelhouse/" "dist/pytket-"*".whl"
- uses: actions/upload-artifact@v4
with:
name: MacOS_${{ matrix.python-version }}_wheel
name: MacOS_x86_${{ matrix.python-version }}_wheel
path: wheelhouse/

build_macos_M1_wheels:
name: Build macos (M1) wheels
runs-on: macos-13-xlarge
build_macos_arm64_wheels:
name: Build macos arm64 wheels
runs-on: macos-14
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
Expand All @@ -125,7 +125,7 @@ jobs:
run: |
conan profile detect
DEFAULT_PROFILE_PATH=`conan profile path default`
PROFILE_PATH=./conan-profiles/macos-13-xlarge
PROFILE_PATH=./conan-profiles/macos-14
diff ${DEFAULT_PROFILE_PATH} ${PROFILE_PATH} || true
cp ${PROFILE_PATH} ${DEFAULT_PROFILE_PATH}
conan remote add tket-libs https://quantinuumsw.jfrog.io/artifactory/api/conan/tket1-libs --index 0
Expand All @@ -138,12 +138,13 @@ jobs:
cd pytket
# Ensure wheels are compatible with MacOS 12.0 and later:
export WHEEL_PLAT_NAME=macosx_12_0_arm64
python${{ matrix.python-version }} -m pip install -U pip build delocate
python${{ matrix.python-version }} -m pip install -U pip build
python${{ matrix.python-version }} -m pip install delocate~=0.10.7
python${{ matrix.python-version }} -m build
delocate-wheel -v -w "$GITHUB_WORKSPACE/wheelhouse/" "dist/pytket-"*".whl"
- uses: actions/upload-artifact@v4
with:
name: MacOS_M1_${{ matrix.python-version }}_wheel
name: MacOS_arm64_${{ matrix.python-version }}_wheel
path: wheelhouse/

build_Windows_wheels:
Expand Down Expand Up @@ -252,9 +253,9 @@ jobs:
- name: Run tests
run: cd tket/pytket/tests && pytest --ignore=simulator/

test_macos_wheels:
name: Test macos wheels
needs: build_macos_wheels
test_macos_x86_wheels:
name: Test macos x86 wheels
needs: build_macos_x86_wheels
strategy:
matrix:
os: ['macos-12', 'macos-13']
Expand All @@ -268,7 +269,7 @@ jobs:
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: MacOS_${{ matrix.python-version }}_wheel
name: MacOS_x86_${{ matrix.python-version }}_wheel
path: wheelhouse/
- uses: actions/checkout@v4
with:
Expand All @@ -282,13 +283,14 @@ jobs:
pip install -r requirements.txt
pytest --ignore=simulator/
test_macos_M1_wheels:
name: Test macos (M1) wheels
needs: build_macos_M1_wheels
runs-on: macos-13-xlarge
test_macos_arm64_wheels:
name: Test macos arm64 wheels
needs: build_macos_arm64_wheels
strategy:
matrix:
os: ['macos-13-xlarge', 'macos-14']
python-version: ['3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand All @@ -297,7 +299,7 @@ jobs:
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: MacOS_M1_${{ matrix.python-version }}_wheel
name: MacOS_arm64_${{ matrix.python-version }}_wheel
path: wheelhouse/
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -344,7 +346,7 @@ jobs:
publish_to_pypi:
name: Publish to pypi
if: github.event_name == 'release'
needs: [test_linux_wheels, test_linux_aarch64_wheels, test_macos_wheels, test_macos_M1_wheels, test_Windows_wheels]
needs: [test_linux_wheels, test_linux_aarch64_wheels, test_macos_x86_wheels, test_macos_arm64_wheels, test_Windows_wheels]
runs-on: ubuntu-22.04
steps:
- name: Download all wheels
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04', 'macos-12', 'windows-2022', 'macos-13-xlarge']
os: ['ubuntu-22.04', 'macos-12', 'windows-2022', 'macos-14']
lib: ${{ fromJson(needs.set_libs_matrix.outputs.libs) }}
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_libs_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: test library
strategy:
matrix:
os: ['ubuntu-22.04', 'macos-12', 'windows-2022', 'macos-13-xlarge']
os: ['ubuntu-22.04', 'macos-12', 'windows-2022', 'macos-14']
lib: ['tklog', 'tkassert', 'tkrng', 'tktokenswap', 'tkwsm']
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ pytket/tests/qasm_test_files/testout6.qasm

#nix
result
.envrc
.direnv/
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,13 @@ building and testing pytket.
Tket and pytket are available as a Nix flake, with support for Linux and Apple Silicon systems.
See the [README](nix-support/README.md) in the `nix-support` directory for instructions
on building and testing tket and pytket through Nix, and on how to use it within a Nix project.

To launch into a tket environment, you can use

```
nix develop github:CQCL/tket
```

We use Cachix to cache pre-built artifacts, which provides a faster install time for nix users.
To make use of this cache, enable our cachix substituter with `cachix use tket`, or enter a
tket nix environment from a trusted user and confirm the use of the tket.cachix.org substituter.
12 changes: 6 additions & 6 deletions build-without-conan.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ cmake --install .

```
cd ${TMP_DIR}
wget https://github.com/catchorg/Catch2/archive/refs/tags/v3.5.2.tar.gz
tar xzvf v3.5.2.tar.gz
cd Catch2-3.5.2/
wget https://github.com/catchorg/Catch2/archive/refs/tags/v3.5.4.tar.gz
tar xzvf v3.5.4.tar.gz
cd Catch2-3.5.4/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
Expand All @@ -119,9 +119,9 @@ cmake --install .

```
cd ${TMP_DIR}
wget https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.tar.gz
tar xzvf v2.11.1.tar.gz
cd pybind11-2.11.1/
wget https://github.com/pybind/pybind11/archive/refs/tags/v2.12.0.tar.gz
tar xzvf v2.12.0.tar.gz
cd pybind11-2.12.0/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DPYBIND11_TEST=OFF ..
Expand Down
2 changes: 1 addition & 1 deletion conan-profiles/macos-13-xlarge → conan-profiles/macos-14
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=14
compiler.version=15
os=Macos
8 changes: 0 additions & 8 deletions conan-profiles/macos-armv8-clang14

This file was deleted.

12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
description = "Tket Quantum SDK";
nixConfig.extra-substituters = "https://tket.cachix.org https://cache.nixos.org";
nixConfig.trusted-public-keys = ''
tket.cachix.org-1:ACdm5Zg19qPL0PpvUwTPPiIx8SEUy+D/uqa9vKJFwh0=
cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
'';
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
Expand Down
2 changes: 1 addition & 1 deletion libs/tkassert/test/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ def package(self):

def requirements(self):
self.requires("tkassert/0.3.4")
self.requires("catch2/3.5.2")
self.requires("catch2/3.5.4")
2 changes: 1 addition & 1 deletion libs/tklog/test/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ def package(self):

def requirements(self):
self.requires("tklog/0.3.3")
self.requires("catch2/3.5.2")
self.requires("catch2/3.5.4")
2 changes: 1 addition & 1 deletion libs/tkrng/test/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ def package(self):

def requirements(self):
self.requires("tkrng/0.3.3")
self.requires("catch2/3.5.2")
self.requires("catch2/3.5.4")
2 changes: 1 addition & 1 deletion libs/tktokenswap/test/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ def package(self):
def requirements(self):
self.requires("tktokenswap/0.3.7")
self.requires("tkrng/0.3.3@tket/stable")
self.requires("catch2/3.5.2")
self.requires("catch2/3.5.4")
2 changes: 1 addition & 1 deletion libs/tkwsm/test/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ def requirements(self):
self.requires("tkwsm/0.3.7")
self.requires("tkassert/0.3.4@tket/stable")
self.requires("tkrng/0.3.3@tket/stable")
self.requires("catch2/3.5.2")
self.requires("catch2/3.5.4")
Loading

0 comments on commit 791e613

Please sign in to comment.