Skip to content

Commit

Permalink
Merge pull request #1248 from CQCL/release/1.25.0
Browse files Browse the repository at this point in the history
Release/1.25.0
  • Loading branch information
cqc-alec authored Feb 12, 2024
2 parents 273c558 + f3edf41 commit 0ec6039
Show file tree
Hide file tree
Showing 31 changed files with 547 additions and 231 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-without-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
- name: Install boost
run: |
cd ${TMP_DIR}
wget -O boost_1_83_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.gz/download
tar xzvf boost_1_83_0.tar.gz
cd boost_1_83_0/
wget -O boost_1_84_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.84.0/boost_1_84_0.tar.gz/download
tar xzvf boost_1_84_0.tar.gz
cd boost_1_84_0/
./bootstrap.sh --prefix=${INSTALL_DIR}
./b2
./b2 install
Expand Down 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.1.tar.gz
tar xzvf v3.5.1.tar.gz
cd Catch2-3.5.1/
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/
mkdir build
cd build
cmake -GNinja -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
Expand Down
40 changes: 14 additions & 26 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: dorny/paths-filter@v2.11.1
- uses: dorny/paths-filter@v3.0.0
id: filter
with:
base: ${{ github.ref }}
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
with:
format: YYYYMMDDHHmmss
- name: ccache windows
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.ninja-ccache-setup.outputs.ccache_dir }}
key: tket-static-${{ matrix.os }}-${{ steps.current_time.outputs.formattedTime }}
Expand Down Expand Up @@ -279,10 +279,10 @@ jobs:
cd pytket
pip install -e .[ZX] -v
- name: Build pytket
if: github.event_name == 'schedule' # https://github.com/CQCL/tket/issues/1200
if: github.event_name == 'schedule' # https://github.com/CQCL/tket/issues/1242
run: |
cd pytket
pip install -e -v
pip install -e . -v
- name: Run doctests
run: |
cd pytket
Expand Down Expand Up @@ -387,34 +387,28 @@ jobs:
with:
python-version: '3.12'
- name: Build pytket
if: github.event_name != 'schedule'
run: |
cd pytket
python${{ matrix.python-version }} -m pip install -e .[ZX] -v
- name: Build pytket
if: github.event_name == 'schedule' # https://github.com/CQCL/tket/issues/1200
run: |
cd pytket
python${{ matrix.python-version }} -m pip install -e -v
python -m pip install -e .[ZX] -v
- name: Run doctests
run: |
cd pytket
python${{ matrix.python-version }} -m pip install pytest
python${{ matrix.python-version }} -m pytest --doctest-modules pytket
python -m pip install pytest
python -m pytest --doctest-modules pytket
- name: Test pytket
run: |
cd pytket/tests
python${{ matrix.python-version }} -m pip install -r requirements.txt
python${{ matrix.python-version }} -m pytest --ignore=simulator/
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')
run: |
python${{ matrix.python-version }} -m pip install -U mypy
python${{ matrix.python-version }} -m pip install pybind11-stubgen==2.3.6 # https://github.com/CQCL/tket/issues/1135
python -m pip install -U mypy
python -m pip install pybind11-stubgen==2.3.6 # https://github.com/CQCL/tket/issues/1135
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
python${{ matrix.python-version }} -m mypy --config-file=mypy.ini --no-incremental -p pytket -p tests
python -m mypy --config-file=mypy.ini --no-incremental -p pytket -p tests
- name: Upload package
if: github.event_name == 'push' && github.ref == 'refs/heads/develop' && needs.check_changes.outputs.tket_changed == 'true'
run: |
Expand Down Expand Up @@ -467,7 +461,7 @@ jobs:
with:
format: YYYYMMDDHHmmss
- name: ccache windows
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.ccache-setup.outputs.ccache_dir }}
key: tket-dynamic-visual-studio-windows-2022-${{ steps.current_time.outputs.formattedTime }}
Expand All @@ -487,7 +481,7 @@ jobs:
run: |
$env:TKET_VSGEN_CCACHE_EXE = '${{ steps.ccache-path.outputs.ccache_path }}'
conan build tket --user tket --channel stable -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True
conan export-pkg tket --user tket --channel stable -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True -tf `"`"
conan export-pkg tket --user tket --channel stable -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True -tf ""
- name: Install tket
if: needs.check_changes.outputs.tket_changed != 'true'
run: conan install --requires tket/${{ needs.check_changes.outputs.tket_ver }}@tket/stable -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True
Expand All @@ -514,15 +508,9 @@ jobs:
with:
python-version: '3.12'
- name: Build pytket
if: github.event_name != 'schedule'
run: |
cd pytket
pip install -e .[ZX] -v
- name: Build pytket
if: github.event_name == 'schedule' # https://github.com/CQCL/tket/issues/1200
run: |
cd pytket
pip install -e -v
- name: Run doctests
run: |
cd pytket
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
libs: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2.11.1
- uses: dorny/paths-filter@v3.0.0
id: filter
with:
base: ${{ github.ref }}
Expand Down Expand Up @@ -83,16 +83,16 @@ jobs:
- name: build shared ${{ matrix.lib }}
if: matrix.lib == 'tklog'
run: conan create -s build_type=${{ matrix.build_type }} -o boost/*:header_only=True -o ${{ matrix.lib }}/*:shared=True libs/${{ matrix.lib }} --build=missing --user=tket --channel=stable
- name: authenticate to repository
run: conan remote login -p ${{ secrets.JFROG_ARTIFACTORY_TOKEN_3 }} tket-libs ${{ secrets.JFROG_ARTIFACTORY_USER_3 }}
- name: get version
shell: bash
run: |
lib_label=`./libver ${{ matrix.lib }}.json ${{ matrix.lib }}`
echo "LIB_LABEL=${lib_label}" >> $GITHUB_ENV
- name: upload package
if: github.event_name == 'push'
run: conan upload ${{ env.LIB_LABEL }} -r=tket-libs
run: |
conan remote login -p ${{ secrets.JFROG_ARTIFACTORY_TOKEN_3 }} tket-libs ${{ secrets.JFROG_ARTIFACTORY_USER_3 }}
conan upload ${{ env.LIB_LABEL }} -r=tket-libs
manylinux:
name: build library (manylinux)
needs: changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
tket: ${{ steps.filter.outputs.tket }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2.11.1
- uses: dorny/paths-filter@v3.0.0
id: filter
with:
base: ${{ github.ref }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/linuxbuildlib
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ diff ${DEFAULT_PROFILE_PATH} ${PROFILE_PATH} || true
cp ${PROFILE_PATH} ${DEFAULT_PROFILE_PATH}
${CONAN_CMD} remote add tket-libs https://quantinuumsw.jfrog.io/artifactory/api/conan/tket1-libs --index 0

${CONAN_CMD} remote login -p ${JFROG_ARTIFACTORY_TOKEN_3} tket-libs ${JFROG_ARTIFACTORY_USER_3}

${CONAN_CMD} create ${TKLIB} -o boost/*:header_only=True --build=missing --user=tket --channel=stable --format json > ${TKLIB}.json

LIB_LABEL=$(${PYBIN}/python ./libver ${TKLIB}.json ${TKLIB})

if [ ${UPLOAD_PACKAGE} == "YES" ]
then
${CONAN_CMD} remote login -p ${JFROG_ARTIFACTORY_TOKEN_3} tket-libs ${JFROG_ARTIFACTORY_USER_3}
${CONAN_CMD} upload ${LIB_LABEL} -r=tket-libs
fi
11 changes: 1 addition & 10 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,17 @@ jobs:
build_manylinux_aarch64:
name: Build on manylinux (aarch64)
runs-on: ['self-hosted', 'macOS', 'ARM64']
runs-on: 'buildjet-8vcpu-ubuntu-2204-arm'
steps:

- uses: actions/checkout@v4

- name: Set up container
run: |
export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock
docker rm --force -v linux_build
docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux_2_28_aarch64:latest /bin/bash
docker cp . linux_build:/tket/
- name: Install and upload packages
run: |
export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock
docker start linux_build
docker exec -e JFROG_ARTIFACTORY_TOKEN_3="${{ secrets.JFROG_ARTIFACTORY_TOKEN_3 }}" -e JFROG_ARTIFACTORY_USER_3="${{ secrets.JFROG_ARTIFACTORY_USER_3 }}" -e CONAN_PROFILE=linux-armv8-gcc12 linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildpackages"
- name: Remove container
if: always()
run: |
export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock
docker rm --force -v linux_build
51 changes: 22 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ jobs:

build_Linux_aarch64_wheels:
name: Build manylinux aarch64
runs-on: ['self-hosted', 'macOS', 'ARM64']
# We need the one with 12GB RAM to build pytket.
runs-on: 'buildjet-8vcpu-ubuntu-2204-arm'
strategy:
matrix:
python3-version: ['10', '11', '12']
Expand All @@ -48,28 +49,18 @@ jobs:
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up container
run: |
export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock
docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux_2_28_aarch64:latest /bin/bash
docker cp . linux_build:/tket/
- name: Run build
run: |
export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock
docker start linux_build
docker exec -e PY_TAG="cp3${{ matrix.python3-version }}-cp3${{ matrix.python3-version }}" -e CONAN_PROFILE=linux-armv8-gcc12 linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildwheel"
mkdir wheelhouse
docker cp linux_build:/tket/pytket/audited/. wheelhouse/
- name: Remove container
if: always()
run: |
export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock
docker rm --force -v linux_build
- uses: actions/upload-artifact@v4
with:
name: Linux_aarch64_3.${{ matrix.python3-version }}_wheel
path: wheelhouse/
- name: Remove directory
if: always()
run: rm -rf wheelhouse

build_macos_wheels:
name: Build macos wheels
Expand Down Expand Up @@ -178,7 +169,7 @@ jobs:
cp ${PROFILE_PATH} ${DEFAULT_PROFILE_PATH}
conan remote add tket-libs https://quantinuumsw.jfrog.io/artifactory/api/conan/tket1-libs --index 0
- name: Build tket
run: conan create tket --user tket --channel stable --build=missing -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True -tf `"`"
run: conan create tket --user tket --channel stable --build=missing -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True -tf ""
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -227,37 +218,39 @@ jobs:
test_Linux_aarch64_wheels:
name: Test linux aarch64 wheels
needs: build_Linux_aarch64_wheels
runs-on: ['self-hosted', 'macOS', 'ARM64']
runs-on: 'buildjet-4vcpu-ubuntu-2204-arm'
strategy:
matrix:
python3-version: ['10', '11', '12']
steps:
- uses: actions/checkout@v4
with:
path: tket
- name: Set up Python 3.${{ matrix.python3-version }}
# Use deadsnakes/action because Python for Linux/ARM is not available with
# actions/setup-python.
# Python 3.10 is the default python on Ubuntu 22.04, so this combination
# is not available from deadsnakes: use the default python in this case.
if: matrix.python3-version != '10'
uses: deadsnakes/action@v3.1.0
with:
python-version: "3.${{ matrix.python3-version }}"
- name: Download wheel
uses: actions/download-artifact@v4
with:
name: Linux_aarch64_3.${{ matrix.python3-version }}_wheel
path: wheelhouse/
- name: Set up container
- name: Install wheel
run: pip install wheelhouse/pytket-*.whl
- uses: actions/checkout@v4
with:
path: tket
- name: Setup tests
run: |
export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock
docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux_2_28_aarch64:latest /bin/bash
docker cp . linux_build:/tket/
cd tket/pytket/tests
pip install -U -r requirements.txt
- name: Run tests
run: |
export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock
docker start linux_build
docker exec -e PY_TAG="cp3${{ matrix.python3-version }}-cp3${{ matrix.python3-version }}" linux_build /bin/bash -c "/tket/.github/workflows/linuxtestwheel"
- name: Remove container
if: always()
run: |
export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock
docker rm --force -v linux_build
- name: Remove directory
if: always()
run: rm -rf wheelhouse
run: cd tket/pytket/tests && pytest --ignore=simulator/

test_macos_wheels:
name: Test macos 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 @@ -20,7 +20,7 @@ jobs:
libs: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2.11.1
- uses: dorny/paths-filter@v3.0.0
id: filter
with:
base: ${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
tket: ${{ steps.filter.outputs.tket }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2.11.1
- uses: dorny/paths-filter@v3.0.0
id: filter
with:
base: ${{ github.ref }}
Expand Down
14 changes: 7 additions & 7 deletions build-without-conan.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ The versions should match the current requirements as specified in the relevant

```
cd ${TMP_DIR}
wget -O boost_1_83_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.gz/download
tar xzvf boost_1_83_0.tar.gz
cd boost_1_83_0/
wget -O boost_1_84_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.84.0/boost_1_84_0.tar.gz/download
tar xzvf boost_1_84_0.tar.gz
cd boost_1_84_0/
./bootstrap.sh --prefix=${INSTALL_DIR}
./b2
./b2 install
Expand Down Expand Up @@ -91,9 +91,9 @@ cmake --install .

```
cd ${TMP_DIR}
wget https://github.com/catchorg/Catch2/archive/refs/tags/v3.5.1.tar.gz
tar xzvf v3.5.1.tar.gz
cd Catch2-3.5.1/
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/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
Expand Down Expand Up @@ -258,4 +258,4 @@ NO_CONAN=1 pip install -v -e .

(You can use the environment variable `PYTKET_CMAKE_N_THREADS` to restrict the
number of threads used in the above command; otherwise one thread per CPU is
used.)
used.)
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.1")
self.requires("catch2/3.5.2")
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.1")
self.requires("catch2/3.5.2")
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.1")
self.requires("catch2/3.5.2")
Loading

0 comments on commit 0ec6039

Please sign in to comment.