From 5a4bf80a11ea7a370cea609c347028ff2fb12246 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 24 Apr 2025 17:33:04 +0100 Subject: [PATCH 001/227] update setup.py --- setup.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 88688a17..749d83e3 100644 --- a/setup.py +++ b/setup.py @@ -278,7 +278,7 @@ def build_mgclient_for(self, extension: Extension): author="Marin Tomic", author_email="marin.tomic@memgraph.com", license="Apache2", - python_requires=">=3.6", + python_requires=">=3.7", description="Memgraph database adapter for Python language", long_description=long_description, long_description_content_type="text/markdown", @@ -287,11 +287,13 @@ def build_mgclient_for(self, extension: Extension): "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Database", "Topic :: Database :: Front-Ends", @@ -309,4 +311,8 @@ def build_mgclient_for(self, extension: Extension): "Documentation": "https://memgraph.github.io/pymgclient", }, cmdclass={"build_ext": BuildMgclientExt}, + install_requires=[ + "pyopenssl", + "networkx" + ] ) From 140420fa5d5138ce57d52dac748b88f39389e942 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 24 Apr 2025 18:03:16 +0100 Subject: [PATCH 002/227] started modifying workflow --- .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bff4761..845a312a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,34 +12,79 @@ jobs: strategy: matrix: include: - - {platform: 'ubuntu-20.04', python_version: '3.8', mgversion: '2.0.1'} - - {platform: 'ubuntu-20.04', python_version: '3.8', mgversion: '2.5.2'} - - {platform: 'ubuntu-20.04', python_version: '3.8', mgversion: '2.10.1'} - - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: '2.5.2'} - - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: '2.10.1'} + - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} + - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} runs-on: ${{ matrix.platform }} steps: + - name: Checkout repository and submodules + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set Memgraph Version + run: | + if [[ "${{ matrix.mgversion }}" == "latest" ]]; then + mgversion=$(curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest | jq -r .tag_name) + mgversion=${version#v} + else + mgversion="${{ matrix.mgversion }}" + fi + echo "MGVERSION=$mgversion" >> $GITHUB_ENV + - name: Cache Memgraph community installer id: cache-memgraph-community uses: actions/cache@v1 with: path: ~/memgraph - key: cache-memgraph-v${{ matrix.mgversion }}-${{ matrix.platform }}-community-installer-v3 + key: cache-memgraph-v${{ env.MGVERSION }}-${{ matrix.platform }}-community-installer-v3 + - name: Download Memgraph if: steps.cache-memgraph-community.outputs.cache-hit != 'true' run: | mkdir ~/memgraph - MEMGRAPH_PACKAGE_NAME="memgraph_${{ matrix.mgversion }}-1_amd64.deb" - curl -L https://download.memgraph.com/memgraph/v${{ matrix.mgversion }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME} > ~/memgraph/memgraph.deb + if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then + + else + MEMGRAPH_PACKAGE_NAME="memgraph_${mgversion}-1_amd64.deb" + fi + curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME} > ~/memgraph/memgraph.deb + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Launch Docker Container + run: | + platform="${{ matrix.platform }}" + tag=${platform//-/:} + docker run -d -rm --name testcontainer "$tag" sleep infinity + - name: Install system dependencies run: | - sudo apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools - sudo pip3 install --upgrade networkx pytest pyopenssl sphinx - sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. - sudo dpkg -i ~/memgraph/memgraph.deb - - uses: actions/checkout@v2 - with: - submodules: true + if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then + + else + docker exec -i testcontainer \ + bash -c "apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" + docker exec -i testcontainer \ + bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" + docker exec -i testcontainer \ + bash -c "ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. + docker exec -i testcontainer \ + bash -c "dpkg -i ~/memgraph/memgraph.deb" + fi + - name: Build source distribution run: python3 setup.py sdist - name: Install pymgclient with dynamic OpenSSL for Memgraph 1.3.0 From 467be7097424b90108ae5f5dbd8dc1f9b21116aa Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 24 Apr 2025 18:03:42 +0100 Subject: [PATCH 003/227] modify startup memgraph --- test/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/common.py b/test/common.py index f3c481c5..bb1a0f44 100644 --- a/test/common.py +++ b/test/common.py @@ -88,10 +88,11 @@ def start_memgraph(cert_file="", key_file=""): "--storage-properties-on-edges=true", "--storage-snapshot-interval-sec=0", "--storage-wal-enabled=false", - "--storage-recover-on-startup=false", "--storage-snapshot-on-exit=false", "--telemetry-enabled=false", "--log-file", + "--timezone", + "UTC" "", ] memgraph_process = subprocess.Popen(cmd) From cebc3a651c78e0b2b8fb6d1ad857e0eb832a3d06 Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 21:30:31 +0100 Subject: [PATCH 004/227] updated workflow --- .github/workflows/ci.yml | 89 ++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 845a312a..3af16a4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,29 +30,25 @@ jobs: run: | if [[ "${{ matrix.mgversion }}" == "latest" ]]; then mgversion=$(curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest | jq -r .tag_name) - mgversion=${version#v} + mgversion=${mgversion#v} else mgversion="${{ matrix.mgversion }}" fi echo "MGVERSION=$mgversion" >> $GITHUB_ENV - - name: Cache Memgraph community installer - id: cache-memgraph-community - uses: actions/cache@v1 - with: - path: ~/memgraph - key: cache-memgraph-v${{ env.MGVERSION }}-${{ matrix.platform }}-community-installer-v3 - - name: Download Memgraph if: steps.cache-memgraph-community.outputs.cache-hit != 'true' run: | mkdir ~/memgraph if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then - + MEMGRAPH_PACKAGE_NAME="memgraph_${mgversion}_1-1.x86_64.rpm" + LOCAL_PACKAGE_NAME=memgraph.rpm else MEMGRAPH_PACKAGE_NAME="memgraph_${mgversion}-1_amd64.deb" + LOCAL_PACKAGE_NAME=memgraph.deb fi - curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME} > ~/memgraph/memgraph.deb + curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME} > ~/memgraph/${LOCAL_PACKAGE_NAME} + echo "LOCAL_PACKAGE_NAME=$LOCAL_PACKAGE_NAME" >> $GITHUB_ENV - name: Set up Docker Buildx id: buildx @@ -72,8 +68,19 @@ jobs: - name: Install system dependencies run: | + docker cp ~/memgraph/$LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then + docker exec -i testcontainer \ + bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools" + docker exec -i testcontainer \ + bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx" + + docker exec -i testcontainer \ + bash -c "ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. + + docker exec -i testcontainer \ + bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" else docker exec -i testcontainer \ bash -c "apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" @@ -82,38 +89,59 @@ jobs: docker exec -i testcontainer \ bash -c "ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. docker exec -i testcontainer \ - bash -c "dpkg -i ~/memgraph/memgraph.deb" + bash -c "dpkg -i /$LOCAL_PACKAGE_NAME" fi + + - name: Copy Repo Into Container + run: | + docker cp . testcontainer:/pymgclient - name: Build source distribution - run: python3 setup.py sdist - - name: Install pymgclient with dynamic OpenSSL for Memgraph 1.3.0 - if: matrix.mgversion == '1.3.0' - run: python3 -m pip install --global-option=build_ext --global-option="--static-openssl=false" ./dist/pymgclient-* + run: | + docker exec -i testcontainer \ + bash -c "cd /pymgclient && python3 setup.py sdist" + - name: Install pymgclient if: matrix.mgversion != '1.3.0' - run: python3 -m pip install ./dist/pymgclient-* + run: | + docker exec -i testcontainer \ + bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-*"" + - name: Import mgclient to validate installation - run: python3 -c "import mgclient" + run: | + docker exec -i testcontainer \ + bash -c "python3 -c 'import mgclient'" + - name: Run tests run: | - MEMGRAPH_PORT=10000 - if [[ "${{ matrix.mgversion }}" != 1* ]]; then - python3 -m pytest -v - else - python3 -m pytest -v -m "not temporal" - fi + MEMGRAPH_PORT=10000 # what's this for? + + docker exec -i testcontainer \ + bash -c "cd /pymgclient && python3 -m pytest -v" + - name: Build docs run: | - cd docs - make html + docker exec -i testcontainer \ + bash -c "cd /pymgclient/docs && make html" + + - name: Copy Package + run: | + docker cp testcontainer:/pymgclient/dist . + - name: Save source distribution package uses: actions/upload-artifact@v2 with: name: pymgclient path: dist/ + - name: Cleanup + run: | + docker stop testcontainer + docker wait testcontainer + docker rmi ${{ env.MGVERSION }} + build_and_test_windows: + if: ${{ github.event_name == 'workflow_dispatch' }} runs-on: windows-2019 strategy: matrix: @@ -121,7 +149,7 @@ jobs: - { mingw: "64", msys: x86_64, python: "x64" } python_version: - '3.7' - - '3.10' + - '3.13' env: # TODO(gitbuda): Fix "The file cannot be accessed by the system... rocksdb_durability" MG_VERSION: 2.8.0 @@ -181,16 +209,17 @@ jobs: path: dist/ build_macos: + if: ${{ github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: - platform: [macos-13, macos-12, macos-11] + platform: [macos-15, macos-14] python_version: - '3.8' - - '3.10' + - '3.13' include: - - {platform: [macOS-12.1, ARM64, self-hosted], python_version: '3.10'} - - {platform: [macOS-12.1, ARM64, self-hosted], python_version: '3.8'} + - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.13'} + - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.8'} runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 From 1035de9328c9ccff30355bcf9b8d7c4f0b320133 Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 21:34:10 +0100 Subject: [PATCH 005/227] update concurrency --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3af16a4d..a9a036e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,13 @@ name: CI +concurrency: + group: ${{ github.head_ref || github.sha }} + cancel-in-progress: true on: - push: + pull_request: workflow_dispatch: - schedule: - - cron: "0 1 * * *" +# schedule: +# - cron: "0 1 * * *" jobs: From a7a5150156686303d62cc54563fb421788802436 Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 21:36:46 +0100 Subject: [PATCH 006/227] update action version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9a036e9..99a56d83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,7 +132,7 @@ jobs: docker cp testcontainer:/pymgclient/dist . - name: Save source distribution package - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: pymgclient path: dist/ From 1b37b551cbb6f6ffe0e0a4554b965ba87a15c05b Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 21:46:15 +0100 Subject: [PATCH 007/227] fix docker run command --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99a56d83..c318bdd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: run: | platform="${{ matrix.platform }}" tag=${platform//-/:} - docker run -d -rm --name testcontainer "$tag" sleep infinity + docker run -d --rm --name testcontainer "$tag" sleep infinity - name: Install system dependencies run: | From b0cb205941c677ce157337f02a229c7d92ade332 Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 21:47:37 +0100 Subject: [PATCH 008/227] update apt --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c318bdd0..630a6c4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" else docker exec -i testcontainer \ - bash -c "apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" + bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ From 4dc09d194a8511e1942a2450484c5e72bbed2698 Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 21:50:13 +0100 Subject: [PATCH 009/227] install deadsnakes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 630a6c4c..4dcd9709 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" else docker exec -i testcontainer \ - bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" + bash -c "add-apt-repository ppa:deadsnakes/ppa && apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ From fe9574c79b96069e71ded04374984705708b7aab Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 21:52:30 +0100 Subject: [PATCH 010/227] install deadsnakes --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dcd9709..64a019ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,9 @@ jobs: bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" else docker exec -i testcontainer \ - bash -c "add-apt-repository ppa:deadsnakes/ppa && apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" + bash -c "apt update && apt install software-properties-common && add-apt-repository ppa:deadsnakes/ppa" + docker exec -i testcontainer \ + bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ From 250dbedde50d17a9cb680d7637a948c90d758cbf Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 21:57:35 +0100 Subject: [PATCH 011/227] run on self hosted --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64a019ab..c1c09be4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} - runs-on: ${{ matrix.platform }} + runs-on: ["self-hosted"] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 From 534afcdf1c941fe319cf5e4d15a6c038babddcad Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 21:59:11 +0100 Subject: [PATCH 012/227] update workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1c09be4..beeb7fb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" else docker exec -i testcontainer \ - bash -c "apt update && apt install software-properties-common && add-apt-repository ppa:deadsnakes/ppa" + bash -c "apt update && apt install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa" docker exec -i testcontainer \ bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" docker exec -i testcontainer \ From 6cfd6c19f96c95d336b33ae9115c855e1129a00d Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 22:01:50 +0100 Subject: [PATCH 013/227] local package --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index beeb7fb6..4f70713d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,6 @@ jobs: - name: Download Memgraph if: steps.cache-memgraph-community.outputs.cache-hit != 'true' run: | - mkdir ~/memgraph if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then MEMGRAPH_PACKAGE_NAME="memgraph_${mgversion}_1-1.x86_64.rpm" LOCAL_PACKAGE_NAME=memgraph.rpm @@ -50,7 +49,7 @@ jobs: MEMGRAPH_PACKAGE_NAME="memgraph_${mgversion}-1_amd64.deb" LOCAL_PACKAGE_NAME=memgraph.deb fi - curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME} > ~/memgraph/${LOCAL_PACKAGE_NAME} + curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME} > ${LOCAL_PACKAGE_NAME} echo "LOCAL_PACKAGE_NAME=$LOCAL_PACKAGE_NAME" >> $GITHUB_ENV - name: Set up Docker Buildx @@ -71,7 +70,7 @@ jobs: - name: Install system dependencies run: | - docker cp ~/memgraph/$LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME + docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then docker exec -i testcontainer \ bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools" @@ -96,6 +95,7 @@ jobs: docker exec -i testcontainer \ bash -c "dpkg -i /$LOCAL_PACKAGE_NAME" fi + rm -v $LOCAL_PACKAGE_NAME - name: Copy Repo Into Container run: | From 2a61df95e85d02858da97521cb8528226dd1717a Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 22:04:06 +0100 Subject: [PATCH 014/227] always cleanup --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f70713d..9cf419b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,10 +140,11 @@ jobs: path: dist/ - name: Cleanup + if: always() run: | - docker stop testcontainer - docker wait testcontainer - docker rmi ${{ env.MGVERSION }} + docker stop testcontainer || echo "Container does not exist" + docker wait testcontainer || echo "Container does not exist" + docker rmi ${{ env.MGVERSION }} || ecoh "Image does not exist" build_and_test_windows: if: ${{ github.event_name == 'workflow_dispatch' }} From 68cea073268260719c465b3bccb667d454fc98ac Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 22:05:28 +0100 Subject: [PATCH 015/227] echo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cf419b3..2edecddf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,7 +144,7 @@ jobs: run: | docker stop testcontainer || echo "Container does not exist" docker wait testcontainer || echo "Container does not exist" - docker rmi ${{ env.MGVERSION }} || ecoh "Image does not exist" + docker rmi ${{ env.MGVERSION }} || echo "Image does not exist" build_and_test_windows: if: ${{ github.event_name == 'workflow_dispatch' }} From eb4bb8842dfb8d7d540bd2164215f6ae41f3cedd Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 22:17:49 +0100 Subject: [PATCH 016/227] update workflow --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2edecddf..cc1878a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} - runs-on: ["self-hosted"] + runs-on: ["self-hosted", "X64"] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 @@ -40,16 +40,15 @@ jobs: echo "MGVERSION=$mgversion" >> $GITHUB_ENV - name: Download Memgraph - if: steps.cache-memgraph-community.outputs.cache-hit != 'true' run: | if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then - MEMGRAPH_PACKAGE_NAME="memgraph_${mgversion}_1-1.x86_64.rpm" + MEMGRAPH_PACKAGE_NAME="memgraph_${{ env.MGVERSION }}_1-1.x86_64.rpm" LOCAL_PACKAGE_NAME=memgraph.rpm else - MEMGRAPH_PACKAGE_NAME="memgraph_${mgversion}-1_amd64.deb" + MEMGRAPH_PACKAGE_NAME="memgraph_${{ env.MGVERSION }}-1_amd64.deb" LOCAL_PACKAGE_NAME=memgraph.deb fi - curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME} > ${LOCAL_PACKAGE_NAME} + curl -L "https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME}" > "${LOCAL_PACKAGE_NAME}" echo "LOCAL_PACKAGE_NAME=$LOCAL_PACKAGE_NAME" >> $GITHUB_ENV - name: Set up Docker Buildx @@ -91,7 +90,7 @@ jobs: docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ - bash -c "ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. + bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. docker exec -i testcontainer \ bash -c "dpkg -i /$LOCAL_PACKAGE_NAME" fi From cca835f743dd9beedb241f450be643ef267b8d3f Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 22:20:35 +0100 Subject: [PATCH 017/227] update workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc1878a0..b3f18c98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: docker exec -i testcontainer \ bash -c "apt update && apt install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa" docker exec -i testcontainer \ - bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools" + bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools libcurl4t64" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ From eedb97457bc212d79244b090696d741b658e64fe Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 22:23:10 +0100 Subject: [PATCH 018/227] fix syntax --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3f18c98..28a1e759 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: if: matrix.mgversion != '1.3.0' run: | docker exec -i testcontainer \ - bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-*"" + bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-*" - name: Import mgclient to validate installation run: | From e63aef28de3c0115bad730f06629195c5f0fa529 Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 22:26:02 +0100 Subject: [PATCH 019/227] fix syntax --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28a1e759..cda119f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,7 @@ jobs: bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx" docker exec -i testcontainer \ - bash -c "ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. + bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. docker exec -i testcontainer \ bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" From 7ffc8e577bdec2b85f13cb898fd9da39855e2987 Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 22:31:45 +0100 Subject: [PATCH 020/227] curl package --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cda119f3..12f1994a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,10 +83,15 @@ jobs: docker exec -i testcontainer \ bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" else + if [[ "${{ matrix.platform }}" == "ubuntu-22.04" ]]; then + curl_package=libcurl4 + else + curl_package=libcurl4t64 + fi docker exec -i testcontainer \ bash -c "apt update && apt install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa" docker exec -i testcontainer \ - bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools libcurl4t64" + bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ From 642fc2afa3530ca47e2b96cd886442ea2974cd3f Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 24 Apr 2025 22:35:55 +0100 Subject: [PATCH 021/227] break system packages --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12f1994a..3b7b4c4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,8 +113,12 @@ jobs: - name: Install pymgclient if: matrix.mgversion != '1.3.0' run: | + break_packages="" + if [[ "${{ matrix.platform }}" == "ubuntu*" ]]; then + break_packages="--break-system-packages" + fi docker exec -i testcontainer \ - bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-*" + bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-* $break_packages" - name: Import mgclient to validate installation run: | From 38afe943f9dcb6144e84854f8c0e503f7df8da68 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 24 Apr 2025 23:07:41 +0100 Subject: [PATCH 022/227] update workflow --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b7b4c4b..1119cda1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,12 +15,12 @@ jobs: strategy: matrix: include: - - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} - - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} - - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} - - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} + # - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} + # - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} + # - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} + # - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} - - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} + # - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} runs-on: ["self-hosted", "X64"] steps: - name: Checkout repository and submodules @@ -111,10 +111,9 @@ jobs: bash -c "cd /pymgclient && python3 setup.py sdist" - name: Install pymgclient - if: matrix.mgversion != '1.3.0' run: | break_packages="" - if [[ "${{ matrix.platform }}" == "ubuntu*" ]]; then + if [[ "${{ matrix.platform }}" == ^"ubuntu".* ]]; then break_packages="--break-system-packages" fi docker exec -i testcontainer \ From bc3fa91703800ef51d4013a1ec20ba98fb31265c Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 24 Apr 2025 23:47:09 +0100 Subject: [PATCH 023/227] update workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1119cda1..71ddad8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: - name: Install pymgclient run: | break_packages="" - if [[ "${{ matrix.platform }}" == ^"ubuntu".* ]]; then + if [[ "${{ matrix.platform }}" == ubuntu.* ]]; then break_packages="--break-system-packages" fi docker exec -i testcontainer \ From 49b856f73e909251bb442b1059885d3cfe7611e2 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 24 Apr 2025 23:51:43 +0100 Subject: [PATCH 024/227] update workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71ddad8f..6cb2d394 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: break_packages="--break-system-packages" fi docker exec -i testcontainer \ - bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-* $break_packages" + bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-* ${break_packages}" - name: Import mgclient to validate installation run: | From 978726d44a3656a2ed954ccda05e236092b8e96f Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 24 Apr 2025 23:56:51 +0100 Subject: [PATCH 025/227] update workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cb2d394..d6417626 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: - name: Install pymgclient run: | break_packages="" - if [[ "${{ matrix.platform }}" == ubuntu.* ]]; then + if [[ "${{ matrix.platform }}" == ubuntu* ]]; then break_packages="--break-system-packages" fi docker exec -i testcontainer \ From 29e67503f0bdc9b8300bfbbac978c807cf558798 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 24 Apr 2025 23:59:42 +0100 Subject: [PATCH 026/227] added missing cmake --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6417626..bcb31147 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then docker exec -i testcontainer \ - bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools" + bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools cmake" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx" @@ -91,7 +91,7 @@ jobs: docker exec -i testcontainer \ bash -c "apt update && apt install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa" docker exec -i testcontainer \ - bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package" + bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package cmake" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ From 2e5d2bcfd529a217e021066b37e502fe4fab0028 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 25 Apr 2025 00:03:04 +0100 Subject: [PATCH 027/227] added openssl --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcb31147..8be3f9a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then docker exec -i testcontainer \ - bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools cmake" + bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools cmake openssl-devel" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx" @@ -91,7 +91,7 @@ jobs: docker exec -i testcontainer \ bash -c "apt update && apt install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa" docker exec -i testcontainer \ - bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package cmake" + bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package cmake libssl-dev" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ From 5e2e30c22146fb7e41e9f81825f34ccdf4fd15b9 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 25 Apr 2025 00:09:00 +0100 Subject: [PATCH 028/227] netcat --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8be3f9a4..4525a92d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then docker exec -i testcontainer \ - bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools cmake openssl-devel" + bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools cmake openssl-devel nmap-ncat" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx" @@ -91,7 +91,7 @@ jobs: docker exec -i testcontainer \ bash -c "apt update && apt install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa" docker exec -i testcontainer \ - bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package cmake libssl-dev" + bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package cmake libssl-dev netcat" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ From 5584ad48664de76fd1340790e4a002a30cc6339b Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 25 Apr 2025 00:11:54 +0100 Subject: [PATCH 029/227] netcat --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4525a92d..58cc54ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,7 +91,7 @@ jobs: docker exec -i testcontainer \ bash -c "apt update && apt install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa" docker exec -i testcontainer \ - bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package cmake libssl-dev netcat" + bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package cmake libssl-dev netcat-traditional" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" docker exec -i testcontainer \ From 9eda0bd76f6bfa5965b38038ca233eaa5a2ea189 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 25 Apr 2025 09:12:41 +0100 Subject: [PATCH 030/227] try fedora --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58cc54ee..938f1621 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,8 +19,8 @@ jobs: # - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} # - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} # - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} - - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} - # - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} + # - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} + - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} runs-on: ["self-hosted", "X64"] steps: - name: Checkout repository and submodules From 6d241d69a7c1a4f717f2625abe64199278a7e03d Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 25 Apr 2025 09:27:25 +0100 Subject: [PATCH 031/227] fix fedora download link --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 938f1621..ff37c831 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: - name: Download Memgraph run: | if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then - MEMGRAPH_PACKAGE_NAME="memgraph_${{ env.MGVERSION }}_1-1.x86_64.rpm" + MEMGRAPH_PACKAGE_NAME="memgraph-${{ env.MGVERSION }}_1-1.x86_64.rpm" LOCAL_PACKAGE_NAME=memgraph.rpm else MEMGRAPH_PACKAGE_NAME="memgraph_${{ env.MGVERSION }}-1_amd64.deb" From b60f1fa1e250b9b3c437c6769ed2fcd4f02e266a Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 25 Apr 2025 09:30:20 +0100 Subject: [PATCH 032/227] added gcc to fedora setup --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff37c831..d451483d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then docker exec -i testcontainer \ - bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools cmake openssl-devel nmap-ncat" + bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools cmake g++ openssl-devel nmap-ncat" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx" From d8251fd00126d569eb8ddef6ce3c07dba98fdb4b Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 12:48:20 +0100 Subject: [PATCH 033/227] use static ssl option --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d451483d..56e86199 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,11 +113,14 @@ jobs: - name: Install pymgclient run: | break_packages="" + static_ssl="" if [[ "${{ matrix.platform }}" == ubuntu* ]]; then break_packages="--break-system-packages" + elif [[ "${{ matrix.platform }}" == fedora* ]]; then + static_ssl="--global-option '--static-openssl=False'" fi docker exec -i testcontainer \ - bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-* ${break_packages}" + bash -c "python3 -m pip install ${static_ssl} ./pymgclient/dist/pymgclient-* ${break_packages}" - name: Import mgclient to validate installation run: | From f18a46f8436182c1a44bd7f176da59909a192649 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 12:57:34 +0100 Subject: [PATCH 034/227] use static ssl option --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56e86199..d9752b8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: jobs: - build_and_test_ubuntu: + build_and_test_linux: strategy: matrix: include: @@ -117,7 +117,7 @@ jobs: if [[ "${{ matrix.platform }}" == ubuntu* ]]; then break_packages="--break-system-packages" elif [[ "${{ matrix.platform }}" == fedora* ]]; then - static_ssl="--global-option '--static-openssl=False'" + static_ssl="--global-option=build_ext --global-option '--static-openssl=False'" fi docker exec -i testcontainer \ bash -c "python3 -m pip install ${static_ssl} ./pymgclient/dist/pymgclient-* ${break_packages}" From b9f57d3ddb9c0d48dd318ff1abe5ac0d9f789024 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 13:01:07 +0100 Subject: [PATCH 035/227] remove build isolation --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9752b8c..ee803958 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: if [[ "${{ matrix.platform }}" == ubuntu* ]]; then break_packages="--break-system-packages" elif [[ "${{ matrix.platform }}" == fedora* ]]; then - static_ssl="--global-option=build_ext --global-option '--static-openssl=False'" + static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" fi docker exec -i testcontainer \ bash -c "python3 -m pip install ${static_ssl} ./pymgclient/dist/pymgclient-* ${break_packages}" From 4467b3f1e8221b992e994136fe775ac33b89d5bc Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 13:05:33 +0100 Subject: [PATCH 036/227] install wheel --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee803958..506c803b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,6 +119,8 @@ jobs: elif [[ "${{ matrix.platform }}" == fedora* ]]; then static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" fi + docker exec -i testcontainer \ + bash -c "python3 -m pip install --upgrade pip setuptools wheel ${break_packages}" docker exec -i testcontainer \ bash -c "python3 -m pip install ${static_ssl} ./pymgclient/dist/pymgclient-* ${break_packages}" From a82f5381e1fda3a7b80c9b792defb9789fc08fa9 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 13:08:53 +0100 Subject: [PATCH 037/227] added missing python header for fedora --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 506c803b..0322ed4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then docker exec -i testcontainer \ - bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools cmake g++ openssl-devel nmap-ncat" + bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools python3-devel cmake g++ openssl-devel nmap-ncat" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx" From b789b68cb68a412bef5a74ef4343633319a37bf9 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 13:12:58 +0100 Subject: [PATCH 038/227] try differrent static option --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0322ed4f..7d54264a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,8 @@ jobs: if [[ "${{ matrix.platform }}" == ubuntu* ]]; then break_packages="--break-system-packages" elif [[ "${{ matrix.platform }}" == fedora* ]]; then - static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" + # static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" + static_ssl="--config-settings='--static-openssl=False'" fi docker exec -i testcontainer \ bash -c "python3 -m pip install --upgrade pip setuptools wheel ${break_packages}" From 1a8ef8c3792530e8619adad49b5728f558670358 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 13:15:46 +0100 Subject: [PATCH 039/227] revert static ssl option --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d54264a..0322ed4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,8 +117,7 @@ jobs: if [[ "${{ matrix.platform }}" == ubuntu* ]]; then break_packages="--break-system-packages" elif [[ "${{ matrix.platform }}" == fedora* ]]; then - # static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" - static_ssl="--config-settings='--static-openssl=False'" + static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" fi docker exec -i testcontainer \ bash -c "python3 -m pip install --upgrade pip setuptools wheel ${break_packages}" From aef47fb1fff3f6992858a72cc3da66697dadb560 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 13:16:45 +0100 Subject: [PATCH 040/227] run all linux tests this time --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0322ed4f..9a9e88f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,11 @@ jobs: strategy: matrix: include: - # - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} - # - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} - # - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} - # - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} - # - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} + - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} runs-on: ["self-hosted", "X64"] steps: From 11b38630f1c805a170b41c57824a2b35114f44e2 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 14:13:12 +0100 Subject: [PATCH 041/227] install wheel via dnf --- .github/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a9e88f8..e171cf0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then docker exec -i testcontainer \ - bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools python3-devel cmake g++ openssl-devel nmap-ncat" + bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools python3-wheel python3-devel cmake g++ openssl-devel nmap-ncat" docker exec -i testcontainer \ bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx" @@ -115,12 +115,17 @@ jobs: break_packages="" static_ssl="" if [[ "${{ matrix.platform }}" == ubuntu* ]]; then + # this option is specific to ubuntu, not fedora break_packages="--break-system-packages" elif [[ "${{ matrix.platform }}" == fedora* ]]; then + # rpm distros do not ship with static lib for openssl static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" + + # # + # docker exec -i testcontainer \ + # bash -c "python3 -m pip install --upgrade pip setuptools wheel ${break_packages}" fi - docker exec -i testcontainer \ - bash -c "python3 -m pip install --upgrade pip setuptools wheel ${break_packages}" + docker exec -i testcontainer \ bash -c "python3 -m pip install ${static_ssl} ./pymgclient/dist/pymgclient-* ${break_packages}" From ed8da539c09346d80292b57609084cf695d38363 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 14:13:24 +0100 Subject: [PATCH 042/227] no fail fast --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e171cf0f..d2f36ba1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ on: jobs: build_and_test_linux: strategy: + fail-fast: false matrix: include: - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} From a34d05d75bf9316739d19f5a940f6bda335a54fa Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 14:31:58 +0100 Subject: [PATCH 043/227] added step to set env variables and modifed artifact name --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2f36ba1..8f7b217a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,20 @@ jobs: tag=${platform//-/:} docker run -d --rm --name testcontainer "$tag" sleep infinity + - name: Set Environment Variables + run: | + break_packages="" + static_ssl="" + if [[ "${{ matrix.platform }}" == "ubuntu-24.04" ]]; then + # this option is specific to ubuntu, not fedora + break_packages="--break-system-packages" + elif [[ "${{ matrix.platform }}" == fedora* ]]; then + # rpm distros do not ship with static lib for openssl + static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" + fi + echo "BREAK_PACKAGES=$break_packages" >> $GITHUB_ENV + echo "STATIC_SSL=$static_ssl" >> $GITHUB_ENV + - name: Install system dependencies run: | docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME @@ -94,7 +108,7 @@ jobs: docker exec -i testcontainer \ bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package cmake libssl-dev netcat-traditional" docker exec -i testcontainer \ - bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx --break-system-packages" + bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx ${{ env.BREAK_PACKAGES }}" docker exec -i testcontainer \ bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. docker exec -i testcontainer \ @@ -113,22 +127,22 @@ jobs: - name: Install pymgclient run: | - break_packages="" - static_ssl="" - if [[ "${{ matrix.platform }}" == ubuntu* ]]; then - # this option is specific to ubuntu, not fedora - break_packages="--break-system-packages" - elif [[ "${{ matrix.platform }}" == fedora* ]]; then - # rpm distros do not ship with static lib for openssl - static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" + # break_packages="" + # static_ssl="" + # if [[ "${{ matrix.platform }}" == ubuntu* ]]; then + # # this option is specific to ubuntu, not fedora + # break_packages="--break-system-packages" + # elif [[ "${{ matrix.platform }}" == fedora* ]]; then + # # rpm distros do not ship with static lib for openssl + # static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" - # # - # docker exec -i testcontainer \ - # bash -c "python3 -m pip install --upgrade pip setuptools wheel ${break_packages}" - fi + # # # + # # docker exec -i testcontainer \ + # # bash -c "python3 -m pip install --upgrade pip setuptools wheel ${break_packages}" + # fi docker exec -i testcontainer \ - bash -c "python3 -m pip install ${static_ssl} ./pymgclient/dist/pymgclient-* ${break_packages}" + bash -c "python3 -m pip install ${{ env.STATIC_SSL }} ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" - name: Import mgclient to validate installation run: | @@ -155,7 +169,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pymgclient - path: dist/ + path: dist/${{ matrix.platform }}-${{ matrix.python_version }} - name: Cleanup if: always() From 7a982cdda3a6342361b2a99e1fd8f25bd64db951 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 14:42:47 +0100 Subject: [PATCH 044/227] update windows CI --- .github/workflows/ci.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f7b217a..7f0c1505 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,21 +180,32 @@ jobs: build_and_test_windows: if: ${{ github.event_name == 'workflow_dispatch' }} - runs-on: windows-2019 strategy: matrix: + os: [ windows-2022 ] arch: - { mingw: "64", msys: x86_64, python: "x64" } python_version: - '3.7' - '3.13' - env: - # TODO(gitbuda): Fix "The file cannot be accessed by the system... rocksdb_durability" - MG_VERSION: 2.8.0 + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true + - name: Set Memgraph Version + run: | + if [[ "${{ matrix.mgversion }}" == "latest" ]]; then + mgversion=$( + curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ + | grep -m1 '"tag_name":' \ + | sed -E 's/.*"([^"]+)".*/\1/' \ + | sed 's/^v//' + ) + else + mgversion="${{ matrix.mgversion }}" + fi + echo "MGVERSION=$mgversion" >> $GITHUB_ENV - name: Setup python uses: actions/setup-python@v2.2.2 with: @@ -215,14 +226,14 @@ jobs: shell: msys2 {0} run: | openssl version -a - - uses: Vampire/setup-wsl@v1 + - uses: Vampire/setup-wsl@v5 with: - distribution: Ubuntu-20.04 + distribution: Ubuntu-24.04 - name: Download, install and run Memgraph under WSL shell: wsl-bash {0} # root shell run: | mkdir ~/memgraph - curl -L https://download.memgraph.com/memgraph/v${{ env.MG_VERSION }}/ubuntu-20.04/memgraph_${{ env.MG_VERSION }}-1_amd64.deb --output ~/memgraph/memgraph.deb + curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb --output ~/memgraph/memgraph.deb dpkg -i ~/memgraph/memgraph.deb openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & @@ -244,7 +255,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: pymgclient-win${{ matrix.arch.mingw }}-${{ matrix.python_version }} - path: dist/ + path: dist/${{ matrix.os }}-${{ matrix.python_version }} build_macos: if: ${{ github.event_name == 'workflow_dispatch' }} From 899ee4ade4c7322f9c2ecf00981aca63e98936f6 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:09:05 +0100 Subject: [PATCH 045/227] test everything --- .github/workflows/ci.yml | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f0c1505..bfa31039 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ on: jobs: build_and_test_linux: + #if: ${{ github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: @@ -127,20 +128,6 @@ jobs: - name: Install pymgclient run: | - # break_packages="" - # static_ssl="" - # if [[ "${{ matrix.platform }}" == ubuntu* ]]; then - # # this option is specific to ubuntu, not fedora - # break_packages="--break-system-packages" - # elif [[ "${{ matrix.platform }}" == fedora* ]]; then - # # rpm distros do not ship with static lib for openssl - # static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" - - # # # - # # docker exec -i testcontainer \ - # # bash -c "python3 -m pip install --upgrade pip setuptools wheel ${break_packages}" - # fi - docker exec -i testcontainer \ bash -c "python3 -m pip install ${{ env.STATIC_SSL }} ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" @@ -179,7 +166,7 @@ jobs: docker rmi ${{ env.MGVERSION }} || echo "Image does not exist" build_and_test_windows: - if: ${{ github.event_name == 'workflow_dispatch' }} + # if: ${{ github.event_name == 'workflow_dispatch' }} strategy: matrix: os: [ windows-2022 ] @@ -255,10 +242,10 @@ jobs: uses: actions/upload-artifact@v2 with: name: pymgclient-win${{ matrix.arch.mingw }}-${{ matrix.python_version }} - path: dist/${{ matrix.os }}-${{ matrix.python_version }} + path: dist/ build_macos: - if: ${{ github.event_name == 'workflow_dispatch' }} + # if: ${{ github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: From 9ef782c38d6343ba89157afcb4abe0c2eb39ef66 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:10:24 +0100 Subject: [PATCH 046/227] new upload artifact --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfa31039..f85cdf90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -239,7 +239,7 @@ jobs: MEMGRAPH_HOST: "localhost" MEMGRAPH_STARTED_WITH_SSL: - name: Save wheel package - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: pymgclient-win${{ matrix.arch.mingw }}-${{ matrix.python_version }} path: dist/ @@ -292,7 +292,7 @@ jobs: # Convert macOS-11.6-ARM64 to macos-11.6-arm64 to be consistent with full lowercase naming run: echo OS_TYPE=`echo "${{ matrix.platform[0] }}-${{ matrix.platform[1] }}" | tr "[:upper:]" "[:lower:]"` >> $GITHUB_ENV - name: Save wheel package - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: pymgclient-${{ env.OS_TYPE }}-${{ matrix.python_version }} path: dist/ From dcfc9c466a6aa47cf252643e35bca5721b8e5b8a Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:16:18 +0100 Subject: [PATCH 047/227] move step and change minimum python version --- .github/workflows/ci.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f85cdf90..6e0ee8a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,19 +180,6 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - - name: Set Memgraph Version - run: | - if [[ "${{ matrix.mgversion }}" == "latest" ]]; then - mgversion=$( - curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ - | grep -m1 '"tag_name":' \ - | sed -E 's/.*"([^"]+)".*/\1/' \ - | sed 's/^v//' - ) - else - mgversion="${{ matrix.mgversion }}" - fi - echo "MGVERSION=$mgversion" >> $GITHUB_ENV - name: Setup python uses: actions/setup-python@v2.2.2 with: @@ -216,6 +203,19 @@ jobs: - uses: Vampire/setup-wsl@v5 with: distribution: Ubuntu-24.04 + - name: Set Memgraph Version + run: | + if [[ "${{ matrix.mgversion }}" == "latest" ]]; then + mgversion=$( + curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ + | grep -m1 '"tag_name":' \ + | sed -E 's/.*"([^"]+)".*/\1/' \ + | sed 's/^v//' + ) + else + mgversion="${{ matrix.mgversion }}" + fi + echo "MGVERSION=$mgversion" >> $GITHUB_ENV - name: Download, install and run Memgraph under WSL shell: wsl-bash {0} # root shell run: | @@ -251,11 +251,11 @@ jobs: matrix: platform: [macos-15, macos-14] python_version: - - '3.8' + - '3.9' - '3.13' - include: - - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.13'} - - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.8'} + # include: + # - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.13'} + # - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.9'} runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 From 516aa05e4360bdbc16f2521e6da76710ab6ed4dc Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:22:02 +0100 Subject: [PATCH 048/227] udpate macos build --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e0ee8a7..2cd5683b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -277,11 +277,13 @@ jobs: brew unlink python@3 && brew link --force python@${{ matrix.python_version }} python${{ matrix.python_version }} --version - name: Install pytest and pyopenssl - run: python${{ matrix.python_version }} -m pip install pyopenssl pytest + run: | + export PIP_BREAK_SYSTEM_PACKAGES=1 + python${{ matrix.python_version }} -m pip install pyopenssl pytest - name: Build pymgclient - run: python${{ matrix.python_version }} setup.py bdist_wheel + run: python${{ matrix.python_version }} setup.py sdist - name: Install pymgclient - run: python${{ matrix.python_version }} -m pip install -f dist --no-index pymgclient + run: python${{ matrix.python_version }} -m pip install dist/* - name: Import mgclient to validate installation run: python${{ matrix.python_version }} -c "import mgclient" - name: Save artifact name on x86 machines From 4eb2126e392058dc55defe4210a971f9c3bf3c4a Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:24:02 +0100 Subject: [PATCH 049/227] use latest tag for windows! --- .github/workflows/ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cd5683b..623e9e65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -205,16 +205,12 @@ jobs: distribution: Ubuntu-24.04 - name: Set Memgraph Version run: | - if [[ "${{ matrix.mgversion }}" == "latest" ]]; then - mgversion=$( + mgversion=$( curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ | grep -m1 '"tag_name":' \ | sed -E 's/.*"([^"]+)".*/\1/' \ | sed 's/^v//' - ) - else - mgversion="${{ matrix.mgversion }}" - fi + ) echo "MGVERSION=$mgversion" >> $GITHUB_ENV - name: Download, install and run Memgraph under WSL shell: wsl-bash {0} # root shell From 7683f0500ba56aee61e18aaa0d4c59b2032b160e Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:25:42 +0100 Subject: [PATCH 050/227] don't fail fast --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 623e9e65..a711c5b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,6 +168,7 @@ jobs: build_and_test_windows: # if: ${{ github.event_name == 'workflow_dispatch' }} strategy: + fail-fast: false matrix: os: [ windows-2022 ] arch: From c2022203a491ec9cfed6a9610144265a9134df48 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:26:00 +0100 Subject: [PATCH 051/227] no more linux on push --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a711c5b6..3fc125c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: jobs: build_and_test_linux: - #if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: From ebf565fb5cf7a88dd608a0e5cf918225d3b8d2dd Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:30:32 +0100 Subject: [PATCH 052/227] added setuptools to macos install --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fc125c0..586d5bd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -276,7 +276,7 @@ jobs: - name: Install pytest and pyopenssl run: | export PIP_BREAK_SYSTEM_PACKAGES=1 - python${{ matrix.python_version }} -m pip install pyopenssl pytest + python${{ matrix.python_version }} -m pip install pyopenssl pytest setuptools - name: Build pymgclient run: python${{ matrix.python_version }} setup.py sdist - name: Install pymgclient From 708584f3eee592fa3599a7ebf7575c36afbc2372 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:42:37 +0100 Subject: [PATCH 053/227] use bash --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 586d5bd6..d1b96b3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -205,6 +205,7 @@ jobs: with: distribution: Ubuntu-24.04 - name: Set Memgraph Version + shell: wsl-bash {0} run: | mgversion=$( curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ From 7ad5d05a3da44465bfe367555ee288eb8d105311 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:50:59 +0100 Subject: [PATCH 054/227] use different shell for mg version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1b96b3f..6c31fb72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -205,7 +205,7 @@ jobs: with: distribution: Ubuntu-24.04 - name: Set Memgraph Version - shell: wsl-bash {0} + shell: bash -l {0} run: | mgversion=$( curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ From e8e72d039537a66a5b81ca5ce3cb6b0c91b61f34 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 15:51:31 +0100 Subject: [PATCH 055/227] break system packages for macos --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c31fb72..f1e2c2c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -281,7 +281,9 @@ jobs: - name: Build pymgclient run: python${{ matrix.python_version }} setup.py sdist - name: Install pymgclient - run: python${{ matrix.python_version }} -m pip install dist/* + run: | + export PIP_BREAK_SYSTEM_PACKAGES=1 + python${{ matrix.python_version }} -m pip install dist/* - name: Import mgclient to validate installation run: python${{ matrix.python_version }} -c "import mgclient" - name: Save artifact name on x86 machines From 11cd09470d886d4c34549b411f875672c46bf273 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 16:04:22 +0100 Subject: [PATCH 056/227] try using dynamically linked ssl --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1e2c2c4..c569f009 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -225,7 +225,7 @@ jobs: sleep 1 # Wait for Memgraph a bit. - run: python -m pip install -U pip wheel setuptools pytest pyopenssl - name: Build pymgclient - run: python setup.py bdist_wheel + run: python setup.py build_ext --static-openssl=False bdist_wheel - name: Install pymgclient run: python -m pip install --verbose -f dist --no-index pymgclient env: From cee27f43931839dcaf9f727b0bed05575d44d0a3 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 16:04:40 +0100 Subject: [PATCH 057/227] test macos on workflow dispatch --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c569f009..1c98774b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -243,7 +243,7 @@ jobs: path: dist/ build_macos: - # if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: From a142e35e1ffd3dec2752b8f56bbbad452b322d89 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 16:09:08 +0100 Subject: [PATCH 058/227] added latest windows --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c98774b..9b1a8791 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,7 +170,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ windows-2022 ] + os: [windows-2022, windows-2025] arch: - { mingw: "64", msys: x86_64, python: "x64" } python_version: From 6a947043fcfba31ba7afb78b0efdfb6a8ef485a6 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 16:13:11 +0100 Subject: [PATCH 059/227] udpate python versions to test --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b1a8791..8f9d592b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,7 +174,10 @@ jobs: arch: - { mingw: "64", msys: x86_64, python: "x64" } python_version: - - '3.7' + # - '3.7' # this does work, but do we bother with such an old version? + - '3.10' + - '3.11' + - '3.12' - '3.13' runs-on: ${{ matrix.os }} steps: @@ -249,7 +252,10 @@ jobs: matrix: platform: [macos-15, macos-14] python_version: - - '3.9' + #- '3.9' # this does work, but is old + - '3.10' + - '3.11' + - '3.12' - '3.13' # include: # - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.13'} From 3d47adc30c6b55f307a9632552eb1d4a469e0a16 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 16:13:57 +0100 Subject: [PATCH 060/227] install package from dist dir --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f9d592b..4bca09a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -230,7 +230,7 @@ jobs: - name: Build pymgclient run: python setup.py build_ext --static-openssl=False bdist_wheel - name: Install pymgclient - run: python -m pip install --verbose -f dist --no-index pymgclient + run: python -m pip install --verbose dist/* env: VERBOSE: 1 - name: Run tests From b4012ef06010c520550bb957ef4f599d18b4afd7 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 16:20:51 +0100 Subject: [PATCH 061/227] update pip install --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bca09a9..d32c66f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,9 +175,9 @@ jobs: - { mingw: "64", msys: x86_64, python: "x64" } python_version: # - '3.7' # this does work, but do we bother with such an old version? - - '3.10' - - '3.11' - - '3.12' + #- '3.10' + #- '3.11' + #- '3.12' - '3.13' runs-on: ${{ matrix.os }} steps: @@ -230,7 +230,8 @@ jobs: - name: Build pymgclient run: python setup.py build_ext --static-openssl=False bdist_wheel - name: Install pymgclient - run: python -m pip install --verbose dist/* + shell: bash -l {0} + run: python -m pip install --verbose dist/*.whl env: VERBOSE: 1 - name: Run tests From e76f8ee417d47fe3de5470bd30ca0d56ffb32f23 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 16:29:50 +0100 Subject: [PATCH 062/227] try using sdist --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d32c66f4..a1d2bdea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,10 +228,10 @@ jobs: sleep 1 # Wait for Memgraph a bit. - run: python -m pip install -U pip wheel setuptools pytest pyopenssl - name: Build pymgclient - run: python setup.py build_ext --static-openssl=False bdist_wheel + run: python setup.py sdist - name: Install pymgclient shell: bash -l {0} - run: python -m pip install --verbose dist/*.whl + run: python -m pip install --no-build-isolation --global-option=build_ext --global-option '--static-openssl=False' --verbose dist/* env: VERBOSE: 1 - name: Run tests From 336435e4dd7b51a0f43390643a65c22ef1d45974 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 16:47:27 +0100 Subject: [PATCH 063/227] use msys shell --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1d2bdea..a595c2d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,13 +228,15 @@ jobs: sleep 1 # Wait for Memgraph a bit. - run: python -m pip install -U pip wheel setuptools pytest pyopenssl - name: Build pymgclient - run: python setup.py sdist + shell: msys2 {0} + run: python setup.py build_ext --static-openssl=False sdist - name: Install pymgclient - shell: bash -l {0} - run: python -m pip install --no-build-isolation --global-option=build_ext --global-option '--static-openssl=False' --verbose dist/* + shell: msys2 {0} + run: python -m pip install --verbose dist/*.whl env: VERBOSE: 1 - name: Run tests + shell: msys2 {0} run: | python3 -m pytest -v env: From 2b3ece3dc8f8dd490c2e766f0b395d3b0f0528a6 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 16:55:45 +0100 Subject: [PATCH 064/227] update workflow --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a595c2d2..423e48df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -229,7 +229,9 @@ jobs: - run: python -m pip install -U pip wheel setuptools pytest pyopenssl - name: Build pymgclient shell: msys2 {0} - run: python setup.py build_ext --static-openssl=False sdist + run: | + python -m pip install setuptools + python setup.py build_ext --static-openssl=False bdist_wheel - name: Install pymgclient shell: msys2 {0} run: python -m pip install --verbose dist/*.whl From fc909462e7cd8bce04c095aba7b958bd3f410bc8 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 17:03:30 +0100 Subject: [PATCH 065/227] update windows ci --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 423e48df..3d34ce9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -194,7 +194,13 @@ jobs: msystem: MINGW${{ matrix.arch.mingw }} update: true release: false - install: git mingw-w64-${{ matrix.arch.msys }}-toolchain mingw-w64-${{ matrix.arch.msys }}-cmake mingw-w64-${{ matrix.arch.msys }}-openssl + install: > + git + mingw-w64-${{ matrix.arch.msys }}-toolchain + mingw-w64-${{ matrix.arch.msys }}-cmake + mingw-w64-${{ matrix.arch.msys }}-openssl + mingw-w64-${{ matrix.arch.msys }}-python-pip + mingw-w64-${{ matrix.arch.msys }}-python-pytest - name: Add mingw${{ matrix.arch.mingw }} to PATH run: | # First make sure python would resolve to the windows native python, not mingw one From 7a3d7edceaf259241385eda5f2adf47d3ddd236c Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 17:22:20 +0100 Subject: [PATCH 066/227] modify cflags --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 749d83e3..c72ad064 100644 --- a/setup.py +++ b/setup.py @@ -189,7 +189,11 @@ def finalize_linux(self, extension: Extension): self.finalize_linux_like(extension, ["ssl", "crypto"]) def get_cflags(self): - return "{0} -Werror=all".format(os.getenv("CFLAGS", "")).strip() + cflags = "{0} -Werror=all".format(os.getenv("CFLAGS", "")).strip() + if sys.version_info >= (3, 12): + # Python 3.12 headers trigger a harmless array-bounds warning under MinGW + cflags += " -Wno-error=array-bounds" + return cflags def build_mgclient_for(self, extension: Extension): """ From d2d98a788e42016107dff4c3a4fad9aa89406293 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 17:37:00 +0100 Subject: [PATCH 067/227] udpate setup --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c72ad064..fa31edd0 100644 --- a/setup.py +++ b/setup.py @@ -235,7 +235,7 @@ def build_mgclient_for(self, extension: Extension): f"-DCMAKE_INSTALL_PREFIX={mgclient_install_path}", "-DBUILD_TESTING=OFF", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", - f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', + f'-DCMAKE_C_FLAGS={self.get_cflags()}', f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", ] From 9436d66afd11c96b9ba92c9e4e996549a737339f Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 17:49:41 +0100 Subject: [PATCH 068/227] udpate setup --- setup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index fa31edd0..74d22e2c 100644 --- a/setup.py +++ b/setup.py @@ -190,9 +190,8 @@ def finalize_linux(self, extension: Extension): def get_cflags(self): cflags = "{0} -Werror=all".format(os.getenv("CFLAGS", "")).strip() - if sys.version_info >= (3, 12): - # Python 3.12 headers trigger a harmless array-bounds warning under MinGW - cflags += " -Wno-error=array-bounds" + if sys.platform.startswith("win") or "mingw" in platform.system().lower(): + return cflags return cflags def build_mgclient_for(self, extension: Extension): @@ -235,7 +234,7 @@ def build_mgclient_for(self, extension: Extension): f"-DCMAKE_INSTALL_PREFIX={mgclient_install_path}", "-DBUILD_TESTING=OFF", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", - f'-DCMAKE_C_FLAGS={self.get_cflags()}', + f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", ] From b05ec70b3544b9d008877845933df107bf00ac59 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 18:05:46 +0100 Subject: [PATCH 069/227] udpate setup --- setup.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 74d22e2c..a034886a 100644 --- a/setup.py +++ b/setup.py @@ -273,6 +273,13 @@ def build_mgclient_for(self, extension: Extension): finalize(extension) +def set_extra_compile_args(): + args = ["-std=c99"] + if sys.platform.startswith("win") or "mingw" in platform.system().lower(): + args += ["-Werror=all"] + return args + + setup( name="pymgclient", version=version, @@ -307,7 +314,7 @@ def build_mgclient_for(self, extension: Extension): "Operating System :: Microsoft :: Windows", ], ext_modules=[ - Extension(EXTENSION_NAME, sources=sources, depends=headers, extra_compile_args=["-Werror=all", "-std=c99"]) + Extension(EXTENSION_NAME, sources=sources, depends=headers, extra_compile_args=set_extra_compile_args()) ], project_urls={ "Source": "https://github.com/memgraph/pymgclient", From a61a98b2a711c1522a840af934d8cef09464cea6 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Apr 2025 18:12:39 +0100 Subject: [PATCH 070/227] udpate setup --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index a034886a..3c1d6949 100644 --- a/setup.py +++ b/setup.py @@ -279,6 +279,7 @@ def set_extra_compile_args(): args += ["-Werror=all"] return args +print(f"ARGS: {set_extra_compile_args()} {sys.platform}") setup( name="pymgclient", From 189a30703c39e2431835a9775e23f9e7c1c1bdd3 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 08:50:46 +0100 Subject: [PATCH 071/227] uncomment python versions --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d34ce9a..98f89e0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,9 +175,9 @@ jobs: - { mingw: "64", msys: x86_64, python: "x64" } python_version: # - '3.7' # this does work, but do we bother with such an old version? - #- '3.10' - #- '3.11' - #- '3.12' + - '3.10' + - '3.11' + - '3.12' - '3.13' runs-on: ${{ matrix.os }} steps: From f9e432741f001a9a172378cd08384031a5aab5ae Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 11:07:38 +0100 Subject: [PATCH 072/227] new workflow for windows --- .github/workflows/ci.yml | 206 ++++++++++++++++++++++++++++----------- 1 file changed, 149 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98f89e0c..a8502911 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,54 +165,62 @@ jobs: docker wait testcontainer || echo "Container does not exist" docker rmi ${{ env.MGVERSION }} || echo "Image does not exist" + build_and_test_windows: - # if: ${{ github.event_name == 'workflow_dispatch' }} + name: Build and Test on Windows + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [windows-2022, windows-2025] - arch: - - { mingw: "64", msys: x86_64, python: "x64" } - python_version: - # - '3.7' # this does work, but do we bother with such an old version? - - '3.10' - - '3.11' - - '3.12' - - '3.13' - runs-on: ${{ matrix.os }} + python-version: ["3.11"] + steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 with: submodules: true - - name: Setup python - uses: actions/setup-python@v2.2.2 + + - name: Set up Windows Python + uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python_version }} - architecture: ${{ matrix.arch.python }} - - uses: msys2/setup-msys2@v2 + python-version: ${{ matrix.python-version }} + architecture: x64 + + - name: Set up MSYS2 + uses: msys2/setup-msys2@v2 with: - msystem: MINGW${{ matrix.arch.mingw }} - update: true - release: false + msystem: MINGW64 install: > - git - mingw-w64-${{ matrix.arch.msys }}-toolchain - mingw-w64-${{ matrix.arch.msys }}-cmake - mingw-w64-${{ matrix.arch.msys }}-openssl - mingw-w64-${{ matrix.arch.msys }}-python-pip - mingw-w64-${{ matrix.arch.msys }}-python-pytest - - name: Add mingw${{ matrix.arch.mingw }} to PATH + git + mingw-w64-x86_64-gcc + mingw-w64-x86_64-cmake + mingw-w64-x86_64-make + mingw-w64-x86_64-openssl + + - name: Add Windows Python to PATH + run: | + echo "${{ env.pythonLocation }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 + + - name: Install Python build tools run: | - # First make sure python would resolve to the windows native python, not mingw one - echo "C:\msys64\mingw${{ matrix.arch.mingw }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - echo "${{ env.pythonLocation }}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - - name: Print OpenSSL version + python -m pip install --upgrade pip setuptools wheel pyopenssl pytest + + - name: Build pymgclient Wheel shell: msys2 {0} run: | - openssl version -a - - uses: Vampire/setup-wsl@v5 + python setup.py build_ext --static-openssl=False bdist_wheel + + - name: Install built wheel + shell: msys2 {0} + run: | + python -m pip install dist/*.whl + + - name: Setup WSL Ubuntu + uses: Vampire/setup-wsl@v5 with: distribution: Ubuntu-24.04 + - name: Set Memgraph Version shell: bash -l {0} run: | @@ -223,39 +231,123 @@ jobs: | sed 's/^v//' ) echo "MGVERSION=$mgversion" >> $GITHUB_ENV - - name: Download, install and run Memgraph under WSL - shell: wsl-bash {0} # root shell - run: | - mkdir ~/memgraph - curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb --output ~/memgraph/memgraph.deb - dpkg -i ~/memgraph/memgraph.deb - openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - sleep 1 # Wait for Memgraph a bit. - - run: python -m pip install -U pip wheel setuptools pytest pyopenssl - - name: Build pymgclient - shell: msys2 {0} + + - name: Install and Run Memgraph in WSL + shell: wsl-bash {0} run: | - python -m pip install setuptools - python setup.py build_ext --static-openssl=False bdist_wheel - - name: Install pymgclient - shell: msys2 {0} - run: python -m pip install --verbose dist/*.whl - env: - VERBOSE: 1 - - name: Run tests + sudo apt update + sudo apt install -y curl + curl -L https://download.memgraph.com/memgraph/v${MGVERSION}/ubuntu-24.04/memgraph_${MGVERSION}-1_amd64.deb -o memgraph.deb + sudo apt install ./memgraph.deb + nohup sudo memgraph --bolt-port 7687 & + + - name: Wait for Memgraph to Start + run: timeout 10 + + - name: Run Tests shell: msys2 {0} run: | - python3 -m pytest -v + python -m pytest -v env: - MEMGRAPH_HOST: "localhost" - MEMGRAPH_STARTED_WITH_SSL: - - name: Save wheel package + MEMGRAPH_HOST: localhost + + - name: Upload Wheel Artifact uses: actions/upload-artifact@v4 with: - name: pymgclient-win${{ matrix.arch.mingw }}-${{ matrix.python_version }} + name: pymgclient-win-${{ matrix.os }}-py${{ matrix.python-version }} path: dist/ + # build_and_test_windows: + # # if: ${{ github.event_name == 'workflow_dispatch' }} + # strategy: + # fail-fast: false + # matrix: + # os: [windows-2022, windows-2025] + # arch: + # - { mingw: "64", msys: x86_64, python: "x64" } + # python_version: + # # - '3.7' # this does work, but do we bother with such an old version? + # - '3.10' + # - '3.11' + # - '3.12' + # - '3.13' + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Setup python + # uses: actions/setup-python@v2.2.2 + # with: + # python-version: ${{ matrix.python_version }} + # architecture: ${{ matrix.arch.python }} + # - uses: msys2/setup-msys2@v2 + # with: + # msystem: MINGW${{ matrix.arch.mingw }} + # update: true + # release: false + # install: > + # git + # mingw-w64-${{ matrix.arch.msys }}-toolchain + # mingw-w64-${{ matrix.arch.msys }}-cmake + # mingw-w64-${{ matrix.arch.msys }}-openssl + # mingw-w64-${{ matrix.arch.msys }}-python-pip + # mingw-w64-${{ matrix.arch.msys }}-python-pytest + # - name: Add mingw${{ matrix.arch.mingw }} to PATH + # run: | + # # First make sure python would resolve to the windows native python, not mingw one + # echo "C:\msys64\mingw${{ matrix.arch.mingw }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + # echo "${{ env.pythonLocation }}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + # - name: Print OpenSSL version + # shell: msys2 {0} + # run: | + # openssl version -a + # - uses: Vampire/setup-wsl@v5 + # with: + # distribution: Ubuntu-24.04 + # - name: Set Memgraph Version + # shell: bash -l {0} + # run: | + # mgversion=$( + # curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ + # | grep -m1 '"tag_name":' \ + # | sed -E 's/.*"([^"]+)".*/\1/' \ + # | sed 's/^v//' + # ) + # echo "MGVERSION=$mgversion" >> $GITHUB_ENV + # - name: Download, install and run Memgraph under WSL + # shell: wsl-bash {0} # root shell + # run: | + # mkdir ~/memgraph + # curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb --output ~/memgraph/memgraph.deb + # dpkg -i ~/memgraph/memgraph.deb + # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" + # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + # sleep 1 # Wait for Memgraph a bit. + # - run: python -m pip install -U pip wheel setuptools pytest pyopenssl + # - name: Build pymgclient + # shell: msys2 {0} + # run: | + # python -m pip install setuptools + # python setup.py build_ext --static-openssl=False bdist_wheel + # - name: Install pymgclient + # shell: msys2 {0} + # run: python -m pip install --verbose dist/*.whl + # env: + # VERBOSE: 1 + # - name: Run tests + # shell: msys2 {0} + # run: | + # python3 -m pytest -v + # env: + # MEMGRAPH_HOST: "localhost" + # MEMGRAPH_STARTED_WITH_SSL: + # - name: Save wheel package + # uses: actions/upload-artifact@v4 + # with: + # name: pymgclient-win${{ matrix.arch.mingw }}-${{ matrix.python_version }} + # path: dist/ + build_macos: if: ${{ github.event_name == 'workflow_dispatch' }} strategy: From bbe7ee44bf76f88361b6f448be6e7a2e8c1523d0 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 11:17:32 +0100 Subject: [PATCH 073/227] added python to path variable --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8502911..02908385 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -209,12 +209,18 @@ jobs: - name: Build pymgclient Wheel shell: msys2 {0} run: | + export PATH="$(cygpath -u "$pythonLocation"):$PATH" python setup.py build_ext --static-openssl=False bdist_wheel + env: + pythonLocation: ${{ env.pythonLocation }} - name: Install built wheel shell: msys2 {0} run: | + export PATH="$(cygpath -u "$pythonLocation"):$PATH" python -m pip install dist/*.whl + env: + pythonLocation: ${{ env.pythonLocation }} - name: Setup WSL Ubuntu uses: Vampire/setup-wsl@v5 @@ -247,9 +253,12 @@ jobs: - name: Run Tests shell: msys2 {0} run: | + export PATH="$(cygpath -u "$pythonLocation"):$PATH" python -m pytest -v env: + pythonLocation: ${{ env.pythonLocation }} MEMGRAPH_HOST: localhost + - name: Upload Wheel Artifact uses: actions/upload-artifact@v4 From 0be6e941a45404d344a7646f0ec498d818469652 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 11:22:58 +0100 Subject: [PATCH 074/227] fix unbound variable --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02908385..832fab9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -243,7 +243,7 @@ jobs: run: | sudo apt update sudo apt install -y curl - curl -L https://download.memgraph.com/memgraph/v${MGVERSION}/ubuntu-24.04/memgraph_${MGVERSION}-1_amd64.deb -o memgraph.deb + curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb sudo apt install ./memgraph.deb nohup sudo memgraph --bolt-port 7687 & From 7e08b750afbf4ea7ca2acf163c673e9aaad9cb4e Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 11:30:35 +0100 Subject: [PATCH 075/227] update sleep command --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 832fab9c..fcdb285f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,7 +248,7 @@ jobs: nohup sudo memgraph --bolt-port 7687 & - name: Wait for Memgraph to Start - run: timeout 10 + run: Start-Sleep -Seconds 10 - name: Run Tests shell: msys2 {0} From a5915a4648166e0bb17ba39ea62ac9e735617f01 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 11:32:01 +0100 Subject: [PATCH 076/227] disable telemetry --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcdb285f..f6201cdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,8 +244,9 @@ jobs: sudo apt update sudo apt install -y curl curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb + sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. sudo apt install ./memgraph.deb - nohup sudo memgraph --bolt-port 7687 & + nohup sudo memgraph --bolt-port 7687 --telemetry-enabled=False & - name: Wait for Memgraph to Start run: Start-Sleep -Seconds 10 From 2b9f2d4cc1f3f45871d51fa2518199c05dc68934 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 11:46:42 +0100 Subject: [PATCH 077/227] added msys to path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6201cdf..07066459 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,7 +254,7 @@ jobs: - name: Run Tests shell: msys2 {0} run: | - export PATH="$(cygpath -u "$pythonLocation"):$PATH" + export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" python -m pytest -v env: pythonLocation: ${{ env.pythonLocation }} From 3d714dba6a4650beb9d25a96c72dbfacc3d8b307 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 11:56:58 +0100 Subject: [PATCH 078/227] added debug steps --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07066459..957b7af6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,6 +198,12 @@ jobs: mingw-w64-x86_64-make mingw-w64-x86_64-openssl + - name: Debug Find OpenSSL DLLs + shell: msys2 {0} + run: | + find /mingw64/bin -iname "*ssl*.dll" + find /mingw64/bin -iname "*crypto*.dll" + - name: Add Windows Python to PATH run: | echo "${{ env.pythonLocation }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 @@ -222,6 +228,20 @@ jobs: env: pythonLocation: ${{ env.pythonLocation }} + - name: Locate mgclient Python extension + run: | + Get-ChildItem -Recurse -Filter "mgclient.cp*.pyd" -Path $env:pythonLocation + + - name: Check mgclient.pyd DLL Dependencies + run: | + $mgclientPath = Get-ChildItem -Recurse -Filter "mgclient.cp*.pyd" -Path $env:pythonLocation | Select-Object -ExpandProperty FullName + if (Test-Path "$mgclientPath") { + dumpbin /DEPENDENTS "$mgclientPath" + } else { + Write-Host "mgclient.pyd not found!" + exit 1 + } + - name: Setup WSL Ubuntu uses: Vampire/setup-wsl@v5 with: From 27bc38889de1c136a48e4fe4ef2e70a4452a113f Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:01:37 +0100 Subject: [PATCH 079/227] added debug steps --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 957b7af6..8883f74e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -233,6 +233,7 @@ jobs: Get-ChildItem -Recurse -Filter "mgclient.cp*.pyd" -Path $env:pythonLocation - name: Check mgclient.pyd DLL Dependencies + uses: microsoft/setup-msbuild@v1.3.1 run: | $mgclientPath = Get-ChildItem -Recurse -Filter "mgclient.cp*.pyd" -Path $env:pythonLocation | Select-Object -ExpandProperty FullName if (Test-Path "$mgclientPath") { @@ -271,6 +272,14 @@ jobs: - name: Wait for Memgraph to Start run: Start-Sleep -Seconds 10 + - name: Run Tests + run: | + $env:Path += ";C:\msys64\mingw64\bin" + python -m pytest -v + env: + MEMGRAPH_HOST: localhost + + - name: Run Tests shell: msys2 {0} run: | From d41c914595e92172dd7be51b22582564e8e8d6e4 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:06:28 +0100 Subject: [PATCH 080/227] use static openssl --- .github/workflows/ci.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8883f74e..e95c0a56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,7 +216,7 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):$PATH" - python setup.py build_ext --static-openssl=False bdist_wheel + python setup.py bdist_wheel env: pythonLocation: ${{ env.pythonLocation }} @@ -232,16 +232,15 @@ jobs: run: | Get-ChildItem -Recurse -Filter "mgclient.cp*.pyd" -Path $env:pythonLocation - - name: Check mgclient.pyd DLL Dependencies - uses: microsoft/setup-msbuild@v1.3.1 - run: | - $mgclientPath = Get-ChildItem -Recurse -Filter "mgclient.cp*.pyd" -Path $env:pythonLocation | Select-Object -ExpandProperty FullName - if (Test-Path "$mgclientPath") { - dumpbin /DEPENDENTS "$mgclientPath" - } else { - Write-Host "mgclient.pyd not found!" - exit 1 - } + # - name: Check mgclient.pyd DLL Dependencies + # run: | + # $mgclientPath = Get-ChildItem -Recurse -Filter "mgclient.cp*.pyd" -Path $env:pythonLocation | Select-Object -ExpandProperty FullName + # if (Test-Path "$mgclientPath") { + # dumpbin /DEPENDENTS "$mgclientPath" + # } else { + # Write-Host "mgclient.pyd not found!" + # exit 1 + # } - name: Setup WSL Ubuntu uses: Vampire/setup-wsl@v5 From cd218b0ef1f18dbe9a86739d09a8ed7220f45130 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:11:41 +0100 Subject: [PATCH 081/227] added missing linker flags --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3c1d6949..39d23787 100644 --- a/setup.py +++ b/setup.py @@ -315,7 +315,7 @@ def set_extra_compile_args(): "Operating System :: Microsoft :: Windows", ], ext_modules=[ - Extension(EXTENSION_NAME, sources=sources, depends=headers, extra_compile_args=set_extra_compile_args()) + Extension(EXTENSION_NAME, sources=sources, depends=headers, extra_compile_args=set_extra_compile_args(), libraries=["ssl", "crypto", "crypt32", "ws2_32"]) ], project_urls={ "Source": "https://github.com/memgraph/pymgclient", From ef3fe5793e0af612ec119cb119ac516eadb4f581 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:15:51 +0100 Subject: [PATCH 082/227] added missing linker flags --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 39d23787..6ab11374 100644 --- a/setup.py +++ b/setup.py @@ -236,6 +236,7 @@ def build_mgclient_for(self, extension: Extension): "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", + "-DCMAKE_EXE_LINKER_FLAGS=-lcrypt32 -lws2_32", ] finalize_cmake_config_command = getattr(self, "finalize_cmake_config_command_" + sys.platform, None) From c3da2e733ba82fa8fd187e8ff43eca97eae78d77 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:19:17 +0100 Subject: [PATCH 083/227] added missing linker flags --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 6ab11374..bdb5eb3f 100644 --- a/setup.py +++ b/setup.py @@ -236,6 +236,7 @@ def build_mgclient_for(self, extension: Extension): "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", + "-DCMAKE_SHARED_LINKER_FLAGS=-lcrypt32 -lws2_32", "-DCMAKE_EXE_LINKER_FLAGS=-lcrypt32 -lws2_32", ] From 0a17e6f0c303bf68d57660b14628d0b27c6eeebb Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:24:33 +0100 Subject: [PATCH 084/227] added missing linker flags --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index bdb5eb3f..eefe5bac 100644 --- a/setup.py +++ b/setup.py @@ -238,6 +238,7 @@ def build_mgclient_for(self, extension: Extension): f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", "-DCMAKE_SHARED_LINKER_FLAGS=-lcrypt32 -lws2_32", "-DCMAKE_EXE_LINKER_FLAGS=-lcrypt32 -lws2_32", + "-DCMAKE_REQUIRED_LIBRARIES=\"crypt32;ws2_32\"" ] finalize_cmake_config_command = getattr(self, "finalize_cmake_config_command_" + sys.platform, None) From e00301218473a9e1637c9bf1120cc10b6c146614 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:28:51 +0100 Subject: [PATCH 085/227] added missing linker flags --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index eefe5bac..99cb185f 100644 --- a/setup.py +++ b/setup.py @@ -234,11 +234,12 @@ def build_mgclient_for(self, extension: Extension): f"-DCMAKE_INSTALL_PREFIX={mgclient_install_path}", "-DBUILD_TESTING=OFF", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", - f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', + f'-DCMAKE_C_FLAGS="{self.get_cflags()} -lcrypt32 -lws2_32"', + '-DCMAKE_CXX_FLAGS="-lcrypt32 -lws2_32"', f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", "-DCMAKE_SHARED_LINKER_FLAGS=-lcrypt32 -lws2_32", "-DCMAKE_EXE_LINKER_FLAGS=-lcrypt32 -lws2_32", - "-DCMAKE_REQUIRED_LIBRARIES=\"crypt32;ws2_32\"" + '-DCMAKE_REQUIRED_LIBRARIES="crypt32;ws2_32"' ] finalize_cmake_config_command = getattr(self, "finalize_cmake_config_command_" + sys.platform, None) From 9488f74f0f9f8eba8e8c5c8bb0dfe394a06158c6 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:36:19 +0100 Subject: [PATCH 086/227] added missing linker flags --- setup.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 99cb185f..12d38c8b 100644 --- a/setup.py +++ b/setup.py @@ -189,10 +189,7 @@ def finalize_linux(self, extension: Extension): self.finalize_linux_like(extension, ["ssl", "crypto"]) def get_cflags(self): - cflags = "{0} -Werror=all".format(os.getenv("CFLAGS", "")).strip() - if sys.platform.startswith("win") or "mingw" in platform.system().lower(): - return cflags - return cflags + return "{0} -Werror=all".format(os.getenv("CFLAGS", "")).strip() def build_mgclient_for(self, extension: Extension): """ @@ -234,12 +231,10 @@ def build_mgclient_for(self, extension: Extension): f"-DCMAKE_INSTALL_PREFIX={mgclient_install_path}", "-DBUILD_TESTING=OFF", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", - f'-DCMAKE_C_FLAGS="{self.get_cflags()} -lcrypt32 -lws2_32"', - '-DCMAKE_CXX_FLAGS="-lcrypt32 -lws2_32"', + f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", "-DCMAKE_SHARED_LINKER_FLAGS=-lcrypt32 -lws2_32", "-DCMAKE_EXE_LINKER_FLAGS=-lcrypt32 -lws2_32", - '-DCMAKE_REQUIRED_LIBRARIES="crypt32;ws2_32"' ] finalize_cmake_config_command = getattr(self, "finalize_cmake_config_command_" + sys.platform, None) From ef14244bdfbf65250f4c8f581013664df43a3e03 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:45:01 +0100 Subject: [PATCH 087/227] added missing linker flags --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 12d38c8b..84939879 100644 --- a/setup.py +++ b/setup.py @@ -235,6 +235,7 @@ def build_mgclient_for(self, extension: Extension): f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", "-DCMAKE_SHARED_LINKER_FLAGS=-lcrypt32 -lws2_32", "-DCMAKE_EXE_LINKER_FLAGS=-lcrypt32 -lws2_32", + '-DCMAKE_FIND_LIBRARY_SUFFIXES=".a"' ] finalize_cmake_config_command = getattr(self, "finalize_cmake_config_command_" + sys.platform, None) From 9ba352976ec70d32e0384622b4565f6c4e65125d Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:46:00 +0100 Subject: [PATCH 088/227] update mgclient --- mgclient | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgclient b/mgclient index 6f59c8a4..e4527ed6 160000 --- a/mgclient +++ b/mgclient @@ -1 +1 @@ -Subproject commit 6f59c8a4216d20e42e0943cf506d0ddb6241c29b +Subproject commit e4527ed69c38c7ed820e8be54611f3a12b42b34c From 8e3751acc18a5c86f4c448afc53ead719df9b339 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 12:57:36 +0100 Subject: [PATCH 089/227] revert changes --- .github/workflows/ci.yml | 4 ++-- setup.py | 15 ++------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e95c0a56..964f6e28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,7 +172,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022, windows-2025] + os: [windows-2022] python-version: ["3.11"] steps: @@ -216,7 +216,7 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):$PATH" - python setup.py bdist_wheel + python setup.py bdist_wheel --static-openssl=False env: pythonLocation: ${{ env.pythonLocation }} diff --git a/setup.py b/setup.py index 84939879..a362f108 100644 --- a/setup.py +++ b/setup.py @@ -232,10 +232,7 @@ def build_mgclient_for(self, extension: Extension): "-DBUILD_TESTING=OFF", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', - f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", - "-DCMAKE_SHARED_LINKER_FLAGS=-lcrypt32 -lws2_32", - "-DCMAKE_EXE_LINKER_FLAGS=-lcrypt32 -lws2_32", - '-DCMAKE_FIND_LIBRARY_SUFFIXES=".a"' + f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}" ] finalize_cmake_config_command = getattr(self, "finalize_cmake_config_command_" + sys.platform, None) @@ -273,14 +270,6 @@ def build_mgclient_for(self, extension: Extension): finalize(extension) -def set_extra_compile_args(): - args = ["-std=c99"] - if sys.platform.startswith("win") or "mingw" in platform.system().lower(): - args += ["-Werror=all"] - return args - -print(f"ARGS: {set_extra_compile_args()} {sys.platform}") - setup( name="pymgclient", version=version, @@ -315,7 +304,7 @@ def set_extra_compile_args(): "Operating System :: Microsoft :: Windows", ], ext_modules=[ - Extension(EXTENSION_NAME, sources=sources, depends=headers, extra_compile_args=set_extra_compile_args(), libraries=["ssl", "crypto", "crypt32", "ws2_32"]) + Extension(EXTENSION_NAME, sources=sources, depends=headers, libraries=["ssl", "crypto", "crypt32", "ws2_32"]) ], project_urls={ "Source": "https://github.com/memgraph/pymgclient", From 5d361dbb40cf016222a78d8f71384a4439c489fc Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:00:06 +0100 Subject: [PATCH 090/227] dynamic --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 964f6e28..6eb68efd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,7 +216,7 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):$PATH" - python setup.py bdist_wheel --static-openssl=False + python setup.py build_ext --static-openssl=False bdist_wheel env: pythonLocation: ${{ env.pythonLocation }} From 8313943c3a6ab0f07db13e5cf0894063d90fbb96 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:04:09 +0100 Subject: [PATCH 091/227] debug step --- .github/workflows/ci.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6eb68efd..af48d8eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -227,21 +227,18 @@ jobs: python -m pip install dist/*.whl env: pythonLocation: ${{ env.pythonLocation }} - - - name: Locate mgclient Python extension + + - name: Check mgclient.pyd DLL Dependencies (MSYS2) run: | - Get-ChildItem -Recurse -Filter "mgclient.cp*.pyd" -Path $env:pythonLocation + mgclient_path=$(find $pythonLocation -name "mgclient.cp*.pyd" | head -n1) + if [ -z "$mgclient_path" ]; then + echo "mgclient.pyd not found!" + exit 1 + fi + echo "Found: $mgclient_path" + objdump -p "$mgclient_path" | grep 'DLL Name' + shell: msys2 {0} - # - name: Check mgclient.pyd DLL Dependencies - # run: | - # $mgclientPath = Get-ChildItem -Recurse -Filter "mgclient.cp*.pyd" -Path $env:pythonLocation | Select-Object -ExpandProperty FullName - # if (Test-Path "$mgclientPath") { - # dumpbin /DEPENDENTS "$mgclientPath" - # } else { - # Write-Host "mgclient.pyd not found!" - # exit 1 - # } - - name: Setup WSL Ubuntu uses: Vampire/setup-wsl@v5 with: From 22a1db66ab2b662afba0110f6b07adc541f8fcf4 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:13:49 +0100 Subject: [PATCH 092/227] path --- .github/workflows/ci.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af48d8eb..4d8ac313 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,11 +181,6 @@ jobs: with: submodules: true - - name: Set up Windows Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - architecture: x64 - name: Set up MSYS2 uses: msys2/setup-msys2@v2 @@ -197,7 +192,19 @@ jobs: mingw-w64-x86_64-cmake mingw-w64-x86_64-make mingw-w64-x86_64-openssl + + - name: Add MSYS2 mingw64/bin to PATH + shell: pwsh + run: | + echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Set up Windows Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Debug Find OpenSSL DLLs shell: msys2 {0} run: | @@ -270,7 +277,7 @@ jobs: - name: Run Tests run: | - $env:Path += ";C:\msys64\mingw64\bin" + $env:Path = "C:\msys64\mingw64\bin;$env:Path" python -m pytest -v env: MEMGRAPH_HOST: localhost From 6c5941234429efef236c519791024d512d62a42f Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:22:18 +0100 Subject: [PATCH 093/227] path --- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d8ac313..1adae75d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -245,7 +245,32 @@ jobs: echo "Found: $mgclient_path" objdump -p "$mgclient_path" | grep 'DLL Name' shell: msys2 {0} + + - name: Check that required DLLs are in PATH + shell: pwsh + run: | + $dlls = @( + "libssl-3-x64.dll", + "libcrypto-3-x64.dll", + "python311.dll" + ) + foreach ($dll in $dlls) { + $found = $false + foreach ($dir in $env:Path.Split(";")) { + if (Test-Path (Join-Path $dir $dll)) { + Write-Host "✅ Found $dll in $dir" + $found = $true + break + } + } + if (-not $found) { + Write-Host "❌ Missing $dll" + exit 1 + } + } + + - name: Setup WSL Ubuntu uses: Vampire/setup-wsl@v5 with: @@ -275,6 +300,41 @@ jobs: - name: Wait for Memgraph to Start run: Start-Sleep -Seconds 10 + - name: Ensure required DLLs are available + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + + # Paths + $mingwBin = "C:\msys64\mingw64\bin" + $pythonLib = "$env:pythonLocation\Lib\site-packages" + + # DLLs that mgclient depends on + $dlls = @( + "libssl-3-x64.dll", + "libcrypto-3-x64.dll" + ) + + # Copy DLLs from MSYS2 into Python site-packages if missing + foreach ($dll in $dlls) { + $destPath = Join-Path $pythonLib $dll + if (-Not (Test-Path $destPath)) { + $srcPath = Join-Path $mingwBin $dll + if (Test-Path $srcPath) { + Copy-Item $srcPath -Destination $destPath + Write-Host "✅ Copied $dll to site-packages." + } else { + Write-Host "❌ $dll not found in $mingwBin!" + exit 1 + } + } else { + Write-Host "✅ $dll already present in site-packages." + } + } + + # python311.dll should already be available from pythonLocation, no need to move + + - name: Run Tests run: | $env:Path = "C:\msys64\mingw64\bin;$env:Path" From 0662fccb686bbea23173297b44a5bcea8dbacaf6 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:34:13 +0100 Subject: [PATCH 094/227] path --- .github/workflows/ci.yml | 137 ++++++++++++++++++++++++--------------- 1 file changed, 84 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1adae75d..6352fdaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -247,28 +247,42 @@ jobs: shell: msys2 {0} - name: Check that required DLLs are in PATH - shell: pwsh + shell: msys2 {0} run: | - $dlls = @( - "libssl-3-x64.dll", - "libcrypto-3-x64.dll", - "python311.dll" - ) - - foreach ($dll in $dlls) { - $found = $false - foreach ($dir in $env:Path.Split(";")) { - if (Test-Path (Join-Path $dir $dll)) { - Write-Host "✅ Found $dll in $dir" - $found = $true - break - } - } - if (-not $found) { - Write-Host "❌ Missing $dll" + export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" + echo "🔎 Checking for required DLLs in PATH:" + for dll in libssl-3-x64.dll libcrypto-3-x64.dll python311.dll; do + if command -v $dll >/dev/null 2>&1 || find /mingw64/bin -iname $dll; then + echo "✅ Found $dll" + else + echo "❌ Missing $dll" exit 1 - } - } + fi + done + + # - name: Check that required DLLs are in PATH + # shell: pwsh + # run: | + # $dlls = @( + # "libssl-3-x64.dll", + # "libcrypto-3-x64.dll", + # "python311.dll" + # ) + + # foreach ($dll in $dlls) { + # $found = $false + # foreach ($dir in $env:Path.Split(";")) { + # if (Test-Path (Join-Path $dir $dll)) { + # Write-Host "✅ Found $dll in $dir" + # $found = $true + # break + # } + # } + # if (-not $found) { + # Write-Host "❌ Missing $dll" + # exit 1 + # } + # } - name: Setup WSL Ubuntu @@ -300,47 +314,64 @@ jobs: - name: Wait for Memgraph to Start run: Start-Sleep -Seconds 10 - - name: Ensure required DLLs are available - shell: pwsh - run: | - $ErrorActionPreference = "Stop" + # - name: Ensure required DLLs are available + # shell: pwsh + # run: | + # $ErrorActionPreference = "Stop" - # Paths - $mingwBin = "C:\msys64\mingw64\bin" - $pythonLib = "$env:pythonLocation\Lib\site-packages" + # # Paths + # $mingwBin = "C:\msys64\mingw64\bin" + # $pythonLib = "$env:pythonLocation\Lib\site-packages" - # DLLs that mgclient depends on - $dlls = @( - "libssl-3-x64.dll", - "libcrypto-3-x64.dll" - ) + # # DLLs that mgclient depends on + # $dlls = @( + # "libssl-3-x64.dll", + # "libcrypto-3-x64.dll" + # ) - # Copy DLLs from MSYS2 into Python site-packages if missing - foreach ($dll in $dlls) { - $destPath = Join-Path $pythonLib $dll - if (-Not (Test-Path $destPath)) { - $srcPath = Join-Path $mingwBin $dll - if (Test-Path $srcPath) { - Copy-Item $srcPath -Destination $destPath - Write-Host "✅ Copied $dll to site-packages." - } else { - Write-Host "❌ $dll not found in $mingwBin!" - exit 1 - } - } else { - Write-Host "✅ $dll already present in site-packages." - } - } + # # Copy DLLs from MSYS2 into Python site-packages if missing + # foreach ($dll in $dlls) { + # $destPath = Join-Path $pythonLib $dll + # if (-Not (Test-Path $destPath)) { + # $srcPath = Join-Path $mingwBin $dll + # if (Test-Path $srcPath) { + # Copy-Item $srcPath -Destination $destPath + # Write-Host "✅ Copied $dll to site-packages." + # } else { + # Write-Host "❌ $dll not found in $mingwBin!" + # exit 1 + # } + # } else { + # Write-Host "✅ $dll already present in site-packages." + # } + # } - # python311.dll should already be available from pythonLocation, no need to move + # # python311.dll should already be available from pythonLocation, no need to move - - name: Run Tests + # - name: Run Tests + # run: | + # $env:Path = "C:\msys64\mingw64\bin;$env:Path" + # python -m pytest -v + # env: + # MEMGRAPH_HOST: localhost + - name: Copy required DLLs from MSYS2 to Python site-packages + shell: msys2 {0} run: | - $env:Path = "C:\msys64\mingw64\bin;$env:Path" - python -m pytest -v + set -e + PY_SITE_PACKAGES=$(cygpath -u "$pythonLocation")/Lib/site-packages + + for dll in libssl-3-x64.dll libcrypto-3-x64.dll; do + if [ -f /mingw64/bin/$dll ]; then + cp /mingw64/bin/$dll "$PY_SITE_PACKAGES" + echo "✅ Copied $dll to site-packages." + else + echo "❌ $dll not found in /mingw64/bin!" + exit 1 + fi + done env: - MEMGRAPH_HOST: localhost + pythonLocation: ${{ env.pythonLocation }} - name: Run Tests From 946bf2e2227a938d80e8eee48a727546118e8d9d Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:38:45 +0100 Subject: [PATCH 095/227] fix step --- .github/workflows/ci.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6352fdaa..4a204a17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,13 +252,22 @@ jobs: export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" echo "🔎 Checking for required DLLs in PATH:" for dll in libssl-3-x64.dll libcrypto-3-x64.dll python311.dll; do - if command -v $dll >/dev/null 2>&1 || find /mingw64/bin -iname $dll; then - echo "✅ Found $dll" - else - echo "❌ Missing $dll" + found=0 + for dir in $(echo $PATH | tr ':' '\n'); do + if [ -f "$dir/$dll" ]; then + echo "✅ Found $dll in $dir" + found=1 + break + fi + done + if [ "$found" -eq 0 ]; then + echo "❌ Missing $dll!" exit 1 fi done + env: + pythonLocation: ${{ env.pythonLocation }} + # - name: Check that required DLLs are in PATH # shell: pwsh From 0f6582f83bc96c3812a1aebd3aefbfcf75388c52 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:44:04 +0100 Subject: [PATCH 096/227] udpate memgraph step --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a204a17..bdb72290 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -313,12 +313,15 @@ jobs: - name: Install and Run Memgraph in WSL shell: wsl-bash {0} run: | + mkdir ~/memgraph sudo apt update sudo apt install -y curl curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. sudo apt install ./memgraph.deb - nohup sudo memgraph --bolt-port 7687 --telemetry-enabled=False & + openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + - name: Wait for Memgraph to Start run: Start-Sleep -Seconds 10 From fac7f55c93bc6efa0965bb86c6aca6801226ee8c Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:52:13 +0100 Subject: [PATCH 097/227] added empy var --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdb72290..dac71e49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -394,6 +394,7 @@ jobs: env: pythonLocation: ${{ env.pythonLocation }} MEMGRAPH_HOST: localhost + MEMGRAPH_STARTED_WITH_SSL: - name: Upload Wheel Artifact From d9c73d0aaca1d32bab3c21777b1beeb066320e13 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:54:06 +0100 Subject: [PATCH 098/227] added verification step --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dac71e49..892d5286 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -384,7 +384,16 @@ jobs: done env: pythonLocation: ${{ env.pythonLocation }} - + + - name: Verify Memgraph is running under WSL + shell: wsl-bash {0} + run: | + # process + if ! pgrep -x memgraph; then + echo "❌ Memgraph not running" >&2 + exit 1 + fi + echo "✅ Memgraph check passed" - name: Run Tests shell: msys2 {0} From 56ce7fa38a9b7257ee20102c924ecb94a8f41937 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 13:57:30 +0100 Subject: [PATCH 099/227] remove copy step --- .github/workflows/ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 892d5286..afb22810 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -367,23 +367,23 @@ jobs: # python -m pytest -v # env: # MEMGRAPH_HOST: localhost - - name: Copy required DLLs from MSYS2 to Python site-packages - shell: msys2 {0} - run: | - set -e - PY_SITE_PACKAGES=$(cygpath -u "$pythonLocation")/Lib/site-packages + # - name: Copy required DLLs from MSYS2 to Python site-packages + # shell: msys2 {0} + # run: | + # set -e + # PY_SITE_PACKAGES=$(cygpath -u "$pythonLocation")/Lib/site-packages - for dll in libssl-3-x64.dll libcrypto-3-x64.dll; do - if [ -f /mingw64/bin/$dll ]; then - cp /mingw64/bin/$dll "$PY_SITE_PACKAGES" - echo "✅ Copied $dll to site-packages." - else - echo "❌ $dll not found in /mingw64/bin!" - exit 1 - fi - done - env: - pythonLocation: ${{ env.pythonLocation }} + # for dll in libssl-3-x64.dll libcrypto-3-x64.dll; do + # if [ -f /mingw64/bin/$dll ]; then + # cp /mingw64/bin/$dll "$PY_SITE_PACKAGES" + # echo "✅ Copied $dll to site-packages." + # else + # echo "❌ $dll not found in /mingw64/bin!" + # exit 1 + # fi + # done + # env: + # pythonLocation: ${{ env.pythonLocation }} - name: Verify Memgraph is running under WSL shell: wsl-bash {0} From f4378e155f7161acc30393e74e560c0ce9de2195 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 14:06:00 +0100 Subject: [PATCH 100/227] remove unrecognised arg --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afb22810..a5a37b45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -320,7 +320,7 @@ jobs: sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. sudo apt install ./memgraph.deb openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - name: Wait for Memgraph to Start From 21a95138f87bcbf9d6fbad325a127cf67f8adaf3 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 14:12:05 +0100 Subject: [PATCH 101/227] mkdir --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5a37b45..b0d3c49d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -313,7 +313,7 @@ jobs: - name: Install and Run Memgraph in WSL shell: wsl-bash {0} run: | - mkdir ~/memgraph + mkdir -p ~/memgraph/data sudo apt update sudo apt install -y curl curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb From a45caa2e6939e52d120970d9ffabd4361809d2e9 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 14:20:04 +0100 Subject: [PATCH 102/227] try starting memgraph without ssl --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0d3c49d..89c45f06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -319,9 +319,9 @@ jobs: curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. sudo apt install ./memgraph.deb - openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - + # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" + # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - name: Wait for Memgraph to Start run: Start-Sleep -Seconds 10 From 4dda35077c26b1f67773317fc88da9f81231b107 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 14:31:08 +0100 Subject: [PATCH 103/227] print logs --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89c45f06..304fbaac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -321,10 +321,10 @@ jobs: sudo apt install ./memgraph.deb # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' > memgraph_stdout.log 2> memgraph_stderr.log & - name: Wait for Memgraph to Start - run: Start-Sleep -Seconds 10 + run: Start-Sleep -Seconds 1 # - name: Ensure required DLLs are available # shell: pwsh @@ -391,6 +391,8 @@ jobs: # process if ! pgrep -x memgraph; then echo "❌ Memgraph not running" >&2 + cat memgraph_stdout.log || true + cat memgraph_stderr.log || true exit 1 fi echo "✅ Memgraph check passed" From 9a3be71ee3e296cee1d53294f16b27d7d48dc245 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 14:38:48 +0100 Subject: [PATCH 104/227] remove nohup --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 304fbaac..38cbfcfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -321,7 +321,7 @@ jobs: sudo apt install ./memgraph.deb # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' > memgraph_stdout.log 2> memgraph_stderr.log & + /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' > memgraph_stdout.log 2> memgraph_stderr.log & - name: Wait for Memgraph to Start run: Start-Sleep -Seconds 1 From d27087e4cf6f8f73f036d0e7fc31a0dbd39b8733 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 14:39:22 +0100 Subject: [PATCH 105/227] remove nohup --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38cbfcfd..40c27626 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -321,7 +321,7 @@ jobs: sudo apt install ./memgraph.deb # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' > memgraph_stdout.log 2> memgraph_stderr.log & + /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' - name: Wait for Memgraph to Start run: Start-Sleep -Seconds 1 From ce278954f7dd4322979f2b08ff833d2adbaadd04 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 14:47:14 +0100 Subject: [PATCH 106/227] loosen check --- .github/workflows/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40c27626..a3ac729f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -321,7 +321,7 @@ jobs: sudo apt install ./memgraph.deb # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - name: Wait for Memgraph to Start run: Start-Sleep -Seconds 1 @@ -389,10 +389,8 @@ jobs: shell: wsl-bash {0} run: | # process - if ! pgrep -x memgraph; then + if ! pgrep -f /usr/lib/memgraph/memgraph; then echo "❌ Memgraph not running" >&2 - cat memgraph_stdout.log || true - cat memgraph_stderr.log || true exit 1 fi echo "✅ Memgraph check passed" From 3f3a080427328a96addb9f5f850dc3ecde125802 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 14:53:32 +0100 Subject: [PATCH 107/227] ps aux --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3ac729f..2dad4d60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -322,9 +322,10 @@ jobs: # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + ps aux | grep memgraph - - name: Wait for Memgraph to Start - run: Start-Sleep -Seconds 1 + # - name: Wait for Memgraph to Start + # run: Start-Sleep -Seconds 1 # - name: Ensure required DLLs are available # shell: pwsh @@ -389,12 +390,31 @@ jobs: shell: wsl-bash {0} run: | # process + ps aux | grep memgraph if ! pgrep -f /usr/lib/memgraph/memgraph; then echo "❌ Memgraph not running" >&2 exit 1 fi echo "✅ Memgraph check passed" + echo "🔍 Checking if port 7687 is open..." + if command -v ss >/dev/null 2>&1; then + ss -tln | grep ':7687' || (echo "❌ Port 7687 not open!" && exit 1) + elif command -v netstat >/dev/null 2>&1; then + netstat -an | grep ':7687' || (echo "❌ Port 7687 not open!" && exit 1) + else + echo "⚠️ Warning: Neither ss nor netstat is available to check ports." + exit 1 + fi + echo "✅ Memgraph port 7687 is open." + + - name: Verify Memgraph is reachable from Windows (MSYS2) + shell: msys2 {0} + run: | + echo "🔍 Checking connection to Memgraph from MSYS2 shell..." + timeout 3 bash -c " Date: Tue, 29 Apr 2025 15:05:58 +0100 Subject: [PATCH 108/227] added strange --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dad4d60..287d45ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -535,7 +535,8 @@ jobs: - '3.11' - '3.12' - '3.13' - # include: + include: + - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} # - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.13'} # - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.9'} runs-on: ${{ matrix.platform }} From 98e02754ab24e2478eb4ec2d8b73913785f31c64 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 15:13:24 +0100 Subject: [PATCH 109/227] sleep --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 287d45ce..4dfb95bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -322,6 +322,7 @@ jobs: # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + sleep 10 ps aux | grep memgraph # - name: Wait for Memgraph to Start From 20d5fd906dad15008ae809d4ce6f5b52a56ab7c5 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 15:23:21 +0100 Subject: [PATCH 110/227] print log --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dfb95bc..0f709fd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -321,9 +321,10 @@ jobs: sudo apt install ./memgraph.deb # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='~/memgraph/memgraph.log' & sleep 10 ps aux | grep memgraph + cat ~/memgraph/memgraph.log || true # - name: Wait for Memgraph to Start # run: Start-Sleep -Seconds 1 @@ -394,6 +395,7 @@ jobs: ps aux | grep memgraph if ! pgrep -f /usr/lib/memgraph/memgraph; then echo "❌ Memgraph not running" >&2 + cat ~/memgraph/memgraph.log || true exit 1 fi echo "✅ Memgraph check passed" @@ -433,6 +435,13 @@ jobs: name: pymgclient-win-${{ matrix.os }}-py${{ matrix.python-version }} path: dist/ + - name: Print Log + shell: wsl-bash {0} + if: always() + run: | + cat ~/memgraph/memgraph.log || true + + # build_and_test_windows: # # if: ${{ github.event_name == 'workflow_dispatch' }} # strategy: From ed6f86195f9a3df60cb6f399b38da00adac67d1c Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 15:37:44 +0100 Subject: [PATCH 111/227] added DLL hack --- .github/workflows/ci.yml | 60 +++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f709fd9..50ca8848 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -326,42 +326,40 @@ jobs: ps aux | grep memgraph cat ~/memgraph/memgraph.log || true - # - name: Wait for Memgraph to Start - # run: Start-Sleep -Seconds 1 - # - name: Ensure required DLLs are available - # shell: pwsh - # run: | - # $ErrorActionPreference = "Stop" + - name: Ensure required DLLs are available + shell: pwsh + run: | + $ErrorActionPreference = "Stop" - # # Paths - # $mingwBin = "C:\msys64\mingw64\bin" - # $pythonLib = "$env:pythonLocation\Lib\site-packages" + # Paths + $mingwBin = "C:\msys64\mingw64\bin" + $pythonLib = "$env:pythonLocation\Lib\site-packages" - # # DLLs that mgclient depends on - # $dlls = @( - # "libssl-3-x64.dll", - # "libcrypto-3-x64.dll" - # ) + # DLLs that mgclient depends on + $dlls = @( + "libssl-3-x64.dll", + "libcrypto-3-x64.dll" + ) - # # Copy DLLs from MSYS2 into Python site-packages if missing - # foreach ($dll in $dlls) { - # $destPath = Join-Path $pythonLib $dll - # if (-Not (Test-Path $destPath)) { - # $srcPath = Join-Path $mingwBin $dll - # if (Test-Path $srcPath) { - # Copy-Item $srcPath -Destination $destPath - # Write-Host "✅ Copied $dll to site-packages." - # } else { - # Write-Host "❌ $dll not found in $mingwBin!" - # exit 1 - # } - # } else { - # Write-Host "✅ $dll already present in site-packages." - # } - # } + # Copy DLLs from MSYS2 into Python site-packages if missing + foreach ($dll in $dlls) { + $destPath = Join-Path $pythonLib $dll + if (-Not (Test-Path $destPath)) { + $srcPath = Join-Path $mingwBin $dll + if (Test-Path $srcPath) { + Copy-Item $srcPath -Destination $destPath + Write-Host "✅ Copied $dll to site-packages." + } else { + Write-Host "❌ $dll not found in $mingwBin!" + exit 1 + } + } else { + Write-Host "✅ $dll already present in site-packages." + } + } - # # python311.dll should already be available from pythonLocation, no need to move + # python311.dll should already be available from pythonLocation, no need to move # - name: Run Tests From 9099624fd5afa939ca12615829915fc90f25d81d Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 15:38:24 +0100 Subject: [PATCH 112/227] trace --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50ca8848..4df21c7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -321,7 +321,7 @@ jobs: sudo apt install ./memgraph.deb # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='~/memgraph/memgraph.log' & + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='/root/memgraph/memgraph.log' & sleep 10 ps aux | grep memgraph cat ~/memgraph/memgraph.log || true From 2a94b228533a5ee10e524cdb78e7bb9c5081faec Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 15:49:14 +0100 Subject: [PATCH 113/227] use different step --- .github/workflows/ci.yml | 90 ++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4df21c7f..e0b0673f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -327,39 +327,39 @@ jobs: cat ~/memgraph/memgraph.log || true - - name: Ensure required DLLs are available - shell: pwsh - run: | - $ErrorActionPreference = "Stop" + # - name: Ensure required DLLs are available + # shell: pwsh + # run: | + # $ErrorActionPreference = "Stop" - # Paths - $mingwBin = "C:\msys64\mingw64\bin" - $pythonLib = "$env:pythonLocation\Lib\site-packages" + # # Paths + # $mingwBin = "C:\msys64\mingw64\bin" + # $pythonLib = "$env:pythonLocation\Lib\site-packages" - # DLLs that mgclient depends on - $dlls = @( - "libssl-3-x64.dll", - "libcrypto-3-x64.dll" - ) + # # DLLs that mgclient depends on + # $dlls = @( + # "libssl-3-x64.dll", + # "libcrypto-3-x64.dll" + # ) - # Copy DLLs from MSYS2 into Python site-packages if missing - foreach ($dll in $dlls) { - $destPath = Join-Path $pythonLib $dll - if (-Not (Test-Path $destPath)) { - $srcPath = Join-Path $mingwBin $dll - if (Test-Path $srcPath) { - Copy-Item $srcPath -Destination $destPath - Write-Host "✅ Copied $dll to site-packages." - } else { - Write-Host "❌ $dll not found in $mingwBin!" - exit 1 - } - } else { - Write-Host "✅ $dll already present in site-packages." - } - } + # # Copy DLLs from MSYS2 into Python site-packages if missing + # foreach ($dll in $dlls) { + # $destPath = Join-Path $pythonLib $dll + # if (-Not (Test-Path $destPath)) { + # $srcPath = Join-Path $mingwBin $dll + # if (Test-Path $srcPath) { + # Copy-Item $srcPath -Destination $destPath + # Write-Host "✅ Copied $dll to site-packages." + # } else { + # Write-Host "❌ $dll not found in $mingwBin!" + # exit 1 + # } + # } else { + # Write-Host "✅ $dll already present in site-packages." + # } + # } - # python311.dll should already be available from pythonLocation, no need to move + # # python311.dll should already be available from pythonLocation, no need to move # - name: Run Tests @@ -368,23 +368,23 @@ jobs: # python -m pytest -v # env: # MEMGRAPH_HOST: localhost - # - name: Copy required DLLs from MSYS2 to Python site-packages - # shell: msys2 {0} - # run: | - # set -e - # PY_SITE_PACKAGES=$(cygpath -u "$pythonLocation")/Lib/site-packages + - name: Copy required DLLs from MSYS2 to Python site-packages + shell: msys2 {0} + run: | + set -e + PY_SITE_PACKAGES=$(cygpath -u "$pythonLocation")/Lib/site-packages - # for dll in libssl-3-x64.dll libcrypto-3-x64.dll; do - # if [ -f /mingw64/bin/$dll ]; then - # cp /mingw64/bin/$dll "$PY_SITE_PACKAGES" - # echo "✅ Copied $dll to site-packages." - # else - # echo "❌ $dll not found in /mingw64/bin!" - # exit 1 - # fi - # done - # env: - # pythonLocation: ${{ env.pythonLocation }} + for dll in libssl-3-x64.dll libcrypto-3-x64.dll; do + if [ -f /mingw64/bin/$dll ]; then + cp /mingw64/bin/$dll "$PY_SITE_PACKAGES" + echo "✅ Copied $dll to site-packages." + else + echo "❌ $dll not found in /mingw64/bin!" + exit 1 + fi + done + env: + pythonLocation: ${{ env.pythonLocation }} - name: Verify Memgraph is running under WSL shell: wsl-bash {0} From 2220ba5ae65ec9927913acfc80f5dc0ed45d5036 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 15:53:01 +0100 Subject: [PATCH 114/227] use home --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0b0673f..4d7eec03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -313,7 +313,7 @@ jobs: - name: Install and Run Memgraph in WSL shell: wsl-bash {0} run: | - mkdir -p ~/memgraph/data + mkdir -p $HOME/memgraph/data sudo apt update sudo apt install -y curl curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb @@ -321,10 +321,10 @@ jobs: sudo apt install ./memgraph.deb # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='/root/memgraph/memgraph.log' & + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='$HOME/memgraph/memgraph.log' & sleep 10 ps aux | grep memgraph - cat ~/memgraph/memgraph.log || true + cat $HOME/memgraph/memgraph.log || true # - name: Ensure required DLLs are available @@ -393,7 +393,7 @@ jobs: ps aux | grep memgraph if ! pgrep -f /usr/lib/memgraph/memgraph; then echo "❌ Memgraph not running" >&2 - cat ~/memgraph/memgraph.log || true + cat $HOME/memgraph/memgraph.log || true exit 1 fi echo "✅ Memgraph check passed" @@ -437,7 +437,7 @@ jobs: shell: wsl-bash {0} if: always() run: | - cat ~/memgraph/memgraph.log || true + cat $HOME/memgraph/memgraph.log || true # build_and_test_windows: From d13cbd5bec4ac8c56d5c8c085c40f156260fa4f7 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 16:06:02 +0100 Subject: [PATCH 115/227] try strange --- .github/workflows/ci.yml | 169 ++------------------------------------- 1 file changed, 5 insertions(+), 164 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d7eec03..c1593103 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -268,31 +268,6 @@ jobs: env: pythonLocation: ${{ env.pythonLocation }} - - # - name: Check that required DLLs are in PATH - # shell: pwsh - # run: | - # $dlls = @( - # "libssl-3-x64.dll", - # "libcrypto-3-x64.dll", - # "python311.dll" - # ) - - # foreach ($dll in $dlls) { - # $found = $false - # foreach ($dir in $env:Path.Split(";")) { - # if (Test-Path (Join-Path $dir $dll)) { - # Write-Host "✅ Found $dll in $dir" - # $found = $true - # break - # } - # } - # if (-not $found) { - # Write-Host "❌ Missing $dll" - # exit 1 - # } - # } - - name: Setup WSL Ubuntu uses: Vampire/setup-wsl@v5 @@ -326,48 +301,6 @@ jobs: ps aux | grep memgraph cat $HOME/memgraph/memgraph.log || true - - # - name: Ensure required DLLs are available - # shell: pwsh - # run: | - # $ErrorActionPreference = "Stop" - - # # Paths - # $mingwBin = "C:\msys64\mingw64\bin" - # $pythonLib = "$env:pythonLocation\Lib\site-packages" - - # # DLLs that mgclient depends on - # $dlls = @( - # "libssl-3-x64.dll", - # "libcrypto-3-x64.dll" - # ) - - # # Copy DLLs from MSYS2 into Python site-packages if missing - # foreach ($dll in $dlls) { - # $destPath = Join-Path $pythonLib $dll - # if (-Not (Test-Path $destPath)) { - # $srcPath = Join-Path $mingwBin $dll - # if (Test-Path $srcPath) { - # Copy-Item $srcPath -Destination $destPath - # Write-Host "✅ Copied $dll to site-packages." - # } else { - # Write-Host "❌ $dll not found in $mingwBin!" - # exit 1 - # } - # } else { - # Write-Host "✅ $dll already present in site-packages." - # } - # } - - # # python311.dll should already be available from pythonLocation, no need to move - - - # - name: Run Tests - # run: | - # $env:Path = "C:\msys64\mingw64\bin;$env:Path" - # python -m pytest -v - # env: - # MEMGRAPH_HOST: localhost - name: Copy required DLLs from MSYS2 to Python site-packages shell: msys2 {0} run: | @@ -440,113 +373,21 @@ jobs: cat $HOME/memgraph/memgraph.log || true - # build_and_test_windows: - # # if: ${{ github.event_name == 'workflow_dispatch' }} - # strategy: - # fail-fast: false - # matrix: - # os: [windows-2022, windows-2025] - # arch: - # - { mingw: "64", msys: x86_64, python: "x64" } - # python_version: - # # - '3.7' # this does work, but do we bother with such an old version? - # - '3.10' - # - '3.11' - # - '3.12' - # - '3.13' - # runs-on: ${{ matrix.os }} - # steps: - # - uses: actions/checkout@v4 - # with: - # submodules: true - # - name: Setup python - # uses: actions/setup-python@v2.2.2 - # with: - # python-version: ${{ matrix.python_version }} - # architecture: ${{ matrix.arch.python }} - # - uses: msys2/setup-msys2@v2 - # with: - # msystem: MINGW${{ matrix.arch.mingw }} - # update: true - # release: false - # install: > - # git - # mingw-w64-${{ matrix.arch.msys }}-toolchain - # mingw-w64-${{ matrix.arch.msys }}-cmake - # mingw-w64-${{ matrix.arch.msys }}-openssl - # mingw-w64-${{ matrix.arch.msys }}-python-pip - # mingw-w64-${{ matrix.arch.msys }}-python-pytest - # - name: Add mingw${{ matrix.arch.mingw }} to PATH - # run: | - # # First make sure python would resolve to the windows native python, not mingw one - # echo "C:\msys64\mingw${{ matrix.arch.mingw }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - # echo "${{ env.pythonLocation }}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - # - name: Print OpenSSL version - # shell: msys2 {0} - # run: | - # openssl version -a - # - uses: Vampire/setup-wsl@v5 - # with: - # distribution: Ubuntu-24.04 - # - name: Set Memgraph Version - # shell: bash -l {0} - # run: | - # mgversion=$( - # curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ - # | grep -m1 '"tag_name":' \ - # | sed -E 's/.*"([^"]+)".*/\1/' \ - # | sed 's/^v//' - # ) - # echo "MGVERSION=$mgversion" >> $GITHUB_ENV - # - name: Download, install and run Memgraph under WSL - # shell: wsl-bash {0} # root shell - # run: | - # mkdir ~/memgraph - # curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb --output ~/memgraph/memgraph.deb - # dpkg -i ~/memgraph/memgraph.deb - # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" - # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - # sleep 1 # Wait for Memgraph a bit. - # - run: python -m pip install -U pip wheel setuptools pytest pyopenssl - # - name: Build pymgclient - # shell: msys2 {0} - # run: | - # python -m pip install setuptools - # python setup.py build_ext --static-openssl=False bdist_wheel - # - name: Install pymgclient - # shell: msys2 {0} - # run: python -m pip install --verbose dist/*.whl - # env: - # VERBOSE: 1 - # - name: Run tests - # shell: msys2 {0} - # run: | - # python3 -m pytest -v - # env: - # MEMGRAPH_HOST: "localhost" - # MEMGRAPH_STARTED_WITH_SSL: - # - name: Save wheel package - # uses: actions/upload-artifact@v4 - # with: - # name: pymgclient-win${{ matrix.arch.mingw }}-${{ matrix.python_version }} - # path: dist/ build_macos: - if: ${{ github.event_name == 'workflow_dispatch' }} + #if: ${{ github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: platform: [macos-15, macos-14] python_version: #- '3.9' # this does work, but is old - - '3.10' - - '3.11' - - '3.12' - - '3.13' + # - '3.10' + # - '3.11' + # - '3.12' + # - '3.13' include: - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} - # - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.13'} - # - {platform: [macOS-15, ARM64, self-hosted], python_version: '3.9'} runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 From 4ae35cd6c2185a1992d832b0bc255d83c22d2101 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 16:06:18 +0100 Subject: [PATCH 116/227] use home --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1593103..1194f782 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -385,7 +385,7 @@ jobs: # - '3.10' # - '3.11' # - '3.12' - # - '3.13' + - '3.13' include: - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} runs-on: ${{ matrix.platform }} From e961b441a46142a1a9fcd89ff63302c1add55164 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 16:18:37 +0100 Subject: [PATCH 117/227] remove slow steps --- .github/workflows/ci.yml | 113 ++++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1194f782..748ee5e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -269,37 +269,37 @@ jobs: pythonLocation: ${{ env.pythonLocation }} - - name: Setup WSL Ubuntu - uses: Vampire/setup-wsl@v5 - with: - distribution: Ubuntu-24.04 - - - name: Set Memgraph Version - shell: bash -l {0} - run: | - mgversion=$( - curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ - | grep -m1 '"tag_name":' \ - | sed -E 's/.*"([^"]+)".*/\1/' \ - | sed 's/^v//' - ) - echo "MGVERSION=$mgversion" >> $GITHUB_ENV - - - name: Install and Run Memgraph in WSL - shell: wsl-bash {0} - run: | - mkdir -p $HOME/memgraph/data - sudo apt update - sudo apt install -y curl - curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb - sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. - sudo apt install ./memgraph.deb - # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" - # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='$HOME/memgraph/memgraph.log' & - sleep 10 - ps aux | grep memgraph - cat $HOME/memgraph/memgraph.log || true + # - name: Setup WSL Ubuntu + # uses: Vampire/setup-wsl@v5 + # with: + # distribution: Ubuntu-24.04 + + # - name: Set Memgraph Version + # shell: bash -l {0} + # run: | + # mgversion=$( + # curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ + # | grep -m1 '"tag_name":' \ + # | sed -E 's/.*"([^"]+)".*/\1/' \ + # | sed 's/^v//' + # ) + # echo "MGVERSION=$mgversion" >> $GITHUB_ENV + + # - name: Install and Run Memgraph in WSL + # shell: wsl-bash {0} + # run: | + # mkdir -p $HOME/memgraph/data + # sudo apt update + # sudo apt install -y curl + # curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb + # sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. + # sudo apt install ./memgraph.deb + # # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" + # # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='$HOME/memgraph/memgraph.log' & + # sleep 10 + # ps aux | grep memgraph + # cat $HOME/memgraph/memgraph.log || true - name: Copy required DLLs from MSYS2 to Python site-packages shell: msys2 {0} @@ -319,28 +319,28 @@ jobs: env: pythonLocation: ${{ env.pythonLocation }} - - name: Verify Memgraph is running under WSL - shell: wsl-bash {0} - run: | - # process - ps aux | grep memgraph - if ! pgrep -f /usr/lib/memgraph/memgraph; then - echo "❌ Memgraph not running" >&2 - cat $HOME/memgraph/memgraph.log || true - exit 1 - fi - echo "✅ Memgraph check passed" - - echo "🔍 Checking if port 7687 is open..." - if command -v ss >/dev/null 2>&1; then - ss -tln | grep ':7687' || (echo "❌ Port 7687 not open!" && exit 1) - elif command -v netstat >/dev/null 2>&1; then - netstat -an | grep ':7687' || (echo "❌ Port 7687 not open!" && exit 1) - else - echo "⚠️ Warning: Neither ss nor netstat is available to check ports." - exit 1 - fi - echo "✅ Memgraph port 7687 is open." + # - name: Verify Memgraph is running under WSL + # shell: wsl-bash {0} + # run: | + # # process + # ps aux | grep memgraph + # if ! pgrep -f /usr/lib/memgraph/memgraph; then + # echo "❌ Memgraph not running" >&2 + # cat $HOME/memgraph/memgraph.log || true + # exit 1 + # fi + # echo "✅ Memgraph check passed" + + # echo "🔍 Checking if port 7687 is open..." + # if command -v ss >/dev/null 2>&1; then + # ss -tln | grep ':7687' || (echo "❌ Port 7687 not open!" && exit 1) + # elif command -v netstat >/dev/null 2>&1; then + # netstat -an | grep ':7687' || (echo "❌ Port 7687 not open!" && exit 1) + # else + # echo "⚠️ Warning: Neither ss nor netstat is available to check ports." + # exit 1 + # fi + # echo "✅ Memgraph port 7687 is open." - name: Verify Memgraph is reachable from Windows (MSYS2) shell: msys2 {0} @@ -353,6 +353,7 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" + python -c "import mgbuild" python -m pytest -v env: pythonLocation: ${{ env.pythonLocation }} @@ -379,13 +380,13 @@ jobs: strategy: fail-fast: false matrix: - platform: [macos-15, macos-14] - python_version: + #platform: [macos-15, macos-14] + #python_version: #- '3.9' # this does work, but is old # - '3.10' # - '3.11' # - '3.12' - - '3.13' + # - '3.13' include: - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} runs-on: ${{ matrix.platform }} From a9022cf4e7857c5b4fb4b719f226333493483847 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 16:21:52 +0100 Subject: [PATCH 118/227] hide more steps --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 748ee5e6..6fc784e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -342,11 +342,11 @@ jobs: # fi # echo "✅ Memgraph port 7687 is open." - - name: Verify Memgraph is reachable from Windows (MSYS2) - shell: msys2 {0} - run: | - echo "🔍 Checking connection to Memgraph from MSYS2 shell..." - timeout 3 bash -c " Date: Tue, 29 Apr 2025 16:25:42 +0100 Subject: [PATCH 119/227] hide more steps --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fc784e3..ff447c37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -355,6 +355,7 @@ jobs: export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" python -c "import mgbuild" python -m pytest -v + env: pythonLocation: ${{ env.pythonLocation }} MEMGRAPH_HOST: localhost From c42407aea918c942ee424215cc111ec1c8c85968 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 16:45:32 +0100 Subject: [PATCH 120/227] update ci --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff447c37..2e1a9063 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -353,9 +353,10 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" + cd .. python -c "import mgbuild" python -m pytest -v - + env: pythonLocation: ${{ env.pythonLocation }} MEMGRAPH_HOST: localhost From 1185bdf4fbb630352ac595e7e26b64affeffdb3a Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 16:49:32 +0100 Subject: [PATCH 121/227] use client --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e1a9063..ae382c07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -354,7 +354,7 @@ jobs: run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" cd .. - python -c "import mgbuild" + python -c "import mgclient" python -m pytest -v env: From 8ba661b190df50824dc62cca1b2c533fd14f9b04 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 16:51:01 +0100 Subject: [PATCH 122/227] path --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae382c07..9599b061 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -353,6 +353,7 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" + echo $PATH cd .. python -c "import mgclient" python -m pytest -v From d222fb1e015491de61ba639a25fcda2d451bbb3e Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 16:59:31 +0100 Subject: [PATCH 123/227] use msys --- .github/workflows/ci.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9599b061..944f167f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -194,9 +194,10 @@ jobs: mingw-w64-x86_64-openssl - name: Add MSYS2 mingw64/bin to PATH - shell: pwsh + shell: msys2 {0} run: | - echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "/mingw64/bin" >> $GITHUB_PATH + - name: Set up Windows Python uses: actions/setup-python@v5 @@ -212,12 +213,20 @@ jobs: find /mingw64/bin -iname "*crypto*.dll" - name: Add Windows Python to PATH + shell: msys2 {0} run: | - echo "${{ env.pythonLocation }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 + echo "$pythonLocation" >> $GITHUB_PATH + env: + pythonLocation: ${{ env.pythonLocation }} + - name: Install Python build tools + shell: msys2 {0} run: | + export PATH="$(cygpath -u "$pythonLocation"):$PATH" python -m pip install --upgrade pip setuptools wheel pyopenssl pytest + env: + pythonLocation: ${{ env.pythonLocation }} - name: Build pymgclient Wheel shell: msys2 {0} @@ -356,7 +365,7 @@ jobs: echo $PATH cd .. python -c "import mgclient" - python -m pytest -v + # python -m pytest -v env: pythonLocation: ${{ env.pythonLocation }} @@ -379,7 +388,7 @@ jobs: build_macos: - #if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: From 9c9391628e83be1b6031a311e062307ee6b83754 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:06:09 +0100 Subject: [PATCH 124/227] back to static --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 944f167f..5679df28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,7 +232,7 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):$PATH" - python setup.py build_ext --static-openssl=False bdist_wheel + python setup.py bdist_wheel env: pythonLocation: ${{ env.pythonLocation }} From e60bb018acdd76154bce8b486639acdb409c1351 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:13:30 +0100 Subject: [PATCH 125/227] setup.py --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a362f108..a582a81c 100644 --- a/setup.py +++ b/setup.py @@ -232,7 +232,8 @@ def build_mgclient_for(self, extension: Extension): "-DBUILD_TESTING=OFF", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', - f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}" + f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", + '-DPKG_CONFIG_EXECUTABLE="pkg-config --static"' ] finalize_cmake_config_command = getattr(self, "finalize_cmake_config_command_" + sys.platform, None) From 5deca15da36cd2fdd0095d7c9b8defb72e8fe763 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:14:18 +0100 Subject: [PATCH 126/227] print pkgconfig --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5679df28..2d259f75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -259,6 +259,7 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" + pkg-config --libs --static libcrypto echo "🔎 Checking for required DLLs in PATH:" for dll in libssl-3-x64.dll libcrypto-3-x64.dll python311.dll; do found=0 From 71025c20b5ab69e1c436fba44a07df98cc559e0a Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:19:44 +0100 Subject: [PATCH 127/227] move check --- .github/workflows/ci.yml | 46 +++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d259f75..3b91d69f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,6 +228,29 @@ jobs: env: pythonLocation: ${{ env.pythonLocation }} + - name: Check that required DLLs are in PATH + shell: msys2 {0} + run: | + export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" + pkg-config --libs --static libcrypto + echo "🔎 Checking for required DLLs in PATH:" + for dll in libssl-3-x64.dll libcrypto-3-x64.dll python311.dll; do + found=0 + for dir in $(echo $PATH | tr ':' '\n'); do + if [ -f "$dir/$dll" ]; then + echo "✅ Found $dll in $dir" + found=1 + break + fi + done + if [ "$found" -eq 0 ]; then + echo "❌ Missing $dll!" + exit 1 + fi + done + env: + pythonLocation: ${{ env.pythonLocation }} + - name: Build pymgclient Wheel shell: msys2 {0} run: | @@ -255,28 +278,7 @@ jobs: objdump -p "$mgclient_path" | grep 'DLL Name' shell: msys2 {0} - - name: Check that required DLLs are in PATH - shell: msys2 {0} - run: | - export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" - pkg-config --libs --static libcrypto - echo "🔎 Checking for required DLLs in PATH:" - for dll in libssl-3-x64.dll libcrypto-3-x64.dll python311.dll; do - found=0 - for dir in $(echo $PATH | tr ':' '\n'); do - if [ -f "$dir/$dll" ]; then - echo "✅ Found $dll in $dir" - found=1 - break - fi - done - if [ "$found" -eq 0 ]; then - echo "❌ Missing $dll!" - exit 1 - fi - done - env: - pythonLocation: ${{ env.pythonLocation }} + # - name: Setup WSL Ubuntu From 8ae59525058faed4402a6d8058ce0b75a437c1e4 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:24:53 +0100 Subject: [PATCH 128/227] update flags --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a582a81c..366a0809 100644 --- a/setup.py +++ b/setup.py @@ -233,7 +233,9 @@ def build_mgclient_for(self, extension: Extension): "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", - '-DPKG_CONFIG_EXECUTABLE="pkg-config --static"' + '-DPKG_CONFIG_EXECUTABLE="pkg-config --static"', + '-DCMAKE_SHARED_LINKER_FLAGS="-lcrypt32 -lws2_32 -lgdi32"', + '-DCMAKE_EXE_LINKER_FLAGS="-lcrypt32 -lws2_32 -lgdi32"' ] finalize_cmake_config_command = getattr(self, "finalize_cmake_config_command_" + sys.platform, None) From 9087fc913d5a18bc86477de61fe5c1959b46dc36 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:29:12 +0100 Subject: [PATCH 129/227] update flags --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 366a0809..3d64c9c3 100644 --- a/setup.py +++ b/setup.py @@ -233,7 +233,7 @@ def build_mgclient_for(self, extension: Extension): "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", - '-DPKG_CONFIG_EXECUTABLE="pkg-config --static"', + "-DPKG_CONFIG_USE_STATIC_LIBS=ON", '-DCMAKE_SHARED_LINKER_FLAGS="-lcrypt32 -lws2_32 -lgdi32"', '-DCMAKE_EXE_LINKER_FLAGS="-lcrypt32 -lws2_32 -lgdi32"' ] From 4c91cf60084b088c3c3580746d184c0e60cf0ad1 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:38:04 +0100 Subject: [PATCH 130/227] update cmakelists --- mgclient | 2 +- setup.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mgclient b/mgclient index e4527ed6..2e2910e2 160000 --- a/mgclient +++ b/mgclient @@ -1 +1 @@ -Subproject commit e4527ed69c38c7ed820e8be54611f3a12b42b34c +Subproject commit 2e2910e2d087e5c0f5d426b5f44b5ff112d07249 diff --git a/setup.py b/setup.py index 3d64c9c3..1ecd0c4c 100644 --- a/setup.py +++ b/setup.py @@ -233,9 +233,7 @@ def build_mgclient_for(self, extension: Extension): "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", f'-DCMAKE_C_FLAGS="{self.get_cflags()}"', f"-DOPENSSL_USE_STATIC_LIBS={'ON' if self.static_openssl else 'OFF'}", - "-DPKG_CONFIG_USE_STATIC_LIBS=ON", - '-DCMAKE_SHARED_LINKER_FLAGS="-lcrypt32 -lws2_32 -lgdi32"', - '-DCMAKE_EXE_LINKER_FLAGS="-lcrypt32 -lws2_32 -lgdi32"' + "-DPKG_CONFIG_USE_STATIC_LIBS=ON" ] finalize_cmake_config_command = getattr(self, "finalize_cmake_config_command_" + sys.platform, None) From af40c4aab85fe17c34e83aa90570a881856d6ef6 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:42:20 +0100 Subject: [PATCH 131/227] update cmakelists --- mgclient | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgclient b/mgclient index 2e2910e2..7a47be3f 160000 --- a/mgclient +++ b/mgclient @@ -1 +1 @@ -Subproject commit 2e2910e2d087e5c0f5d426b5f44b5ff112d07249 +Subproject commit 7a47be3fef5ee650148eb25a70f0f4b147dd8cd9 From dac94cccbab0ab4fa515a87acac94a5a1967488f Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:45:08 +0100 Subject: [PATCH 132/227] remove copy dll --- .github/workflows/ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b91d69f..59fdfa28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -313,23 +313,23 @@ jobs: # ps aux | grep memgraph # cat $HOME/memgraph/memgraph.log || true - - name: Copy required DLLs from MSYS2 to Python site-packages - shell: msys2 {0} - run: | - set -e - PY_SITE_PACKAGES=$(cygpath -u "$pythonLocation")/Lib/site-packages + # - name: Copy required DLLs from MSYS2 to Python site-packages + # shell: msys2 {0} + # run: | + # set -e + # PY_SITE_PACKAGES=$(cygpath -u "$pythonLocation")/Lib/site-packages - for dll in libssl-3-x64.dll libcrypto-3-x64.dll; do - if [ -f /mingw64/bin/$dll ]; then - cp /mingw64/bin/$dll "$PY_SITE_PACKAGES" - echo "✅ Copied $dll to site-packages." - else - echo "❌ $dll not found in /mingw64/bin!" - exit 1 - fi - done - env: - pythonLocation: ${{ env.pythonLocation }} + # for dll in libssl-3-x64.dll libcrypto-3-x64.dll; do + # if [ -f /mingw64/bin/$dll ]; then + # cp /mingw64/bin/$dll "$PY_SITE_PACKAGES" + # echo "✅ Copied $dll to site-packages." + # else + # echo "❌ $dll not found in /mingw64/bin!" + # exit 1 + # fi + # done + # env: + # pythonLocation: ${{ env.pythonLocation }} # - name: Verify Memgraph is running under WSL # shell: wsl-bash {0} From 3f0737f61136a174aa5292ee538f62f258288232 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:50:27 +0100 Subject: [PATCH 133/227] remove libs --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1ecd0c4c..10080970 100644 --- a/setup.py +++ b/setup.py @@ -305,7 +305,7 @@ def build_mgclient_for(self, extension: Extension): "Operating System :: Microsoft :: Windows", ], ext_modules=[ - Extension(EXTENSION_NAME, sources=sources, depends=headers, libraries=["ssl", "crypto", "crypt32", "ws2_32"]) + Extension(EXTENSION_NAME, sources=sources, depends=headers) ], project_urls={ "Source": "https://github.com/memgraph/pymgclient", From 72a5d0099d35ec8ad95d2776705e8687a9589b30 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:52:56 +0100 Subject: [PATCH 134/227] remove libs --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 10080970..ec737cfb 100644 --- a/setup.py +++ b/setup.py @@ -305,7 +305,7 @@ def build_mgclient_for(self, extension: Extension): "Operating System :: Microsoft :: Windows", ], ext_modules=[ - Extension(EXTENSION_NAME, sources=sources, depends=headers) + Extension(EXTENSION_NAME, sources=sources, depends=headers, libraries=["crypt32", "ws2_32"]) ], project_urls={ "Source": "https://github.com/memgraph/pymgclient", From 28ee9ae467c2052c86c3c75b458af9a8772afe68 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 17:56:47 +0100 Subject: [PATCH 135/227] setup.py --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ec737cfb..c934dd7a 100644 --- a/setup.py +++ b/setup.py @@ -305,7 +305,13 @@ def build_mgclient_for(self, extension: Extension): "Operating System :: Microsoft :: Windows", ], ext_modules=[ - Extension(EXTENSION_NAME, sources=sources, depends=headers, libraries=["crypt32", "ws2_32"]) + Extension(EXTENSION_NAME, sources=sources, depends=headers, extra_link_args=[ + "-l:libssl.a", + "-l:libcrypto.a", + "-lcrypt32", + "-lws2_32" + ], + ) ], project_urls={ "Source": "https://github.com/memgraph/pymgclient", From fdf32642998497650661f25ae13d3b0e3bc56230 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 18:00:15 +0100 Subject: [PATCH 136/227] added memgraph back in --- .github/workflows/ci.yml | 64 +++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59fdfa28..61eac9ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -281,37 +281,37 @@ jobs: - # - name: Setup WSL Ubuntu - # uses: Vampire/setup-wsl@v5 - # with: - # distribution: Ubuntu-24.04 + - name: Setup WSL Ubuntu + uses: Vampire/setup-wsl@v5 + with: + distribution: Ubuntu-24.04 - # - name: Set Memgraph Version - # shell: bash -l {0} - # run: | - # mgversion=$( - # curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ - # | grep -m1 '"tag_name":' \ - # | sed -E 's/.*"([^"]+)".*/\1/' \ - # | sed 's/^v//' - # ) - # echo "MGVERSION=$mgversion" >> $GITHUB_ENV - - # - name: Install and Run Memgraph in WSL - # shell: wsl-bash {0} - # run: | - # mkdir -p $HOME/memgraph/data - # sudo apt update - # sudo apt install -y curl - # curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb - # sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. - # sudo apt install ./memgraph.deb - # # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" - # # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='$HOME/memgraph/memgraph.log' & - # sleep 10 - # ps aux | grep memgraph - # cat $HOME/memgraph/memgraph.log || true + - name: Set Memgraph Version + shell: bash -l {0} + run: | + mgversion=$( + curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ + | grep -m1 '"tag_name":' \ + | sed -E 's/.*"([^"]+)".*/\1/' \ + | sed 's/^v//' + ) + echo "MGVERSION=$mgversion" >> $GITHUB_ENV + + - name: Install and Run Memgraph in WSL + shell: wsl-bash {0} + run: | + mkdir -p $HOME/memgraph/data + sudo apt update + sudo apt install -y curl + curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb + sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. + sudo apt install ./memgraph.deb + # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" + # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='$HOME/memgraph/memgraph.log' & + sleep 10 + ps aux | grep memgraph + cat $HOME/memgraph/memgraph.log || true # - name: Copy required DLLs from MSYS2 to Python site-packages # shell: msys2 {0} @@ -366,9 +366,7 @@ jobs: run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" echo $PATH - cd .. - python -c "import mgclient" - # python -m pytest -v + python -m pytest -v env: pythonLocation: ${{ env.pythonLocation }} From a0085a26fb282ea31171faa47fd047a8c189eeb1 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 18:06:40 +0100 Subject: [PATCH 137/227] updaate ini --- pytest.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/pytest.ini b/pytest.ini index 3979e7df..34c53b22 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,4 @@ [pytest] markers = temporal: mark a test that tests temporal types. +norecursedirs = memgraph From ae91f22d0de5ef36aad8646d6111660e691a6992 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 18:26:12 +0100 Subject: [PATCH 138/227] disable ssl --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61eac9ae..fc828856 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -371,7 +371,7 @@ jobs: env: pythonLocation: ${{ env.pythonLocation }} MEMGRAPH_HOST: localhost - MEMGRAPH_STARTED_WITH_SSL: + MEMGRAPH_STARTED_WITH_SSL: "false" - name: Upload Wheel Artifact From 65d518c3077451ffb8ca2b23cc291a017a8beac2 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 18:34:46 +0100 Subject: [PATCH 139/227] disable ssl --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc828856..5802d551 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -308,10 +308,11 @@ jobs: sudo apt install ./memgraph.deb # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='$HOME/memgraph/memgraph.log' & - sleep 10 + # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='$HOME/memgraph/memgraph.log' & + nohup /usr/lib/memgraph/memgraph --telemetry-enabled=False & + sleep 1 ps aux | grep memgraph - cat $HOME/memgraph/memgraph.log || true + # - name: Copy required DLLs from MSYS2 to Python site-packages # shell: msys2 {0} From 46aae5b1086caadd96bc179c3bc9af19d74ac7a5 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 18:41:23 +0100 Subject: [PATCH 140/227] use ssl --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5802d551..9da0f3cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -306,10 +306,10 @@ jobs: curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. sudo apt install ./memgraph.deb - # openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" - # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='$HOME/memgraph/memgraph.log' & - nohup /usr/lib/memgraph/memgraph --telemetry-enabled=False & + # nohup /usr/lib/memgraph/memgraph --telemetry-enabled=False & sleep 1 ps aux | grep memgraph @@ -366,13 +366,14 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" + ps aux | grep memgraph echo $PATH python -m pytest -v env: pythonLocation: ${{ env.pythonLocation }} MEMGRAPH_HOST: localhost - MEMGRAPH_STARTED_WITH_SSL: "false" + MEMGRAPH_STARTED_WITH_SSL: - name: Upload Wheel Artifact From 5f6445020e1822ed246035068497219fa6d1b277 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 18:52:35 +0100 Subject: [PATCH 141/227] remove ps aux --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9da0f3cd..f4743c7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -366,7 +366,6 @@ jobs: shell: msys2 {0} run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" - ps aux | grep memgraph echo $PATH python -m pytest -v From 5fb34a611a5b289b25d35f06fbe730148d4c1071 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 20:33:15 +0100 Subject: [PATCH 142/227] separate windows only args --- setup.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index c934dd7a..32e74309 100644 --- a/setup.py +++ b/setup.py @@ -270,7 +270,16 @@ def build_mgclient_for(self, extension: Extension): if finalize is not None: finalize(extension) - +if sys.platform == "win32": + extra_link_args = [ + "-l:libssl.a", + "-l:libcrypto.a", + "-lcrypt32", + "-lws2_32" + ] +else: + extra_link_args = None + setup( name="pymgclient", version=version, @@ -305,13 +314,7 @@ def build_mgclient_for(self, extension: Extension): "Operating System :: Microsoft :: Windows", ], ext_modules=[ - Extension(EXTENSION_NAME, sources=sources, depends=headers, extra_link_args=[ - "-l:libssl.a", - "-l:libcrypto.a", - "-lcrypt32", - "-lws2_32" - ], - ) + Extension(EXTENSION_NAME, sources=sources, depends=headers, extra_link_args=extra_link_args) ], project_urls={ "Source": "https://github.com/memgraph/pymgclient", From aecfa74cf48f9dde9128fcfec3f58a41c5f939ff Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 20:34:01 +0100 Subject: [PATCH 143/227] modify workflow --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4743c7b..0b9dfef2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ on: jobs: build_and_test_linux: if: ${{ github.event_name == 'workflow_dispatch' }} + name: "Build and test on Linux 👍" strategy: fail-fast: false matrix: @@ -167,13 +168,14 @@ jobs: build_and_test_windows: + if: ${{ github.event_name == 'workflow_dispatch' }} name: Build and Test on Windows runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [windows-2022] - python-version: ["3.11"] + os: [windows-2022, windows-2025] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Checkout code @@ -390,7 +392,8 @@ jobs: build_macos: - if: ${{ github.event_name == 'workflow_dispatch' }} + #if: ${{ github.event_name == 'workflow_dispatch' }} + name: Build and test on MacOS strategy: fail-fast: false matrix: From a77730c388b64ede688a0610fb1a4b50e2602605 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 20:38:28 +0100 Subject: [PATCH 144/227] wheel --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b9dfef2..ba02853e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -432,6 +432,8 @@ jobs: python${{ matrix.python_version }} -m pip install pyopenssl pytest setuptools - name: Build pymgclient run: python${{ matrix.python_version }} setup.py sdist + - name: Build pymgclient + run: python${{ matrix.python_version }} setup.py bdist_wheel - name: Install pymgclient run: | export PIP_BREAK_SYSTEM_PACKAGES=1 From 41fa4a727d2a9534061ed491cf2c87d04bb818b6 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 20:46:01 +0100 Subject: [PATCH 145/227] use venv --- .github/workflows/ci.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba02853e..e7fded9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -426,20 +426,35 @@ jobs: run: | brew unlink python@3 && brew link --force python@${{ matrix.python_version }} python${{ matrix.python_version }} --version + - name: Create Virtual Env + run: | + python${{ matrix.python_version }} -m venv env + - name: Install pytest and pyopenssl run: | export PIP_BREAK_SYSTEM_PACKAGES=1 + source env/bin/activate python${{ matrix.python_version }} -m pip install pyopenssl pytest setuptools + - name: Build pymgclient - run: python${{ matrix.python_version }} setup.py sdist + run: | + source env/bin/activate + python${{ matrix.python_version }} setup.py sdist + - name: Build pymgclient - run: python${{ matrix.python_version }} setup.py bdist_wheel + run: | + source env/bin/activate + python${{ matrix.python_version }} setup.py bdist_wheel + - name: Install pymgclient run: | export PIP_BREAK_SYSTEM_PACKAGES=1 + source env/bin/activate python${{ matrix.python_version }} -m pip install dist/* - name: Import mgclient to validate installation - run: python${{ matrix.python_version }} -c "import mgclient" + run: | + source env/bin/activate + python${{ matrix.python_version }} -c "import mgclient" - name: Save artifact name on x86 machines if: ${{ !contains(matrix.platform, 'ARM64') }} run: echo "OS_TYPE=${{ matrix.platform }}" >> $GITHUB_ENV @@ -452,3 +467,8 @@ jobs: with: name: pymgclient-${{ env.OS_TYPE }}-${{ matrix.python_version }} path: dist/ + + - name: Cleanup + run: | + rm -fr dist + rm -fr env \ No newline at end of file From fd54cb460855463577e084f2683dc3c69b7ae181 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 20:47:39 +0100 Subject: [PATCH 146/227] remove sdist --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7fded9b..76e3d8e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -436,10 +436,10 @@ jobs: source env/bin/activate python${{ matrix.python_version }} -m pip install pyopenssl pytest setuptools - - name: Build pymgclient - run: | - source env/bin/activate - python${{ matrix.python_version }} setup.py sdist + # - name: Build pymgclient + # run: | + # source env/bin/activate + # python${{ matrix.python_version }} setup.py sdist - name: Build pymgclient run: | From 8ce91a1eb6eccfc2ebd305cbe29cb937363058d5 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 20:49:56 +0100 Subject: [PATCH 147/227] all the mac --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76e3d8e0..973e038f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -397,13 +397,13 @@ jobs: strategy: fail-fast: false matrix: - #platform: [macos-15, macos-14] - #python_version: - #- '3.9' # this does work, but is old - # - '3.10' - # - '3.11' - # - '3.12' - # - '3.13' + platform: [macos-15, macos-14] + python_version: + # - '3.9' # this does work, but is old + - '3.10' + - '3.11' + - '3.12' + - '3.13' include: - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} runs-on: ${{ matrix.platform }} From d16e7b63f27dba837c064ddeceffa22e8e2b82de Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 20:52:39 +0100 Subject: [PATCH 148/227] even more mac --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 973e038f..855fb9bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -392,7 +392,7 @@ jobs: build_macos: - #if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'workflow_dispatch' }} name: Build and test on MacOS strategy: fail-fast: false @@ -405,6 +405,9 @@ jobs: - '3.12' - '3.13' include: + - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} + - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} + - {platform: [self-hosted, macos-12, ARM64], python_version: '3.12'} - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} runs-on: ${{ matrix.platform }} steps: From f154e54d632d2d5125eff91a0b98e9df59f1c09c Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 20:59:28 +0100 Subject: [PATCH 149/227] fix rocksdb issue --- .github/workflows/ci.yml | 2 +- pytest.ini | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 855fb9bf..8a41f8f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -369,7 +369,7 @@ jobs: run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" echo $PATH - python -m pytest -v + python -m pytest -v --ignore=memgraph env: pythonLocation: ${{ env.pythonLocation }} diff --git a/pytest.ini b/pytest.ini index 34c53b22..3979e7df 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,3 @@ [pytest] markers = temporal: mark a test that tests temporal types. -norecursedirs = memgraph From bef5b81938b468a3f4343c882331edc49ed85f3f Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 21:41:15 +0100 Subject: [PATCH 150/227] update docs --- docs/source/introduction.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst index 3bffc137..309dd07c 100644 --- a/docs/source/introduction.rst +++ b/docs/source/introduction.rst @@ -60,9 +60,10 @@ pymgclient can be installed from source on: * all platforms that have prebuilt binaries * on various Linux distributions, including: - * Ubuntu 18.04+ - * Debian 10+ - * CentOS 8+ + * Ubuntu 22.04+ + * Debian 11+ + * Centos 9+ + * Fedora 41+ ******************* Build prerequisites @@ -71,8 +72,8 @@ Build prerequisites pymgclient is a C wrapper around the `mgclient`_ Memgraph client library. To build it from you will need: -* Python 3.7 or newer -* Python 3.7 or newer header files +* Python 3.7 (3.9 for Mac OS) or newer +* Python 3.7 (3.9 for Mac OS) or newer header files * A C compiler supporting C11 standard * A C++ compiler (it is not used directly, but necessary for CMake to work) * Preqrequisites of `mgclient`_: @@ -88,9 +89,9 @@ First install the prerequisites: * On Debian/Ubuntu:: $ sudo apt install python3-dev cmake make gcc g++ libssl-dev -* On CentOS:: +* On CentOS/Fedora:: - $ sudo yum install -y python3-devel cmake3 make gcc gcc-c++ openssl-devel + $ sudo dnf install -y python3-devel cmake3 make gcc gcc-c++ openssl-devel After the prerequisites are installed pymgclient can be installed via pip:: From d895aac22eda2a41d22bf6dfd91de93952fdda56 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 21:42:13 +0100 Subject: [PATCH 151/227] test all now --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a41f8f4..5518fcdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: jobs: build_and_test_linux: - if: ${{ github.event_name == 'workflow_dispatch' }} + #if: ${{ github.event_name == 'workflow_dispatch' }} name: "Build and test on Linux 👍" strategy: fail-fast: false @@ -168,7 +168,7 @@ jobs: build_and_test_windows: - if: ${{ github.event_name == 'workflow_dispatch' }} + #if: ${{ github.event_name == 'workflow_dispatch' }} name: Build and Test on Windows runs-on: ${{ matrix.os }} strategy: @@ -392,7 +392,7 @@ jobs: build_macos: - if: ${{ github.event_name == 'workflow_dispatch' }} + #if: ${{ github.event_name == 'workflow_dispatch' }} name: Build and test on MacOS strategy: fail-fast: false From 1429c4219b7373411121f65b0e613c2ceaba280a Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 21:45:46 +0100 Subject: [PATCH 152/227] updated windows build --- .github/workflows/ci.yml | 74 ++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5518fcdc..8dbfd01b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -208,11 +208,11 @@ jobs: architecture: x64 - - name: Debug Find OpenSSL DLLs - shell: msys2 {0} - run: | - find /mingw64/bin -iname "*ssl*.dll" - find /mingw64/bin -iname "*crypto*.dll" + # - name: Debug Find OpenSSL DLLs + # shell: msys2 {0} + # run: | + # find /mingw64/bin -iname "*ssl*.dll" + # find /mingw64/bin -iname "*crypto*.dll" - name: Add Windows Python to PATH shell: msys2 {0} @@ -230,28 +230,28 @@ jobs: env: pythonLocation: ${{ env.pythonLocation }} - - name: Check that required DLLs are in PATH - shell: msys2 {0} - run: | - export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" - pkg-config --libs --static libcrypto - echo "🔎 Checking for required DLLs in PATH:" - for dll in libssl-3-x64.dll libcrypto-3-x64.dll python311.dll; do - found=0 - for dir in $(echo $PATH | tr ':' '\n'); do - if [ -f "$dir/$dll" ]; then - echo "✅ Found $dll in $dir" - found=1 - break - fi - done - if [ "$found" -eq 0 ]; then - echo "❌ Missing $dll!" - exit 1 - fi - done - env: - pythonLocation: ${{ env.pythonLocation }} + # - name: Check that required DLLs are in PATH + # shell: msys2 {0} + # run: | + # export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" + # pkg-config --libs --static libcrypto + # echo "🔎 Checking for required DLLs in PATH:" + # for dll in libssl-3-x64.dll libcrypto-3-x64.dll python311.dll; do + # found=0 + # for dir in $(echo $PATH | tr ':' '\n'); do + # if [ -f "$dir/$dll" ]; then + # echo "✅ Found $dll in $dir" + # found=1 + # break + # fi + # done + # if [ "$found" -eq 0 ]; then + # echo "❌ Missing $dll!" + # exit 1 + # fi + # done + # env: + # pythonLocation: ${{ env.pythonLocation }} - name: Build pymgclient Wheel shell: msys2 {0} @@ -269,16 +269,16 @@ jobs: env: pythonLocation: ${{ env.pythonLocation }} - - name: Check mgclient.pyd DLL Dependencies (MSYS2) - run: | - mgclient_path=$(find $pythonLocation -name "mgclient.cp*.pyd" | head -n1) - if [ -z "$mgclient_path" ]; then - echo "mgclient.pyd not found!" - exit 1 - fi - echo "Found: $mgclient_path" - objdump -p "$mgclient_path" | grep 'DLL Name' - shell: msys2 {0} + # - name: Check mgclient.pyd DLL Dependencies (MSYS2) + # run: | + # mgclient_path=$(find $pythonLocation -name "mgclient.cp*.pyd" | head -n1) + # if [ -z "$mgclient_path" ]; then + # echo "mgclient.pyd not found!" + # exit 1 + # fi + # echo "Found: $mgclient_path" + # objdump -p "$mgclient_path" | grep 'DLL Name' + # shell: msys2 {0} From 9091e78f630d1389bf9156eda4bfeb0dfbc4045a Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 21:54:59 +0100 Subject: [PATCH 153/227] fixes --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dbfd01b..fad4422f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: jobs: build_and_test_linux: - #if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'workflow_dispatch' }} name: "Build and test on Linux 👍" strategy: fail-fast: false @@ -369,7 +369,7 @@ jobs: run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" echo $PATH - python -m pytest -v --ignore=memgraph + python -m pytest -v --norecursedirs=memgraph env: pythonLocation: ${{ env.pythonLocation }} @@ -392,7 +392,7 @@ jobs: build_macos: - #if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'workflow_dispatch' }} name: Build and test on MacOS strategy: fail-fast: false From b91baba9cbf29eac96d651892804a3e322458485 Mon Sep 17 00:00:00 2001 From: Matt James Date: Tue, 29 Apr 2025 22:06:48 +0100 Subject: [PATCH 154/227] ignore directory --- .github/workflows/ci.yml | 2 +- pytest.ini | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fad4422f..f444d444 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -369,7 +369,7 @@ jobs: run: | export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" echo $PATH - python -m pytest -v --norecursedirs=memgraph + python -m pytest -v env: pythonLocation: ${{ env.pythonLocation }} diff --git a/pytest.ini b/pytest.ini index 3979e7df..34c53b22 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,4 @@ [pytest] markers = temporal: mark a test that tests temporal types. +norecursedirs = memgraph From 2403a3150cc89b725bf1e121680090a141edadc2 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 29 Apr 2025 22:35:15 +0100 Subject: [PATCH 155/227] update ci --- .github/workflows/ci.yml | 110 +-------------------------------------- 1 file changed, 2 insertions(+), 108 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f444d444..bca00115 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,13 +6,12 @@ concurrency: on: pull_request: workflow_dispatch: -# schedule: -# - cron: "0 1 * * *" + schedule: + - cron: "0 0 * * 0" jobs: build_and_test_linux: - if: ${{ github.event_name == 'workflow_dispatch' }} name: "Build and test on Linux 👍" strategy: fail-fast: false @@ -168,7 +167,6 @@ jobs: build_and_test_windows: - #if: ${{ github.event_name == 'workflow_dispatch' }} name: Build and Test on Windows runs-on: ${{ matrix.os }} strategy: @@ -207,13 +205,6 @@ jobs: python-version: ${{ matrix.python-version }} architecture: x64 - - # - name: Debug Find OpenSSL DLLs - # shell: msys2 {0} - # run: | - # find /mingw64/bin -iname "*ssl*.dll" - # find /mingw64/bin -iname "*crypto*.dll" - - name: Add Windows Python to PATH shell: msys2 {0} run: | @@ -229,29 +220,6 @@ jobs: python -m pip install --upgrade pip setuptools wheel pyopenssl pytest env: pythonLocation: ${{ env.pythonLocation }} - - # - name: Check that required DLLs are in PATH - # shell: msys2 {0} - # run: | - # export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" - # pkg-config --libs --static libcrypto - # echo "🔎 Checking for required DLLs in PATH:" - # for dll in libssl-3-x64.dll libcrypto-3-x64.dll python311.dll; do - # found=0 - # for dir in $(echo $PATH | tr ':' '\n'); do - # if [ -f "$dir/$dll" ]; then - # echo "✅ Found $dll in $dir" - # found=1 - # break - # fi - # done - # if [ "$found" -eq 0 ]; then - # echo "❌ Missing $dll!" - # exit 1 - # fi - # done - # env: - # pythonLocation: ${{ env.pythonLocation }} - name: Build pymgclient Wheel shell: msys2 {0} @@ -268,20 +236,6 @@ jobs: python -m pip install dist/*.whl env: pythonLocation: ${{ env.pythonLocation }} - - # - name: Check mgclient.pyd DLL Dependencies (MSYS2) - # run: | - # mgclient_path=$(find $pythonLocation -name "mgclient.cp*.pyd" | head -n1) - # if [ -z "$mgclient_path" ]; then - # echo "mgclient.pyd not found!" - # exit 1 - # fi - # echo "Found: $mgclient_path" - # objdump -p "$mgclient_path" | grep 'DLL Name' - # shell: msys2 {0} - - - - name: Setup WSL Ubuntu uses: Vampire/setup-wsl@v5 @@ -316,54 +270,6 @@ jobs: ps aux | grep memgraph - # - name: Copy required DLLs from MSYS2 to Python site-packages - # shell: msys2 {0} - # run: | - # set -e - # PY_SITE_PACKAGES=$(cygpath -u "$pythonLocation")/Lib/site-packages - - # for dll in libssl-3-x64.dll libcrypto-3-x64.dll; do - # if [ -f /mingw64/bin/$dll ]; then - # cp /mingw64/bin/$dll "$PY_SITE_PACKAGES" - # echo "✅ Copied $dll to site-packages." - # else - # echo "❌ $dll not found in /mingw64/bin!" - # exit 1 - # fi - # done - # env: - # pythonLocation: ${{ env.pythonLocation }} - - # - name: Verify Memgraph is running under WSL - # shell: wsl-bash {0} - # run: | - # # process - # ps aux | grep memgraph - # if ! pgrep -f /usr/lib/memgraph/memgraph; then - # echo "❌ Memgraph not running" >&2 - # cat $HOME/memgraph/memgraph.log || true - # exit 1 - # fi - # echo "✅ Memgraph check passed" - - # echo "🔍 Checking if port 7687 is open..." - # if command -v ss >/dev/null 2>&1; then - # ss -tln | grep ':7687' || (echo "❌ Port 7687 not open!" && exit 1) - # elif command -v netstat >/dev/null 2>&1; then - # netstat -an | grep ':7687' || (echo "❌ Port 7687 not open!" && exit 1) - # else - # echo "⚠️ Warning: Neither ss nor netstat is available to check ports." - # exit 1 - # fi - # echo "✅ Memgraph port 7687 is open." - - # - name: Verify Memgraph is reachable from Windows (MSYS2) - # shell: msys2 {0} - # run: | - # echo "🔍 Checking connection to Memgraph from MSYS2 shell..." - # timeout 3 bash -c " Date: Wed, 30 Apr 2025 10:24:49 +0100 Subject: [PATCH 156/227] use newer fedora --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bca00115..4305a6af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} - - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} + - {platform: 'fedora-42', python_version: '3.13', mgversion: 'latest'} runs-on: ["self-hosted", "X64"] steps: - name: Checkout repository and submodules @@ -43,7 +43,7 @@ jobs: - name: Download Memgraph run: | - if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then + if [[ "${{ matrix.platform }}" == "fedora-42" ]]; then MEMGRAPH_PACKAGE_NAME="memgraph-${{ env.MGVERSION }}_1-1.x86_64.rpm" LOCAL_PACKAGE_NAME=memgraph.rpm else @@ -86,7 +86,7 @@ jobs: - name: Install system dependencies run: | docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME - if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then + if [[ "${{ matrix.platform }}" == "fedora-42" ]]; then docker exec -i testcontainer \ bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools python3-wheel python3-devel cmake g++ openssl-devel nmap-ncat" From d3d8d5b1159e9eaeb75f36605e09f63ea6b51f30 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:14:01 +0100 Subject: [PATCH 157/227] added script for installing linux deps --- tools/install_linux_deps.sh | 179 ++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100755 tools/install_linux_deps.sh diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh new file mode 100755 index 00000000..cfcf2b64 --- /dev/null +++ b/tools/install_linux_deps.sh @@ -0,0 +1,179 @@ +#!/bin/bash + +# This script is for installing the dependencies required for building, +# installing and testing pymgclient + +#!/usr/bin/env bash +set -euo pipefail + +# defaults +python_version="" +distro_arg="" + +usage() { + cat <] [--python-version X.Y] + Optional distro tag, e.g. ubuntu-24.04, fedora-42 + --python-version X.Y Optional Python MAJOR.MINOR (e.g. 3.12). + Defaults to system python3's MAJOR.MINOR. +EOF + exit 1 +} + + +# parse flags + optional positional distro +while [[ $# -gt 0 ]]; do + case "$1" in + --python-version) + if [[ -z "${2-}" ]]; then + echo "Error: --python-version needs an argument" >&2 + usage + fi + python_version="$2" + shift 2 + ;; + -h|--help) + usage + ;; + --*) # any other flag + echo "Unknown option: $1" >&2 + usage + ;; + *) # first non-flag is our distro + if [[ -z "$distro_arg" ]]; then + distro_arg="$1" + shift + else + echo "Unexpected argument: $1" >&2 + usage + fi + ;; + esac +done + + +# detect python_version if not given +if [[ -z "$python_version" ]]; then + python_version="$(python3 --version | grep -Eo '[0-9]+\.[0-9]+' )" +fi +python_binary="python${python_version}" + +# Detect distro from /etc/os-release +detect_distro() { + if [[ -r /etc/os-release ]]; then + . /etc/os-release + # Normalize common IDs + case "$ID" in + ubuntu|debian|linuxmint|fedora|centos|rhel|rocky) + # version might be "24.04" or "9" or "42" + # some versions include quotes + ver="${VERSION_ID//\"/}" + echo "${ID} ${ver}" + ;; + *) + echo "unknown-$(uname -s | tr '[:upper:]' '[:lower:]') $(uname -r)" ;; + esac + else + echo "unknown-$(uname -s | tr '[:upper:]' '[:lower:]') $(uname -r)" + fi +} + +# Ensure at least one arg +if [[ $# -gt 1 ]]; then + usage +fi + +distro="${1-}" +python_version="3.13" +python_binary="python${python_version}" + +# If distro not provided, detect it +if [[ -z "$distro" ]]; then + read distro version < <(detect_distro) + if [[ "$distro" == unknown* ]]; then + echo "Unknown distro detected" + exit 1 + fi +else + # split version from distro, e.g. `ubuntu-24.04` -> `ubuntu` `24.04` + version="${distro#*-}" + distro="${distro%%-*}" +fi +echo "Linux Distro: $distro $version" + +# detect if we need sudo or not +SUDO="" +if [[ "$USER" != "root" ]]; then + SUDO="sudo" +fi + +DEB_DEPS=( + python${python_version} + python3-pip + python3-setuptools + python3-wheel + libpython${python_version} + cmake + g++ + libssl-dev + netcat-traditional +) + +RPM_DEPS=( + python${python_version} + python3-pip + python3-setuptools + python3-wheel + python3-devel + cmake + g++ + libssl-dev + nmap-ncat +) + +install_deb() { + echo "Installing DEB dependencies..." + installed_python_version="$(python3 --version | grep -Po '(?<=Python )\d+\.\d+')" + if [[ "$python_version" != "$installed_python_version" ]]; then + echo "Installed Python version ${installed_python_version} does not match requested version ${python_version}" + if [[ "$distro" == "debian" ]]; then + exit 1 + else + echo "Adding deadsnakes PPA" + "$SUDO" apt-get update + "$SUDO" apt-get install -y software-properties-common + "$SUDO" add-apt-repository -y ppa:deadsnakes/ppa + fi + fi + if [[ ("$distro" == "ubuntu" && ${version#*.} -ge 24) \ + || ("$distro" == "linuxmint" && ${version#*.} -ge 22) ]]; then + DEB_DEPS+=( libcurl4t64 ) + else + DEB_DEPS+=( libcurl4 ) + fi + "$SUDO" apt-get update + "$SUDO" apt-get install -y ${DEB_DEPS[*]} +} + +install_rpm() { + echo "Installing RPM dependencies..." + "$SUDO" dnf install -y ${RPM_DEPS[*]} +} + +case "$distro" in + debian|ubuntu|linuxmint) + install_deb + ;; + centos|fedora|rocky|rhel) + install_rpm + ;; + *) + echo "Unsupported Distro: $distro" >&2 + exit 1 + ;; +esac + +# install python dependencies +export PIP_BREAK_SYSTEM_PACKAGES=1 +"$python_binary" -m pip install --upgrade networkx pytest pyopenssl sphinx + From d5e6d64cb77929bda037e8b72243e0de37728d81 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:17:12 +0100 Subject: [PATCH 158/227] fix distro detection --- tools/install_linux_deps.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index cfcf2b64..84f2c13e 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -8,7 +8,7 @@ set -euo pipefail # defaults python_version="" -distro_arg="" +distro="" usage() { cat <&2 @@ -83,7 +83,6 @@ if [[ $# -gt 1 ]]; then usage fi -distro="${1-}" python_version="3.13" python_binary="python${python_version}" From 9e329e97607e8c1133d4e41b6d49d09c12b2fb1b Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:23:32 +0100 Subject: [PATCH 159/227] fix root issues --- tools/install_linux_deps.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index 84f2c13e..73f0b4a5 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -101,9 +101,9 @@ fi echo "Linux Distro: $distro $version" # detect if we need sudo or not -SUDO="" +SUDO=() if [[ "$USER" != "root" ]]; then - SUDO="sudo" + SUDO=(sudo) fi DEB_DEPS=( @@ -139,9 +139,9 @@ install_deb() { exit 1 else echo "Adding deadsnakes PPA" - "$SUDO" apt-get update - "$SUDO" apt-get install -y software-properties-common - "$SUDO" add-apt-repository -y ppa:deadsnakes/ppa + "${SUDO[@]}" apt-get update + "${SUDO[@]}" apt-get install -y software-properties-common + "${SUDO[@]}" add-apt-repository -y ppa:deadsnakes/ppa fi fi if [[ ("$distro" == "ubuntu" && ${version#*.} -ge 24) \ @@ -150,13 +150,13 @@ install_deb() { else DEB_DEPS+=( libcurl4 ) fi - "$SUDO" apt-get update - "$SUDO" apt-get install -y ${DEB_DEPS[*]} + "${SUDO[@]}" apt-get update + "${SUDO[@]}" apt-get install -y ${DEB_DEPS[*]} } install_rpm() { echo "Installing RPM dependencies..." - "$SUDO" dnf install -y ${RPM_DEPS[*]} + "${SUDO[@]}" dnf install -y ${RPM_DEPS[*]} } case "$distro" in @@ -174,5 +174,10 @@ esac # install python dependencies export PIP_BREAK_SYSTEM_PACKAGES=1 -"$python_binary" -m pip install --upgrade networkx pytest pyopenssl sphinx - +pkgs=( networkx pytest pyopenssl sphinx ) +for pkg in "${pkgs[@]}"; do + echo "Installing/upgrading $pkg..." + if ! "$python_binary" -m pip install --upgrade "$pkg"; then + echo "Warning: pip failed on $pkg, continuing…" >&2 + fi +done \ No newline at end of file From 7f4848ac1d2b14faa4a2c9ec242f61c4141c6a03 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:31:54 +0100 Subject: [PATCH 160/227] use new script in container --- .github/workflows/ci.yml | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4305a6af..f07ffe00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,43 +83,32 @@ jobs: echo "BREAK_PACKAGES=$break_packages" >> $GITHUB_ENV echo "STATIC_SSL=$static_ssl" >> $GITHUB_ENV + - name: Copy Repo Into Container + run: | + docker cp . testcontainer:/pymgclient + - name: Install system dependencies run: | docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME - if [[ "${{ matrix.platform }}" == "fedora-42" ]]; then - docker exec -i testcontainer \ - bash -c "dnf install -y python${{ matrix.python_version }} python3-pip python3-setuptools python3-wheel python3-devel cmake g++ openssl-devel nmap-ncat" - docker exec -i testcontainer \ - bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx" + # Prevents Memgraph from starting. + docker exec -i testcontainer \ + bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" - docker exec -i testcontainer \ - bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. + # Install dependencies + docker exec -i testcontainer \ + bash -c "cd /pymgclient && ./tools/install_linux_deps.sh ${{ matrix.platform }} --python-version ${{ matrix.python_version }}" + # Install Memgraph package + if [[ "${{ matrix.platform }}" == "fedora-42" ]]; then docker exec -i testcontainer \ bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" else - if [[ "${{ matrix.platform }}" == "ubuntu-22.04" ]]; then - curl_package=libcurl4 - else - curl_package=libcurl4t64 - fi - docker exec -i testcontainer \ - bash -c "apt update && apt install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa" - docker exec -i testcontainer \ - bash -c "apt update && apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools $curl_package cmake libssl-dev netcat-traditional" - docker exec -i testcontainer \ - bash -c "pip3 install --upgrade networkx pytest pyopenssl sphinx ${{ env.BREAK_PACKAGES }}" - docker exec -i testcontainer \ - bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" # Prevents Memgraph from starting. docker exec -i testcontainer \ bash -c "dpkg -i /$LOCAL_PACKAGE_NAME" fi rm -v $LOCAL_PACKAGE_NAME - - name: Copy Repo Into Container - run: | - docker cp . testcontainer:/pymgclient - name: Build source distribution run: | From 3f2859f3dc3299e28682b69c0878a5877a3b72b3 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:34:34 +0100 Subject: [PATCH 161/227] build wheel --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f07ffe00..6b964cf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,8 @@ jobs: break_packages="--break-system-packages" elif [[ "${{ matrix.platform }}" == fedora* ]]; then # rpm distros do not ship with static lib for openssl - static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" + #static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" + static_ssl="build_ext --static-openssl=False" fi echo "BREAK_PACKAGES=$break_packages" >> $GITHUB_ENV echo "STATIC_SSL=$static_ssl" >> $GITHUB_ENV @@ -110,15 +111,15 @@ jobs: rm -v $LOCAL_PACKAGE_NAME - - name: Build source distribution + - name: Build Python Wheel run: | docker exec -i testcontainer \ - bash -c "cd /pymgclient && python3 setup.py sdist" + bash -c "cd /pymgclient && python3 setup.py ${{ env.STATIC_SSL }} bdist_wheel" - name: Install pymgclient run: | docker exec -i testcontainer \ - bash -c "python3 -m pip install ${{ env.STATIC_SSL }} ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" + bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" - name: Import mgclient to validate installation run: | @@ -157,6 +158,7 @@ jobs: build_and_test_windows: name: Build and Test on Windows + if: ${{ github.event_name == 'matt' }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -281,6 +283,7 @@ jobs: build_macos: + if: ${{ github.event_name == 'matt' }} name: Build and test on MacOS strategy: fail-fast: false From 87b2b4b28c890f60694dc069adbfc416366014b5 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:38:34 +0100 Subject: [PATCH 162/227] fix sudo check --- tools/install_linux_deps.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index 73f0b4a5..1b6da396 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -102,7 +102,11 @@ echo "Linux Distro: $distro $version" # detect if we need sudo or not SUDO=() -if [[ "$USER" != "root" ]]; then +if (( EUID != 0 )); then + if ! command -v sudo &>/dev/null; then + echo "Error: root privileges or sudo required." >&2 + exit 1 + fi SUDO=(sudo) fi From 33d279db30c44b6f14108b85d1a7fe0a52efbfcd Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:44:34 +0100 Subject: [PATCH 163/227] handle missing python --- tools/install_linux_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index 1b6da396..a4cfb90a 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -136,7 +136,7 @@ RPM_DEPS=( install_deb() { echo "Installing DEB dependencies..." - installed_python_version="$(python3 --version | grep -Po '(?<=Python )\d+\.\d+')" + installed_python_version="$(( python3 --version 2>&1 || echo ) | grep -Po '(?<=Python )\d+\.\d+' || true)" if [[ "$python_version" != "$installed_python_version" ]]; then echo "Installed Python version ${installed_python_version} does not match requested version ${python_version}" if [[ "$distro" == "debian" ]]; then From b2997993b774a6c2e57f0e7cdb3c7075c4deef2a Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:45:08 +0100 Subject: [PATCH 164/227] handle missing python --- tools/install_linux_deps.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index a4cfb90a..2769eb0d 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -83,9 +83,6 @@ if [[ $# -gt 1 ]]; then usage fi -python_version="3.13" -python_binary="python${python_version}" - # If distro not provided, detect it if [[ -z "$distro" ]]; then read distro version < <(detect_distro) From e8d75b761914ab60b8c9e11b272a9c8c5171184e Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:47:47 +0100 Subject: [PATCH 165/227] fix rpm dep --- tools/install_linux_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index 2769eb0d..63a9a070 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -127,7 +127,7 @@ RPM_DEPS=( python3-devel cmake g++ - libssl-dev + openssl-devel nmap-ncat ) From 62fdc64f58e18dd7a61b20359a8bcef3adb93101 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:48:31 +0100 Subject: [PATCH 166/227] remove comments --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b964cf8..5b3a1eaf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -255,8 +255,6 @@ jobs: sudo apt install ./memgraph.deb openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - # nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --log-file='$HOME/memgraph/memgraph.log' & - # nohup /usr/lib/memgraph/memgraph --telemetry-enabled=False & sleep 1 ps aux | grep memgraph From cddc29f9d780c3af053ad5ca67f1767cd8f1336e Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 12:58:50 +0100 Subject: [PATCH 167/227] update python version --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b3a1eaf..0c943833 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,24 +114,24 @@ jobs: - name: Build Python Wheel run: | docker exec -i testcontainer \ - bash -c "cd /pymgclient && python3 setup.py ${{ env.STATIC_SSL }} bdist_wheel" + bash -c "cd /pymgclient && python${{ matrix.python_version }} setup.py ${{ env.STATIC_SSL }} bdist_wheel" - name: Install pymgclient run: | docker exec -i testcontainer \ - bash -c "python3 -m pip install ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" + bash -c "python${{ matrix.python_version }} -m pip install ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" - name: Import mgclient to validate installation run: | docker exec -i testcontainer \ - bash -c "python3 -c 'import mgclient'" + bash -c "python${{ matrix.python_version }} -c 'import mgclient'" - name: Run tests run: | MEMGRAPH_PORT=10000 # what's this for? docker exec -i testcontainer \ - bash -c "cd /pymgclient && python3 -m pytest -v" + bash -c "cd /pymgclient && python${{ matrix.python_version }} -m pytest -v" - name: Build docs run: | From 484bee221723f3dafe7f44b42d9a24c2cc4a9cca Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:04:48 +0100 Subject: [PATCH 168/227] added dev package --- tools/install_linux_deps.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index 63a9a070..722150d8 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -109,6 +109,7 @@ fi DEB_DEPS=( python${python_version} + python${python_version}-dev python3-pip python3-setuptools python3-wheel @@ -175,10 +176,10 @@ esac # install python dependencies export PIP_BREAK_SYSTEM_PACKAGES=1 -pkgs=( networkx pytest pyopenssl sphinx ) +pkgs=(networkx pytest pyopenssl sphinx ) for pkg in "${pkgs[@]}"; do echo "Installing/upgrading $pkg..." if ! "$python_binary" -m pip install --upgrade "$pkg"; then echo "Warning: pip failed on $pkg, continuing…" >&2 fi -done \ No newline at end of file +done \ No newline at end of file From 72d0a080e2a780246ced5a245eee7de3b39c8cd3 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:05:31 +0100 Subject: [PATCH 169/227] added dev package --- tools/install_linux_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index 722150d8..736951f0 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -122,10 +122,10 @@ DEB_DEPS=( RPM_DEPS=( python${python_version} + python${python_version}-devel python3-pip python3-setuptools python3-wheel - python3-devel cmake g++ openssl-devel From 0ae72fae6b4ef80cd98e5fe5405ec6ac5df80490 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:07:03 +0100 Subject: [PATCH 170/227] we don't have fedora 42 package yet --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c943833..9a6d7cd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} - - {platform: 'fedora-42', python_version: '3.13', mgversion: 'latest'} + - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} runs-on: ["self-hosted", "X64"] steps: - name: Checkout repository and submodules @@ -43,7 +43,7 @@ jobs: - name: Download Memgraph run: | - if [[ "${{ matrix.platform }}" == "fedora-42" ]]; then + if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then MEMGRAPH_PACKAGE_NAME="memgraph-${{ env.MGVERSION }}_1-1.x86_64.rpm" LOCAL_PACKAGE_NAME=memgraph.rpm else @@ -101,7 +101,7 @@ jobs: bash -c "cd /pymgclient && ./tools/install_linux_deps.sh ${{ matrix.platform }} --python-version ${{ matrix.python_version }}" # Install Memgraph package - if [[ "${{ matrix.platform }}" == "fedora-42" ]]; then + if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then docker exec -i testcontainer \ bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" else From a6c78c180dd43f4869fc1b55e7a377505c737738 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:15:29 +0100 Subject: [PATCH 171/227] force update --- .github/workflows/ci.yml | 2 +- tools/install_linux_deps.sh | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a6d7cd6..5683c8f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,7 @@ jobs: # Install dependencies docker exec -i testcontainer \ - bash -c "cd /pymgclient && ./tools/install_linux_deps.sh ${{ matrix.platform }} --python-version ${{ matrix.python_version }}" + bash -c "cd /pymgclient && ./tools/install_linux_deps.sh ${{ matrix.platform }} --python-version ${{ matrix.python_version }} --force-update" # Install Memgraph package if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index 736951f0..bab5613c 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -9,6 +9,7 @@ set -euo pipefail # defaults python_version="" distro="" +force_update=false usage() { cat <] [--python-version X.Y] Optional distro tag, e.g. ubuntu-24.04, fedora-42 --python-version X.Y Optional Python MAJOR.MINOR (e.g. 3.12). Defaults to system python3's MAJOR.MINOR. + --force-update Force python packages to be updated EOF exit 1 } @@ -32,6 +34,10 @@ while [[ $# -gt 0 ]]; do python_version="$2" shift 2 ;; + --force-update) + force_update=true + shift 1 + ;; -h|--help) usage ;; @@ -176,10 +182,14 @@ esac # install python dependencies export PIP_BREAK_SYSTEM_PACKAGES=1 -pkgs=(networkx pytest pyopenssl sphinx ) -for pkg in "${pkgs[@]}"; do - echo "Installing/upgrading $pkg..." - if ! "$python_binary" -m pip install --upgrade "$pkg"; then - echo "Warning: pip failed on $pkg, continuing…" >&2 - fi -done \ No newline at end of file +pkgs=(networkx pytest pyopenssl sphinx setuptools wheel) +if [[ $force_update == true ]]; then + "$python_binary" -m pip install --upgrade --ignore-installed ${pkgs[@]} +else + for pkg in "${pkgs[@]}"; do + echo "Installing/upgrading $pkg..." + if ! "$python_binary" -m pip install --upgrade "$pkg"; then + echo "Warning: pip failed on $pkg, continuing…" >&2 + fi + done +fi \ No newline at end of file From 29e656eb12af0c138c1f7bee4f9129eb9392d3f6 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:21:18 +0100 Subject: [PATCH 172/227] remove ps aux command --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5683c8f4..01ab1b01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -256,8 +256,7 @@ jobs: openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & sleep 1 - ps aux | grep memgraph - + - name: Run Tests shell: msys2 {0} From 2dc509ea25f54f698ffc488d09d061ec9813536c Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:24:13 +0100 Subject: [PATCH 173/227] new script for getting memgraph version --- .github/workflows/ci.yml | 10 ++-------- tools/get_memgraph_version.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100755 tools/get_memgraph_version.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01ab1b01..b6927547 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,7 @@ jobs: - name: Set Memgraph Version run: | if [[ "${{ matrix.mgversion }}" == "latest" ]]; then - mgversion=$(curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest | jq -r .tag_name) - mgversion=${mgversion#v} + mgversion=$(./tools/get_memgraph_version.sh) else mgversion="${{ matrix.mgversion }}" fi @@ -236,12 +235,7 @@ jobs: - name: Set Memgraph Version shell: bash -l {0} run: | - mgversion=$( - curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ - | grep -m1 '"tag_name":' \ - | sed -E 's/.*"([^"]+)".*/\1/' \ - | sed 's/^v//' - ) + mgversion=$(./tools/get_memgraph_version.sh) echo "MGVERSION=$mgversion" >> $GITHUB_ENV - name: Install and Run Memgraph in WSL diff --git a/tools/get_memgraph_version.sh b/tools/get_memgraph_version.sh new file mode 100755 index 00000000..a42a1455 --- /dev/null +++ b/tools/get_memgraph_version.sh @@ -0,0 +1,8 @@ +#!/bin/bash +mgversion=$( + curl -s https://api.github.com/repos/memgraph/memgraph/releases/latest \ + | grep -m1 '"tag_name":' \ + | sed -E 's/.*"([^"]+)".*/\1/' \ + | sed 's/^v//' +) +echo "$mgversion" \ No newline at end of file From 1ceab9d031ae2cdca46cbf9b49a7749951fd70e0 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:37:41 +0100 Subject: [PATCH 174/227] =?UTF-8?q?added=20script=20to=20wait=20for=20memg?= =?UTF-8?q?raph=C2=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/wait_for_memgraph.sh | 96 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100755 tools/wait_for_memgraph.sh diff --git a/tools/wait_for_memgraph.sh b/tools/wait_for_memgraph.sh new file mode 100755 index 00000000..12f7df49 --- /dev/null +++ b/tools/wait_for_memgraph.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash +set -euo pipefail + +TIMEOUT=10 +MEMGRAPH_CONSOLE_BINARY=${MEMGRAPH_CONSOLE_BINARY:-} + +usage() { + cat < [port] + --timeout SECONDS Max seconds to wait (default: $TIMEOUT) + Memgraph host to check + [port] Memgraph port (default: 7687) +EOF + exit 1 +} + +# --- parse flags --- +while [[ $# -gt 0 ]]; do + case $1 in + --timeout) + [[ -n "${2-}" ]] || { echo "Error: --timeout needs an argument" >&2; usage; } + TIMEOUT=$2 + shift 2 + ;; + -h|--help) + usage + ;; + *) + break + ;; + esac +done + +# --- positional args --- +(( $# >= 1 && $# <= 2 )) || usage +HOST=$1 +PORT=${2-7687} + +# --- locate mgconsole --- +if [[ -z "$MEMGRAPH_CONSOLE_BINARY" ]]; then + if command -v mgconsole &>/dev/null; then + MEMGRAPH_CONSOLE_BINARY=$(command -v mgconsole) + HAVE_MGCONSOLE=1 + else + HAVE_MGCONSOLE=0 + fi +else + if [[ ! -x "$MEMGRAPH_CONSOLE_BINARY" ]]; then + echo "Error: \$MEMGRAPH_CONSOLE_BINARY set to '$MEMGRAPH_CONSOLE_BINARY', but not executable." >&2 + exit 1 + fi + HAVE_MGCONSOLE=1 +fi + +# --- wait for a port on localhost with timeout --- +wait_port() { + local port=$1 timeout=$2 start now + start=$(date +%s) + until nc -z localhost "$port"; do + now=$(date +%s) + (( now - start >= timeout )) && { + echo "Timeout ($timeout s) waiting for localhost:$port" >&2 + return 1 + } + sleep 0.1 + done +} + +# --- wait for memgraph console to respond with timeout --- +wait_for_memgraph() { + local host=$1 port=$2 timeout=$3 start now + start=$(date +%s) + while ! echo "return 1;" \ + | "$MEMGRAPH_CONSOLE_BINARY" --host "$host" --port "$port" \ + >/dev/null 2>&1; do + now=$(date +%s) + (( now - start >= timeout )) && { + echo "Timeout ($timeout s) waiting for memgraph at $host:$port" >&2 + return 1 + } + sleep 0.1 + done +} + +# --- run checks --- +echo "Waiting for TCP port localhost:$PORT (timeout ${TIMEOUT}s)..." +wait_port "$PORT" "$TIMEOUT" + +if (( HAVE_MGCONSOLE )); then + echo "Waiting for memgraph console on $HOST:$PORT (timeout ${TIMEOUT}s)..." + wait_for_memgraph "$HOST" "$PORT" "$TIMEOUT" +else + echo "Note: mgconsole not found; skipping memgraph-console check." +fi + +echo "Memgraph Started." From b2e67d92b334926f5652da4cf6e8662236a5afa3 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:38:29 +0100 Subject: [PATCH 175/227] use new script --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6927547..4b783ccd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -249,7 +249,9 @@ jobs: sudo apt install ./memgraph.deb openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - sleep 1 + + # wait for memgraph to launch + ./tools/wait_for_memgraph.sh localhost - name: Run Tests From d3f7db0afd37896a8a884ac022507e7be379c3d2 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:39:10 +0100 Subject: [PATCH 176/227] fix alignment --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b783ccd..11f730fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -283,11 +283,10 @@ jobs: matrix: platform: [macos-15, macos-14] python_version: - # - '3.9' # this does work, but is old - - '3.10' - - '3.11' - - '3.12' - - '3.13' + - '3.10' + - '3.11' + - '3.12' + - '3.13' include: - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} From d9f699b095375014f1db8ff7ab4ddff9de669906 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:40:47 +0100 Subject: [PATCH 177/227] allow all to run --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11f730fb..a68a5d7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,7 +157,6 @@ jobs: build_and_test_windows: name: Build and Test on Windows - if: ${{ github.event_name == 'matt' }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -276,7 +275,6 @@ jobs: build_macos: - if: ${{ github.event_name == 'matt' }} name: Build and test on MacOS strategy: fail-fast: false From 755ac54b1e88ef02bfceac1f96dda4ac4d3bc6ce Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:43:02 +0100 Subject: [PATCH 178/227] use new version of mgclient --- mgclient | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgclient b/mgclient index 7a47be3f..9c1dd792 160000 --- a/mgclient +++ b/mgclient @@ -1 +1 @@ -Subproject commit 7a47be3fef5ee650148eb25a70f0f4b147dd8cd9 +Subproject commit 9c1dd792ffacb90cd92dac2860a4d927318919af From 9513a2686784b16d9a76b5bf6398b5bad272c712 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:50:38 +0100 Subject: [PATCH 179/227] new step --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a68a5d7e..e78c3acd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -249,9 +249,11 @@ jobs: openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - # wait for memgraph to launch - ./tools/wait_for_memgraph.sh localhost - + - name: Wait for Memgraph + shell: msys2 {0} + run: | + bash ./tools/wait_for_memgraph.sh localhost + - name: Run Tests shell: msys2 {0} From ad91c604791d80a383254e6dd8a52fd1468b40ec Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 13:55:38 +0100 Subject: [PATCH 180/227] try bash --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e78c3acd..874b2b9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -250,7 +250,7 @@ jobs: nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - name: Wait for Memgraph - shell: msys2 {0} + shell: bash -l {0} run: | bash ./tools/wait_for_memgraph.sh localhost From e1f98d5972572842d67e42c071ef39dcf99df9dc Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 14:00:28 +0100 Subject: [PATCH 181/227] nc --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 874b2b9e..41dc35e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,6 +181,7 @@ jobs: mingw-w64-x86_64-cmake mingw-w64-x86_64-make mingw-w64-x86_64-openssl + inetutils - name: Add MSYS2 mingw64/bin to PATH shell: msys2 {0} @@ -250,7 +251,7 @@ jobs: nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - name: Wait for Memgraph - shell: bash -l {0} + shell: msys2 {0} run: | bash ./tools/wait_for_memgraph.sh localhost From 737d628c05f48281e98dcb3b3831b5b7deafc6fd Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 30 Apr 2025 14:06:54 +0100 Subject: [PATCH 182/227] nc --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41dc35e1..e68aced7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,7 +181,7 @@ jobs: mingw-w64-x86_64-cmake mingw-w64-x86_64-make mingw-w64-x86_64-openssl - inetutils + gnu-netcat - name: Add MSYS2 mingw64/bin to PATH shell: msys2 {0} From 0207e6c222c5a16e5f79c51ebce229a7eaff81b2 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 09:13:45 +0100 Subject: [PATCH 183/227] chck host, not local host --- tools/wait_for_memgraph.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/wait_for_memgraph.sh b/tools/wait_for_memgraph.sh index 12f7df49..41133be7 100755 --- a/tools/wait_for_memgraph.sh +++ b/tools/wait_for_memgraph.sh @@ -52,14 +52,14 @@ else HAVE_MGCONSOLE=1 fi -# --- wait for a port on localhost with timeout --- +# --- wait for a port on memgraph host with timeout --- wait_port() { - local port=$1 timeout=$2 start now + local host=$1 port=$2 timeout=$3 start now start=$(date +%s) - until nc -z localhost "$port"; do + until nc -z "$host" "$port"; do now=$(date +%s) (( now - start >= timeout )) && { - echo "Timeout ($timeout s) waiting for localhost:$port" >&2 + echo "Timeout ($timeout s) waiting for $host:$port" >&2 return 1 } sleep 0.1 @@ -83,8 +83,8 @@ wait_for_memgraph() { } # --- run checks --- -echo "Waiting for TCP port localhost:$PORT (timeout ${TIMEOUT}s)..." -wait_port "$PORT" "$TIMEOUT" +echo "Waiting for TCP port $HOST:$PORT (timeout ${TIMEOUT}s)..." +wait_port "$HOST" "$PORT" "$TIMEOUT" if (( HAVE_MGCONSOLE )); then echo "Waiting for memgraph console on $HOST:$PORT (timeout ${TIMEOUT}s)..." From fd32ff12f7fea29da00459cefd1843d85c43e3be Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 09:15:55 +0100 Subject: [PATCH 184/227] add mac tests --- .github/workflows/ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e68aced7..f7113331 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ on: jobs: build_and_test_linux: + if: ${{ github.event_name == 'bob' }} name: "Build and test on Linux 👍" strategy: fail-fast: false @@ -161,8 +162,10 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022, windows-2025] - python-version: ["3.10", "3.11", "3.12", "3.13"] + os: [windows-2025] + python-version: ["3.13"] + # os: [windows-2022, windows-2025] + # python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Checkout code @@ -337,13 +340,20 @@ jobs: run: | source env/bin/activate python${{ matrix.python_version }} -c "import mgclient" + + - name: Run tests + run: | + python${{ matrix.python_version }} -m pytest -v + - name: Save artifact name on x86 machines if: ${{ !contains(matrix.platform, 'ARM64') }} run: echo "OS_TYPE=${{ matrix.platform }}" >> $GITHUB_ENV + - name: Save artifact name on ARM64 machines if: ${{ contains(matrix.platform, 'ARM64') }} # Convert macOS-11.6-ARM64 to macos-11.6-arm64 to be consistent with full lowercase naming run: echo OS_TYPE=`echo "${{ matrix.platform[0] }}-${{ matrix.platform[1] }}" | tr "[:upper:]" "[:lower:]"` >> $GITHUB_ENV + - name: Save wheel package uses: actions/upload-artifact@v4 with: From 9b250f739e4dfe8babfadc6978e292bb8758b5eb Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 09:20:07 +0100 Subject: [PATCH 185/227] source env --- .github/workflows/ci.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7113331..e8ed3573 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -285,16 +285,16 @@ jobs: strategy: fail-fast: false matrix: - platform: [macos-15, macos-14] - python_version: - - '3.10' - - '3.11' - - '3.12' - - '3.13' + # platform: [macos-15, macos-14] + # python_version: + # - '3.10' + # - '3.11' + # - '3.12' + # - '3.13' include: - - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} - - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} - - {platform: [self-hosted, macos-12, ARM64], python_version: '3.12'} + # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} + # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} + # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.12'} - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} runs-on: ${{ matrix.platform }} steps: @@ -343,6 +343,7 @@ jobs: - name: Run tests run: | + source env/bin/activate python${{ matrix.python_version }} -m pytest -v - name: Save artifact name on x86 machines From cf1cec7b7e693398b381685c1c46fff0794b1b38 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 09:29:33 +0100 Subject: [PATCH 186/227] remove nc --- .github/workflows/ci.yml | 1 - tools/wait_for_memgraph.sh | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8ed3573..697dcacf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -184,7 +184,6 @@ jobs: mingw-w64-x86_64-cmake mingw-w64-x86_64-make mingw-w64-x86_64-openssl - gnu-netcat - name: Add MSYS2 mingw64/bin to PATH shell: msys2 {0} diff --git a/tools/wait_for_memgraph.sh b/tools/wait_for_memgraph.sh index 41133be7..37860a26 100755 --- a/tools/wait_for_memgraph.sh +++ b/tools/wait_for_memgraph.sh @@ -56,13 +56,15 @@ fi wait_port() { local host=$1 port=$2 timeout=$3 start now start=$(date +%s) - until nc -z "$host" "$port"; do + while true; do + if timeout 1 bash -c "(exec 3<>'/dev/tcp/${host}/${port}')" 2>/dev/null; then + return 0 + fi now=$(date +%s) (( now - start >= timeout )) && { echo "Timeout ($timeout s) waiting for $host:$port" >&2 return 1 } - sleep 0.1 done } From 08cfad8c871b56e4f3c03b8f432487bad0b409cb Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 09:42:26 +0100 Subject: [PATCH 187/227] update ci --- .github/workflows/ci.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 697dcacf..80179010 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,11 +251,7 @@ jobs: sudo apt install ./memgraph.deb openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - - - name: Wait for Memgraph - shell: msys2 {0} - run: | - bash ./tools/wait_for_memgraph.sh localhost + ./tools/wait_for_memgraph.sh localhost - name: Run Tests @@ -340,6 +336,19 @@ jobs: source env/bin/activate python${{ matrix.python_version }} -c "import mgclient" + - name: Set Memgraph Version + run: | + mgversion=$(./tools/get_memgraph_version.sh) + echo "MGVERSION=$mgversion" >> $GITHUB_ENV + + - name: Run Memgraph Docker + run: | + docker run --rm --name memgraph -p 7687:7687 "memgraph/memgaph:${{ env.MGVERSION }}" --telemetry-enabled=False + + - name: Wait for Memgraph + run: | + bash ./tools/wait_for_memgraph.sh localhost + - name: Run tests run: | source env/bin/activate @@ -361,6 +370,10 @@ jobs: path: dist/ - name: Cleanup + if: always() run: | - rm -fr dist - rm -fr env \ No newline at end of file + rm -fr dist || true + rm -fr env || true + docker stop memgraph || true + docker wait memgraph || true + docker rmi "memgraph/memgraph:${{ env.MGVERSION }}" || true From 777075a379765c478e8bb84527d7272c04dff20f Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 09:44:10 +0100 Subject: [PATCH 188/227] added docker login --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80179010..ace30cb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -341,6 +341,12 @@ jobs: mgversion=$(./tools/get_memgraph_version.sh) echo "MGVERSION=$mgversion" >> $GITHUB_ENV + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Run Memgraph Docker run: | docker run --rm --name memgraph -p 7687:7687 "memgraph/memgaph:${{ env.MGVERSION }}" --telemetry-enabled=False From f401bd23f59be6f6fb66eade94dbb0e2fb913739 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 09:49:49 +0100 Subject: [PATCH 189/227] line endings --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ace30cb6..e6ea4106 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,7 +251,10 @@ jobs: sudo apt install ./memgraph.deb openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - ./tools/wait_for_memgraph.sh localhost + + # fix line endings (\r seems to just appear in WSL) + sed $'s/\r$//' ./tools/wait_for_memgraph.sh > ./tools/wait_for_memgraph.unix.sh + ./tools/wait_for_memgraph.unix.sh localhost - name: Run Tests From aceb1c42a0169db45ee5a5742eafc79860f8c6b8 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 09:55:28 +0100 Subject: [PATCH 190/227] added docs workflow --- .github/workflows/build_docs.yml | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/build_docs.yml diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml new file mode 100644 index 00000000..df0acd0b --- /dev/null +++ b/.github/workflows/build_docs.yml @@ -0,0 +1,54 @@ +name: Build Docs + +on: + workflow_dispatch: + inputs: + publish_doc: + type: boolean + description: 'If set to true, then the documentation will be published.' + default: false + required: false + workflow_call: + inputs: + publish_doc: + type: boolean + description: 'If set to true, then the documentation will be published.' + default: false + required: false + +jobs: + build_docs: + name: Build Documentation + runs-on: [self-hosted, Linux] + steps: + - name: Checkout repository and submodules + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Install Python Dependencies + run: | + python3 -m venv env + source env/bin/activate + pip install sphinx + + - name: Build docs + run: | + source env/bin/activate + cd docs + make html + rm build/html/.buildinfo + touch build/html/.nojekyll + + - name: Deploy docs + if: ${{ github.event.inputs.publish_doc == 'true' }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/build/html + + - name: Cleanup + if: always() + run: | + rm -rf env || true \ No newline at end of file From c24edd475d4eb59a52630c47b9e64d307ee2fffd Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:05:30 +0100 Subject: [PATCH 191/227] modify timeout --- tools/wait_for_memgraph.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/wait_for_memgraph.sh b/tools/wait_for_memgraph.sh index 37860a26..9222c8b7 100755 --- a/tools/wait_for_memgraph.sh +++ b/tools/wait_for_memgraph.sh @@ -86,12 +86,19 @@ wait_for_memgraph() { # --- run checks --- echo "Waiting for TCP port $HOST:$PORT (timeout ${TIMEOUT}s)..." -wait_port "$HOST" "$PORT" "$TIMEOUT" +if wait_port "$HOST" "$PORT" "$TIMEOUT"; then + timed_out=0 +else + timed_out=1 +fi if (( HAVE_MGCONSOLE )); then echo "Waiting for memgraph console on $HOST:$PORT (timeout ${TIMEOUT}s)..." wait_for_memgraph "$HOST" "$PORT" "$TIMEOUT" else + if [[ $timed_out == 1 ]]; then + exit 1 + fi echo "Note: mgconsole not found; skipping memgraph-console check." fi From 475f8df9315df454c8aff3f891b2b5881f232b46 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:06:55 +0100 Subject: [PATCH 192/227] udpate ci --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6ea4106..1c71e32b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,9 +252,10 @@ jobs: openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - # fix line endings (\r seems to just appear in WSL) - sed $'s/\r$//' ./tools/wait_for_memgraph.sh > ./tools/wait_for_memgraph.unix.sh - ./tools/wait_for_memgraph.unix.sh localhost + - name: Wait for Memgraph + shell: msys2 {0} + run: | + bash ./tools/wait_for_memgraph.sh localhost - name: Run Tests From e3f18d3002402c1bddd17754345bc0e70747f169 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:13:13 +0100 Subject: [PATCH 193/227] mac hacking --- .github/workflows/ci.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c71e32b..6ce13d1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -344,7 +344,20 @@ jobs: run: | mgversion=$(./tools/get_memgraph_version.sh) echo "MGVERSION=$mgversion" >> $GITHUB_ENV - + + - name: Disable osxkeychain helper + run: | + mkdir -p ~/bin + cat > ~/bin/docker-credential-osxkeychain <<'EOF' + #!/bin/sh + # no-op credential helper + exit 0 + EOF + chmod +x ~/bin/docker-credential-osxkeychain + # ensure our ~/bin comes first + env: + PATH: ~/bin:${{ runner.tool_cache }}/local/bin:/usr/local/bin:/usr/bin:/bin + - name: Log in to Docker Hub uses: docker/login-action@v3 with: From dfd4df10db300a87d08ef2f97aeee11cbe7e7c6c Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:20:33 +0100 Subject: [PATCH 194/227] mac hacking --- .github/workflows/ci.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ce13d1c..9fac7c10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -345,24 +345,22 @@ jobs: mgversion=$(./tools/get_memgraph_version.sh) echo "MGVERSION=$mgversion" >> $GITHUB_ENV - - name: Disable osxkeychain helper - run: | - mkdir -p ~/bin - cat > ~/bin/docker-credential-osxkeychain <<'EOF' - #!/bin/sh - # no-op credential helper - exit 0 - EOF - chmod +x ~/bin/docker-credential-osxkeychain - # ensure our ~/bin comes first + - name: Prepare Docker config without credential helper + run: | + mkdir -p /tmp/dockerconfig + echo "{}" > /tmp/dockerconfig/config.json + # point Docker at that directory env: - PATH: ~/bin:${{ runner.tool_cache }}/local/bin:/usr/local/bin:/usr/bin:/bin - + DOCKER_CONFIG: /tmp/dockerconfig + + - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + env: + DOCKER_CONFIG: /tmp/dockerconfig - name: Run Memgraph Docker run: | From e344162dd3e39a16c43b89cbbd034525eb8c2bc7 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:20:49 +0100 Subject: [PATCH 195/227] echo --- tools/wait_for_memgraph.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/wait_for_memgraph.sh b/tools/wait_for_memgraph.sh index 9222c8b7..f7b12768 100755 --- a/tools/wait_for_memgraph.sh +++ b/tools/wait_for_memgraph.sh @@ -97,6 +97,7 @@ if (( HAVE_MGCONSOLE )); then wait_for_memgraph "$HOST" "$PORT" "$TIMEOUT" else if [[ $timed_out == 1 ]]; then + echo "mgconsole not found" exit 1 fi echo "Note: mgconsole not found; skipping memgraph-console check." From b417c92fa18e45e67f172f56086b0751af598605 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:27:10 +0100 Subject: [PATCH 196/227] sed --- .github/workflows/ci.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fac7c10..4d272509 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,11 +251,10 @@ jobs: sudo apt install ./memgraph.deb openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - - - name: Wait for Memgraph - shell: msys2 {0} - run: | - bash ./tools/wait_for_memgraph.sh localhost + + sed $'s/\r$//' ./tools/wait_for_memgraph.sh > ./tools/wait_for_memgraph.unix.sh + + bash ./tools/wait_for_memgraph.unix.sh localhost - name: Run Tests @@ -284,17 +283,17 @@ jobs: strategy: fail-fast: false matrix: - # platform: [macos-15, macos-14] - # python_version: + platform: [macos-15, macos-14] + python_version: # - '3.10' # - '3.11' # - '3.12' - # - '3.13' - include: + - '3.13' + #include: # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.12'} - - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} + # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 From 4e70f4785ceffe40ab73cb61432b64c73696279f Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:31:01 +0100 Subject: [PATCH 197/227] modify mac docker config --- .github/workflows/ci.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d272509..f9a4d94c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -343,23 +343,12 @@ jobs: run: | mgversion=$(./tools/get_memgraph_version.sh) echo "MGVERSION=$mgversion" >> $GITHUB_ENV - - - name: Prepare Docker config without credential helper - run: | - mkdir -p /tmp/dockerconfig - echo "{}" > /tmp/dockerconfig/config.json - # point Docker at that directory - env: - DOCKER_CONFIG: /tmp/dockerconfig - - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - env: - DOCKER_CONFIG: /tmp/dockerconfig - name: Run Memgraph Docker run: | From d8b6349f8d7882440a69747581b60208ab5dce09 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:38:27 +0100 Subject: [PATCH 198/227] modify timeout for mgconsole --- tools/wait_for_memgraph.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/wait_for_memgraph.sh b/tools/wait_for_memgraph.sh index f7b12768..b7e35ebc 100755 --- a/tools/wait_for_memgraph.sh +++ b/tools/wait_for_memgraph.sh @@ -72,9 +72,10 @@ wait_port() { wait_for_memgraph() { local host=$1 port=$2 timeout=$3 start now start=$(date +%s) - while ! echo "return 1;" \ - | "$MEMGRAPH_CONSOLE_BINARY" --host "$host" --port "$port" \ - >/dev/null 2>&1; do + while true; do + if timeout 1 bash -c "echo 'RETURN 1;' | \"$MEMGRAPH_CONSOLE_BINARY\" --host \"$host\" --port \"$port\" >/dev/null 2>&1"; then + return 0 + fi now=$(date +%s) (( now - start >= timeout )) && { echo "Timeout ($timeout s) waiting for memgraph at $host:$port" >&2 From 9e2ab8de94211aa7b824bf3b8662ee238b15d162 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:40:34 +0100 Subject: [PATCH 199/227] remove macos tests --- .github/workflows/ci.yml | 48 +++++++--------------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9a4d94c..75e4e20a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -285,15 +285,15 @@ jobs: matrix: platform: [macos-15, macos-14] python_version: - # - '3.10' - # - '3.11' - # - '3.12' + - '3.10' + - '3.11' + - '3.12' - '3.13' - #include: - # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} - # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} - # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.12'} - # - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} + include: + - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} + - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} + - {platform: [self-hosted, macos-12, ARM64], python_version: '3.12'} + - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 @@ -339,30 +339,6 @@ jobs: source env/bin/activate python${{ matrix.python_version }} -c "import mgclient" - - name: Set Memgraph Version - run: | - mgversion=$(./tools/get_memgraph_version.sh) - echo "MGVERSION=$mgversion" >> $GITHUB_ENV - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Run Memgraph Docker - run: | - docker run --rm --name memgraph -p 7687:7687 "memgraph/memgaph:${{ env.MGVERSION }}" --telemetry-enabled=False - - - name: Wait for Memgraph - run: | - bash ./tools/wait_for_memgraph.sh localhost - - - name: Run tests - run: | - source env/bin/activate - python${{ matrix.python_version }} -m pytest -v - - name: Save artifact name on x86 machines if: ${{ !contains(matrix.platform, 'ARM64') }} run: echo "OS_TYPE=${{ matrix.platform }}" >> $GITHUB_ENV @@ -378,11 +354,3 @@ jobs: name: pymgclient-${{ env.OS_TYPE }}-${{ matrix.python_version }} path: dist/ - - name: Cleanup - if: always() - run: | - rm -fr dist || true - rm -fr env || true - docker stop memgraph || true - docker wait memgraph || true - docker rmi "memgraph/memgraph:${{ env.MGVERSION }}" || true From 558873ec79324c1aa5867bc180eee10df099f5f6 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 10:47:55 +0100 Subject: [PATCH 200/227] remove wait script from windows test --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75e4e20a..e84c529a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,9 +252,10 @@ jobs: openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - sed $'s/\r$//' ./tools/wait_for_memgraph.sh > ./tools/wait_for_memgraph.unix.sh - - bash ./tools/wait_for_memgraph.unix.sh localhost + # sleep here instead of using script because it just doesn't work in Windows + sleep 3 + # sed $'s/\r$//' ./tools/wait_for_memgraph.sh > ./tools/wait_for_memgraph.unix.sh + # bash ./tools/wait_for_memgraph.unix.sh localhost - name: Run Tests From b38523c068cca4df5ab1091b3cd72e88cd89979b Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 11:13:17 +0100 Subject: [PATCH 201/227] added resuable workflow --- .github/workflows/reusable_buildtest.yml | 406 +++++++++++++++++++++++ 1 file changed, 406 insertions(+) create mode 100644 .github/workflows/reusable_buildtest.yml diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml new file mode 100644 index 00000000..9a691d70 --- /dev/null +++ b/.github/workflows/reusable_buildtest.yml @@ -0,0 +1,406 @@ +name: Reusable Build and Test + + +on: + workflow_call: + inputs: + test_linux: + type: boolean + default: true + description: "Run Linux Build and Test" + test_windows: + type: boolean + default: true + description: "Run Windows Build and Test" + test_macintosh: + type: boolean + default: true + description: "Run Mac OS Build" + build_source_dist: + type: boolean + default: true + description: "Build Source Distribution" + upload_artifacts: + type: boolean + default: true + description: "Upload Artifacts" + + +jobs: + build_and_test_linux: + if: ${{ inputs.test_linux }} + name: "Build and test on Linux 👍" + strategy: + fail-fast: false + matrix: + include: + - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} + - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} + - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} + runs-on: ["self-hosted", "X64"] + steps: + - name: Checkout repository and submodules + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set Memgraph Version + run: | + if [[ "${{ matrix.mgversion }}" == "latest" ]]; then + mgversion=$(./tools/get_memgraph_version.sh) + else + mgversion="${{ matrix.mgversion }}" + fi + echo "MGVERSION=$mgversion" >> $GITHUB_ENV + + - name: Download Memgraph + run: | + if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then + MEMGRAPH_PACKAGE_NAME="memgraph-${{ env.MGVERSION }}_1-1.x86_64.rpm" + LOCAL_PACKAGE_NAME=memgraph.rpm + else + MEMGRAPH_PACKAGE_NAME="memgraph_${{ env.MGVERSION }}-1_amd64.deb" + LOCAL_PACKAGE_NAME=memgraph.deb + fi + curl -L "https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME}" > "${LOCAL_PACKAGE_NAME}" + echo "LOCAL_PACKAGE_NAME=$LOCAL_PACKAGE_NAME" >> $GITHUB_ENV + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Launch Docker Container + run: | + platform="${{ matrix.platform }}" + tag=${platform//-/:} + docker run -d --rm --name testcontainer "$tag" sleep infinity + + - name: Set Environment Variables + run: | + break_packages="" + static_ssl="" + if [[ "${{ matrix.platform }}" == "ubuntu-24.04" ]]; then + # this option is specific to ubuntu, not fedora + break_packages="--break-system-packages" + elif [[ "${{ matrix.platform }}" == fedora* ]]; then + # rpm distros do not ship with static lib for openssl + #static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" + static_ssl="build_ext --static-openssl=False" + fi + echo "BREAK_PACKAGES=$break_packages" >> $GITHUB_ENV + echo "STATIC_SSL=$static_ssl" >> $GITHUB_ENV + + - name: Copy Repo Into Container + run: | + docker cp . testcontainer:/pymgclient + + - name: Install system dependencies + run: | + docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME + + # Prevents Memgraph from starting. + docker exec -i testcontainer \ + bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" + + # Install dependencies + docker exec -i testcontainer \ + bash -c "cd /pymgclient && ./tools/install_linux_deps.sh ${{ matrix.platform }} --python-version ${{ matrix.python_version }} --force-update" + + # Install Memgraph package + if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then + docker exec -i testcontainer \ + bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" + else + docker exec -i testcontainer \ + bash -c "dpkg -i /$LOCAL_PACKAGE_NAME" + fi + rm -v $LOCAL_PACKAGE_NAME + + + - name: Build Python Wheel + run: | + docker exec -i testcontainer \ + bash -c "cd /pymgclient && python${{ matrix.python_version }} setup.py ${{ env.STATIC_SSL }} bdist_wheel" + + - name: Install pymgclient + run: | + docker exec -i testcontainer \ + bash -c "python${{ matrix.python_version }} -m pip install ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" + + - name: Import mgclient to validate installation + run: | + docker exec -i testcontainer \ + bash -c "python${{ matrix.python_version }} -c 'import mgclient'" + + - name: Run tests + run: | + MEMGRAPH_PORT=10000 # what's this for? + + docker exec -i testcontainer \ + bash -c "cd /pymgclient && python${{ matrix.python_version }} -m pytest -v" + + - name: Build docs + run: | + docker exec -i testcontainer \ + bash -c "cd /pymgclient/docs && make html" + + - name: Copy Package + run: | + docker cp testcontainer:/pymgclient/dist . + + - name: Save source distribution package + if: ${{ inputs.upload_artifacts && matrix.platform == 'ubuntu-24.04' }} + uses: actions/upload-artifact@v4 + with: + name: pymgclient-linux-${{ matrix.python_version }} + path: dist/ + + - name: Cleanup + if: always() + run: | + docker stop testcontainer || echo "Container does not exist" + docker wait testcontainer || echo "Container does not exist" + docker rmi ${{ env.MGVERSION }} || echo "Image does not exist" + + build_source_dist: + if: ${{ inputs.build_source_dist }} + name: "Build and test on Linux 👍" + runs-on: ["self-hosted", "X64"] + steps: + - name: Checkout repository and submodules + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Create Python Virtual Environment + run: | + python3 -m venv env + source env/bin/activate + pip install setuptools wheel + + - name: Build Python Source Distribution + run: | + source env/bin/activate + python setup.py sdist + + - name: Save source distribution package + if: ${{ inputs.upload_artifacts }} + uses: actions/upload-artifact@v4 + with: + name: pymgclient-linux-sdist + path: dist + + - name: Cleanup + if: always() + run: | + rm -fr env || true + rm -fr dist || true + + + + build_and_test_windows: + if: ${{ inputs.test_windows }} + name: Build and Test on Windows + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-2022, windows-2025] + python-version: ["3.10", "3.11", "3.12", "3.13"] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: true + + + - name: Set up MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + install: > + git + mingw-w64-x86_64-gcc + mingw-w64-x86_64-cmake + mingw-w64-x86_64-make + mingw-w64-x86_64-openssl + + - name: Add MSYS2 mingw64/bin to PATH + shell: msys2 {0} + run: | + echo "/mingw64/bin" >> $GITHUB_PATH + + + - name: Set up Windows Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + + - name: Add Windows Python to PATH + shell: msys2 {0} + run: | + echo "$pythonLocation" >> $GITHUB_PATH + env: + pythonLocation: ${{ env.pythonLocation }} + + + - name: Install Python build tools + shell: msys2 {0} + run: | + export PATH="$(cygpath -u "$pythonLocation"):$PATH" + python -m pip install --upgrade pip setuptools wheel pyopenssl pytest + env: + pythonLocation: ${{ env.pythonLocation }} + + - name: Build pymgclient Wheel + shell: msys2 {0} + run: | + export PATH="$(cygpath -u "$pythonLocation"):$PATH" + python setup.py bdist_wheel + env: + pythonLocation: ${{ env.pythonLocation }} + + - name: Install built wheel + shell: msys2 {0} + run: | + export PATH="$(cygpath -u "$pythonLocation"):$PATH" + python -m pip install dist/*.whl + env: + pythonLocation: ${{ env.pythonLocation }} + + - name: Setup WSL Ubuntu + uses: Vampire/setup-wsl@v5 + with: + distribution: Ubuntu-24.04 + + - name: Set Memgraph Version + shell: bash -l {0} + run: | + mgversion=$(./tools/get_memgraph_version.sh) + echo "MGVERSION=$mgversion" >> $GITHUB_ENV + + - name: Install and Run Memgraph in WSL + shell: wsl-bash {0} + run: | + mkdir -p $HOME/memgraph/data + sudo apt update + sudo apt install -y curl + curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb + sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. + sudo apt install ./memgraph.deb + openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" + nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & + + # sleep here instead of using script because it just doesn't work in Windows + sleep 3 + # sed $'s/\r$//' ./tools/wait_for_memgraph.sh > ./tools/wait_for_memgraph.unix.sh + # bash ./tools/wait_for_memgraph.unix.sh localhost + + + - name: Run Tests + shell: msys2 {0} + run: | + export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" + echo $PATH + python -m pytest -v + + env: + pythonLocation: ${{ env.pythonLocation }} + MEMGRAPH_HOST: localhost + MEMGRAPH_STARTED_WITH_SSL: + + + - name: Upload Wheel Artifact + if: ${{ inputs.upload_artifacts && matrix.os == 'windows-2025' }} + uses: actions/upload-artifact@v4 + with: + name: pymgclient-win-${{ matrix.python-version }} + path: dist/ + + + # NOTE: Cannot run tests on Mac OS runners because: + # - GitHub hosted runners don't have docker + # - self-hosted runner unable to log in to docker due to requiring a password to unlock the keychain + # Also - github hosted macos runners after macos-13 are all arm64 + build_macos: + if: ${{ inputs.test_macintosh }} + name: Build and test on MacOS + strategy: + fail-fast: false + matrix: + platform: [macos-15, macos-14] + python_version: + - '3.10' + - '3.11' + - '3.12' + - '3.13' + include: + - {platform: [macos-12, ARM64, self-hosted], python_version: '3.10'} + - {platform: [macos-12, ARM64, self-hosted], python_version: '3.11'} + - {platform: [macos-12, ARM64, self-hosted], python_version: '3.12'} + - {platform: [macos-12, ARM64, self-hosted], python_version: '3.13'} + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Install python and OpenSSL + run: | + brew install python@${{ matrix.python_version }} openssl@1.1 + brew link --force --overwrite openssl@1.1 + openssl version -a + - name: Manage OpenSSL 3 on ARM machines + if: ${{ contains(matrix.platform, 'ARM64') }} + run: | + brew install openssl@3 + brew link --force --overwrite openssl@3 + openssl version -a + - name: Make used python version default + run: | + brew unlink python@3 && brew link --force python@${{ matrix.python_version }} + python${{ matrix.python_version }} --version + - name: Create Virtual Env + run: | + python${{ matrix.python_version }} -m venv env + + - name: Install pytest and pyopenssl + run: | + export PIP_BREAK_SYSTEM_PACKAGES=1 + source env/bin/activate + python${{ matrix.python_version }} -m pip install pyopenssl pytest setuptools + + - name: Build pymgclient + run: | + source env/bin/activate + python${{ matrix.python_version }} setup.py bdist_wheel + + - name: Install pymgclient + run: | + export PIP_BREAK_SYSTEM_PACKAGES=1 + source env/bin/activate + python${{ matrix.python_version }} -m pip install dist/* + - name: Import mgclient to validate installation + run: | + source env/bin/activate + python${{ matrix.python_version }} -c "import mgclient" + + - name: Save wheel package + if: ${{ inputs.upload_artifacts }} + uses: actions/upload-artifact@v4 + with: + name: pymgclient-${{ matrix.platform[0] }}-${{ matrix.python_version }} + path: dist/ + From 4d23d657527140e39935d251c267d1cea10035a4 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 11:22:34 +0100 Subject: [PATCH 202/227] update ci --- .github/workflows/ci.yml | 706 +++++++++++++++++++++------------------ 1 file changed, 376 insertions(+), 330 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e84c529a..a67c018e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,352 +6,398 @@ concurrency: on: pull_request: workflow_dispatch: + inputs: + test_linux: + type: boolean + default: true + description: "Run Linux Build and Test" + test_windows: + type: boolean + default: true + description: "Run Windows Build and Test" + test_macintosh: + type: boolean + default: true + description: "Run Mac OS Build" + build_source_dist: + type: boolean + default: true + description: "Build Source Distribution" + upload_artifacts: + type: boolean + default: true + description: "Upload Artifacts" + schedule: - cron: "0 0 * * 0" - jobs: - build_and_test_linux: - if: ${{ github.event_name == 'bob' }} - name: "Build and test on Linux 👍" - strategy: - fail-fast: false - matrix: - include: - - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} - - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} - - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} - - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} - - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} - - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} - runs-on: ["self-hosted", "X64"] - steps: - - name: Checkout repository and submodules - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - name: Set Memgraph Version - run: | - if [[ "${{ matrix.mgversion }}" == "latest" ]]; then - mgversion=$(./tools/get_memgraph_version.sh) - else - mgversion="${{ matrix.mgversion }}" - fi - echo "MGVERSION=$mgversion" >> $GITHUB_ENV - - - name: Download Memgraph - run: | - if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then - MEMGRAPH_PACKAGE_NAME="memgraph-${{ env.MGVERSION }}_1-1.x86_64.rpm" - LOCAL_PACKAGE_NAME=memgraph.rpm - else - MEMGRAPH_PACKAGE_NAME="memgraph_${{ env.MGVERSION }}-1_amd64.deb" - LOCAL_PACKAGE_NAME=memgraph.deb - fi - curl -L "https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME}" > "${LOCAL_PACKAGE_NAME}" - echo "LOCAL_PACKAGE_NAME=$LOCAL_PACKAGE_NAME" >> $GITHUB_ENV + weekly_build: + if: ${{ github.event_name == 'schedule' }} + name: "Weekly Build" + uses: "./.github/workflows/reusable_buildtest.yml" + with: + test_linux: true + test_windows: true + test_macintosh: true + build_source_dist: false + upload_artifacts: false + + pr_test: + if: ${{ github.event_name == 'pull_request' }} + uses: "./.github/workflows/reusable_buildtest.yml" + with: + test_linux: true + test_windows: true + test_macintosh: true + build_source_dist: true + upload_artifacts: true + + +# jobs: +# build_and_test_linux: +# if: ${{ github.event_name == 'bob' }} +# name: "Build and test on Linux 👍" +# strategy: +# fail-fast: false +# matrix: +# include: +# - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} +# - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} +# - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} +# - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} +# - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} +# - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} +# runs-on: ["self-hosted", "X64"] +# steps: +# - name: Checkout repository and submodules +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: recursive + +# - name: Set Memgraph Version +# run: | +# if [[ "${{ matrix.mgversion }}" == "latest" ]]; then +# mgversion=$(./tools/get_memgraph_version.sh) +# else +# mgversion="${{ matrix.mgversion }}" +# fi +# echo "MGVERSION=$mgversion" >> $GITHUB_ENV + +# - name: Download Memgraph +# run: | +# if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then +# MEMGRAPH_PACKAGE_NAME="memgraph-${{ env.MGVERSION }}_1-1.x86_64.rpm" +# LOCAL_PACKAGE_NAME=memgraph.rpm +# else +# MEMGRAPH_PACKAGE_NAME="memgraph_${{ env.MGVERSION }}-1_amd64.deb" +# LOCAL_PACKAGE_NAME=memgraph.deb +# fi +# curl -L "https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME}" > "${LOCAL_PACKAGE_NAME}" +# echo "LOCAL_PACKAGE_NAME=$LOCAL_PACKAGE_NAME" >> $GITHUB_ENV - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Launch Docker Container - run: | - platform="${{ matrix.platform }}" - tag=${platform//-/:} - docker run -d --rm --name testcontainer "$tag" sleep infinity - - - name: Set Environment Variables - run: | - break_packages="" - static_ssl="" - if [[ "${{ matrix.platform }}" == "ubuntu-24.04" ]]; then - # this option is specific to ubuntu, not fedora - break_packages="--break-system-packages" - elif [[ "${{ matrix.platform }}" == fedora* ]]; then - # rpm distros do not ship with static lib for openssl - #static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" - static_ssl="build_ext --static-openssl=False" - fi - echo "BREAK_PACKAGES=$break_packages" >> $GITHUB_ENV - echo "STATIC_SSL=$static_ssl" >> $GITHUB_ENV - - - name: Copy Repo Into Container - run: | - docker cp . testcontainer:/pymgclient - - - name: Install system dependencies - run: | - docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME - - # Prevents Memgraph from starting. - docker exec -i testcontainer \ - bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" - - # Install dependencies - docker exec -i testcontainer \ - bash -c "cd /pymgclient && ./tools/install_linux_deps.sh ${{ matrix.platform }} --python-version ${{ matrix.python_version }} --force-update" - - # Install Memgraph package - if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then - docker exec -i testcontainer \ - bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" - else - docker exec -i testcontainer \ - bash -c "dpkg -i /$LOCAL_PACKAGE_NAME" - fi - rm -v $LOCAL_PACKAGE_NAME +# - name: Set up Docker Buildx +# id: buildx +# uses: docker/setup-buildx-action@v3 + +# - name: Log in to Docker Hub +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} + +# - name: Launch Docker Container +# run: | +# platform="${{ matrix.platform }}" +# tag=${platform//-/:} +# docker run -d --rm --name testcontainer "$tag" sleep infinity + +# - name: Set Environment Variables +# run: | +# break_packages="" +# static_ssl="" +# if [[ "${{ matrix.platform }}" == "ubuntu-24.04" ]]; then +# # this option is specific to ubuntu, not fedora +# break_packages="--break-system-packages" +# elif [[ "${{ matrix.platform }}" == fedora* ]]; then +# # rpm distros do not ship with static lib for openssl +# #static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" +# static_ssl="build_ext --static-openssl=False" +# fi +# echo "BREAK_PACKAGES=$break_packages" >> $GITHUB_ENV +# echo "STATIC_SSL=$static_ssl" >> $GITHUB_ENV + +# - name: Copy Repo Into Container +# run: | +# docker cp . testcontainer:/pymgclient + +# - name: Install system dependencies +# run: | +# docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME + +# # Prevents Memgraph from starting. +# docker exec -i testcontainer \ +# bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" + +# # Install dependencies +# docker exec -i testcontainer \ +# bash -c "cd /pymgclient && ./tools/install_linux_deps.sh ${{ matrix.platform }} --python-version ${{ matrix.python_version }} --force-update" + +# # Install Memgraph package +# if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then +# docker exec -i testcontainer \ +# bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" +# else +# docker exec -i testcontainer \ +# bash -c "dpkg -i /$LOCAL_PACKAGE_NAME" +# fi +# rm -v $LOCAL_PACKAGE_NAME - - name: Build Python Wheel - run: | - docker exec -i testcontainer \ - bash -c "cd /pymgclient && python${{ matrix.python_version }} setup.py ${{ env.STATIC_SSL }} bdist_wheel" - - - name: Install pymgclient - run: | - docker exec -i testcontainer \ - bash -c "python${{ matrix.python_version }} -m pip install ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" - - - name: Import mgclient to validate installation - run: | - docker exec -i testcontainer \ - bash -c "python${{ matrix.python_version }} -c 'import mgclient'" - - - name: Run tests - run: | - MEMGRAPH_PORT=10000 # what's this for? - - docker exec -i testcontainer \ - bash -c "cd /pymgclient && python${{ matrix.python_version }} -m pytest -v" - - - name: Build docs - run: | - docker exec -i testcontainer \ - bash -c "cd /pymgclient/docs && make html" - - - name: Copy Package - run: | - docker cp testcontainer:/pymgclient/dist . - - - name: Save source distribution package - uses: actions/upload-artifact@v4 - with: - name: pymgclient - path: dist/${{ matrix.platform }}-${{ matrix.python_version }} - - - name: Cleanup - if: always() - run: | - docker stop testcontainer || echo "Container does not exist" - docker wait testcontainer || echo "Container does not exist" - docker rmi ${{ env.MGVERSION }} || echo "Image does not exist" - - - build_and_test_windows: - name: Build and Test on Windows - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [windows-2025] - python-version: ["3.13"] - # os: [windows-2022, windows-2025] - # python-version: ["3.10", "3.11", "3.12", "3.13"] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: true - - - - name: Set up MSYS2 - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW64 - install: > - git - mingw-w64-x86_64-gcc - mingw-w64-x86_64-cmake - mingw-w64-x86_64-make - mingw-w64-x86_64-openssl +# - name: Build Python Wheel +# run: | +# docker exec -i testcontainer \ +# bash -c "cd /pymgclient && python${{ matrix.python_version }} setup.py ${{ env.STATIC_SSL }} bdist_wheel" + +# - name: Install pymgclient +# run: | +# docker exec -i testcontainer \ +# bash -c "python${{ matrix.python_version }} -m pip install ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" + +# - name: Import mgclient to validate installation +# run: | +# docker exec -i testcontainer \ +# bash -c "python${{ matrix.python_version }} -c 'import mgclient'" + +# - name: Run tests +# run: | +# MEMGRAPH_PORT=10000 # what's this for? + +# docker exec -i testcontainer \ +# bash -c "cd /pymgclient && python${{ matrix.python_version }} -m pytest -v" + +# - name: Build docs +# run: | +# docker exec -i testcontainer \ +# bash -c "cd /pymgclient/docs && make html" + +# - name: Copy Package +# run: | +# docker cp testcontainer:/pymgclient/dist . + +# - name: Save source distribution package +# uses: actions/upload-artifact@v4 +# with: +# name: pymgclient +# path: dist/${{ matrix.platform }}-${{ matrix.python_version }} + +# - name: Cleanup +# if: always() +# run: | +# docker stop testcontainer || echo "Container does not exist" +# docker wait testcontainer || echo "Container does not exist" +# docker rmi ${{ env.MGVERSION }} || echo "Image does not exist" + + +# build_and_test_windows: +# name: Build and Test on Windows +# runs-on: ${{ matrix.os }} +# strategy: +# fail-fast: false +# matrix: +# os: [windows-2025] +# python-version: ["3.13"] +# # os: [windows-2022, windows-2025] +# # python-version: ["3.10", "3.11", "3.12", "3.13"] + +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 +# with: +# submodules: true + + +# - name: Set up MSYS2 +# uses: msys2/setup-msys2@v2 +# with: +# msystem: MINGW64 +# install: > +# git +# mingw-w64-x86_64-gcc +# mingw-w64-x86_64-cmake +# mingw-w64-x86_64-make +# mingw-w64-x86_64-openssl - - name: Add MSYS2 mingw64/bin to PATH - shell: msys2 {0} - run: | - echo "/mingw64/bin" >> $GITHUB_PATH +# - name: Add MSYS2 mingw64/bin to PATH +# shell: msys2 {0} +# run: | +# echo "/mingw64/bin" >> $GITHUB_PATH - - name: Set up Windows Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - architecture: x64 - - - name: Add Windows Python to PATH - shell: msys2 {0} - run: | - echo "$pythonLocation" >> $GITHUB_PATH - env: - pythonLocation: ${{ env.pythonLocation }} +# - name: Set up Windows Python +# uses: actions/setup-python@v5 +# with: +# python-version: ${{ matrix.python-version }} +# architecture: x64 + +# - name: Add Windows Python to PATH +# shell: msys2 {0} +# run: | +# echo "$pythonLocation" >> $GITHUB_PATH +# env: +# pythonLocation: ${{ env.pythonLocation }} - - name: Install Python build tools - shell: msys2 {0} - run: | - export PATH="$(cygpath -u "$pythonLocation"):$PATH" - python -m pip install --upgrade pip setuptools wheel pyopenssl pytest - env: - pythonLocation: ${{ env.pythonLocation }} +# - name: Install Python build tools +# shell: msys2 {0} +# run: | +# export PATH="$(cygpath -u "$pythonLocation"):$PATH" +# python -m pip install --upgrade pip setuptools wheel pyopenssl pytest +# env: +# pythonLocation: ${{ env.pythonLocation }} - - name: Build pymgclient Wheel - shell: msys2 {0} - run: | - export PATH="$(cygpath -u "$pythonLocation"):$PATH" - python setup.py bdist_wheel - env: - pythonLocation: ${{ env.pythonLocation }} - - - name: Install built wheel - shell: msys2 {0} - run: | - export PATH="$(cygpath -u "$pythonLocation"):$PATH" - python -m pip install dist/*.whl - env: - pythonLocation: ${{ env.pythonLocation }} - - - name: Setup WSL Ubuntu - uses: Vampire/setup-wsl@v5 - with: - distribution: Ubuntu-24.04 - - - name: Set Memgraph Version - shell: bash -l {0} - run: | - mgversion=$(./tools/get_memgraph_version.sh) - echo "MGVERSION=$mgversion" >> $GITHUB_ENV - - - name: Install and Run Memgraph in WSL - shell: wsl-bash {0} - run: | - mkdir -p $HOME/memgraph/data - sudo apt update - sudo apt install -y curl - curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb - sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. - sudo apt install ./memgraph.deb - openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & +# - name: Build pymgclient Wheel +# shell: msys2 {0} +# run: | +# export PATH="$(cygpath -u "$pythonLocation"):$PATH" +# python setup.py bdist_wheel +# env: +# pythonLocation: ${{ env.pythonLocation }} + +# - name: Install built wheel +# shell: msys2 {0} +# run: | +# export PATH="$(cygpath -u "$pythonLocation"):$PATH" +# python -m pip install dist/*.whl +# env: +# pythonLocation: ${{ env.pythonLocation }} + +# - name: Setup WSL Ubuntu +# uses: Vampire/setup-wsl@v5 +# with: +# distribution: Ubuntu-24.04 + +# - name: Set Memgraph Version +# shell: bash -l {0} +# run: | +# mgversion=$(./tools/get_memgraph_version.sh) +# echo "MGVERSION=$mgversion" >> $GITHUB_ENV + +# - name: Install and Run Memgraph in WSL +# shell: wsl-bash {0} +# run: | +# mkdir -p $HOME/memgraph/data +# sudo apt update +# sudo apt install -y curl +# curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb +# sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. +# sudo apt install ./memgraph.deb +# openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" +# nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - # sleep here instead of using script because it just doesn't work in Windows - sleep 3 - # sed $'s/\r$//' ./tools/wait_for_memgraph.sh > ./tools/wait_for_memgraph.unix.sh - # bash ./tools/wait_for_memgraph.unix.sh localhost +# # sleep here instead of using script because it just doesn't work in Windows +# sleep 3 +# # sed $'s/\r$//' ./tools/wait_for_memgraph.sh > ./tools/wait_for_memgraph.unix.sh +# # bash ./tools/wait_for_memgraph.unix.sh localhost - - name: Run Tests - shell: msys2 {0} - run: | - export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" - echo $PATH - python -m pytest -v - - env: - pythonLocation: ${{ env.pythonLocation }} - MEMGRAPH_HOST: localhost - MEMGRAPH_STARTED_WITH_SSL: +# - name: Run Tests +# shell: msys2 {0} +# run: | +# export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" +# echo $PATH +# python -m pytest -v + +# env: +# pythonLocation: ${{ env.pythonLocation }} +# MEMGRAPH_HOST: localhost +# MEMGRAPH_STARTED_WITH_SSL: - - name: Upload Wheel Artifact - uses: actions/upload-artifact@v4 - with: - name: pymgclient-win-${{ matrix.os }}-py${{ matrix.python-version }} - path: dist/ - - - - build_macos: - name: Build and test on MacOS - strategy: - fail-fast: false - matrix: - platform: [macos-15, macos-14] - python_version: - - '3.10' - - '3.11' - - '3.12' - - '3.13' - include: - - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} - - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} - - {platform: [self-hosted, macos-12, ARM64], python_version: '3.12'} - - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Install python and OpenSSL - run: | - brew install python@${{ matrix.python_version }} openssl@1.1 - brew link --force --overwrite openssl@1.1 - openssl version -a - - name: Manage OpenSSL 3 on ARM machines - if: ${{ contains(matrix.platform, 'ARM64') }} - run: | - brew install openssl@3 - brew link --force --overwrite openssl@3 - openssl version -a - - name: Make used python version default - run: | - brew unlink python@3 && brew link --force python@${{ matrix.python_version }} - python${{ matrix.python_version }} --version - - name: Create Virtual Env - run: | - python${{ matrix.python_version }} -m venv env - - - name: Install pytest and pyopenssl - run: | - export PIP_BREAK_SYSTEM_PACKAGES=1 - source env/bin/activate - python${{ matrix.python_version }} -m pip install pyopenssl pytest setuptools - - - name: Build pymgclient - run: | - source env/bin/activate - python${{ matrix.python_version }} setup.py bdist_wheel - - - name: Install pymgclient - run: | - export PIP_BREAK_SYSTEM_PACKAGES=1 - source env/bin/activate - python${{ matrix.python_version }} -m pip install dist/* - - name: Import mgclient to validate installation - run: | - source env/bin/activate - python${{ matrix.python_version }} -c "import mgclient" - - - name: Save artifact name on x86 machines - if: ${{ !contains(matrix.platform, 'ARM64') }} - run: echo "OS_TYPE=${{ matrix.platform }}" >> $GITHUB_ENV - - - name: Save artifact name on ARM64 machines - if: ${{ contains(matrix.platform, 'ARM64') }} - # Convert macOS-11.6-ARM64 to macos-11.6-arm64 to be consistent with full lowercase naming - run: echo OS_TYPE=`echo "${{ matrix.platform[0] }}-${{ matrix.platform[1] }}" | tr "[:upper:]" "[:lower:]"` >> $GITHUB_ENV - - - name: Save wheel package - uses: actions/upload-artifact@v4 - with: - name: pymgclient-${{ env.OS_TYPE }}-${{ matrix.python_version }} - path: dist/ +# - name: Upload Wheel Artifact +# uses: actions/upload-artifact@v4 +# with: +# name: pymgclient-win-${{ matrix.os }}-py${{ matrix.python-version }} +# path: dist/ + + +# # NOTE: Cannot run tests on Mac OS runners because: +# # - GitHub hosted runners don't have docker +# # - self-hosted runner unable to log in to docker due to requiring a password to unlock the keychain +# build_macos: +# name: Build and test on MacOS +# strategy: +# fail-fast: false +# matrix: +# platform: [macos-15, macos-14] +# python_version: +# - '3.10' +# - '3.11' +# - '3.12' +# - '3.13' +# include: +# - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} +# - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} +# - {platform: [self-hosted, macos-12, ARM64], python_version: '3.12'} +# - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} +# runs-on: ${{ matrix.platform }} +# steps: +# - uses: actions/checkout@v2 +# with: +# submodules: true +# - name: Install python and OpenSSL +# run: | +# brew install python@${{ matrix.python_version }} openssl@1.1 +# brew link --force --overwrite openssl@1.1 +# openssl version -a +# - name: Manage OpenSSL 3 on ARM machines +# if: ${{ contains(matrix.platform, 'ARM64') }} +# run: | +# brew install openssl@3 +# brew link --force --overwrite openssl@3 +# openssl version -a +# - name: Make used python version default +# run: | +# brew unlink python@3 && brew link --force python@${{ matrix.python_version }} +# python${{ matrix.python_version }} --version +# - name: Create Virtual Env +# run: | +# python${{ matrix.python_version }} -m venv env + +# - name: Install pytest and pyopenssl +# run: | +# export PIP_BREAK_SYSTEM_PACKAGES=1 +# source env/bin/activate +# python${{ matrix.python_version }} -m pip install pyopenssl pytest setuptools + +# - name: Build pymgclient +# run: | +# source env/bin/activate +# python${{ matrix.python_version }} setup.py bdist_wheel + +# - name: Install pymgclient +# run: | +# export PIP_BREAK_SYSTEM_PACKAGES=1 +# source env/bin/activate +# python${{ matrix.python_version }} -m pip install dist/* +# - name: Import mgclient to validate installation +# run: | +# source env/bin/activate +# python${{ matrix.python_version }} -c "import mgclient" + +# - name: Save artifact name on x86 machines +# if: ${{ !contains(matrix.platform, 'ARM64') }} +# run: echo "OS_TYPE=${{ matrix.platform }}" >> $GITHUB_ENV + +# - name: Save artifact name on ARM64 machines +# if: ${{ contains(matrix.platform, 'ARM64') }} +# # Convert macOS-11.6-ARM64 to macos-11.6-arm64 to be consistent with full lowercase naming +# run: echo OS_TYPE=`echo "${{ matrix.platform[0] }}-${{ matrix.platform[1] }}" | tr "[:upper:]" "[:lower:]"` >> $GITHUB_ENV + +# - name: Save wheel package +# uses: actions/upload-artifact@v4 +# with: +# name: pymgclient-${{ env.OS_TYPE }}-${{ matrix.python_version }} +# path: dist/ From a52c4b2018074a47faecf26c1881904c494546f1 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 11:23:56 +0100 Subject: [PATCH 203/227] inherit secrets --- .github/workflows/ci.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a67c018e..435df3dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,7 @@ jobs: test_macintosh: true build_source_dist: false upload_artifacts: false + secrets: inherit pr_test: if: ${{ github.event_name == 'pull_request' }} @@ -52,8 +53,19 @@ jobs: test_macintosh: true build_source_dist: true upload_artifacts: true + secrets: inherit - + manual_test: + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: "./.github/workflows/reusable_buildtest.yml" + with: + test_linux: ${{ inputs.test_linux }} + test_windows: ${{ inputs.test_windows }} + test_macintosh: ${{ inputs.test_macintosh }} + build_source_dist: ${{ inputs.build_source_dist }} + upload_artifacts: ${{ inputs.upload_artifacts }} + secrets: inherit + # jobs: # build_and_test_linux: # if: ${{ github.event_name == 'bob' }} From aaad523bd024dc6627b0463c59dacd80e48b9f29 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 11:28:36 +0100 Subject: [PATCH 204/227] fix macos naming --- .github/workflows/reusable_buildtest.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index 9a691d70..d87bb86d 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -362,16 +362,19 @@ jobs: brew install python@${{ matrix.python_version }} openssl@1.1 brew link --force --overwrite openssl@1.1 openssl version -a + - name: Manage OpenSSL 3 on ARM machines if: ${{ contains(matrix.platform, 'ARM64') }} run: | brew install openssl@3 brew link --force --overwrite openssl@3 openssl version -a + - name: Make used python version default run: | brew unlink python@3 && brew link --force python@${{ matrix.python_version }} python${{ matrix.python_version }} --version + - name: Create Virtual Env run: | python${{ matrix.python_version }} -m venv env @@ -392,6 +395,7 @@ jobs: export PIP_BREAK_SYSTEM_PACKAGES=1 source env/bin/activate python${{ matrix.python_version }} -m pip install dist/* + - name: Import mgclient to validate installation run: | source env/bin/activate @@ -401,6 +405,6 @@ jobs: if: ${{ inputs.upload_artifacts }} uses: actions/upload-artifact@v4 with: - name: pymgclient-${{ matrix.platform[0] }}-${{ matrix.python_version }} + name: pymgclient-${{ matrix.platform[0] || matrix.platform }}-${{ matrix.python_version }} path: dist/ From df13e1c959d8d1ab62828226ce70fbaf4dc7d800 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 11:29:50 +0100 Subject: [PATCH 205/227] update ci --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 435df3dd..da97c505 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,10 +46,11 @@ jobs: pr_test: if: ${{ github.event_name == 'pull_request' }} + name: "Pull Request Tests" uses: "./.github/workflows/reusable_buildtest.yml" with: test_linux: true - test_windows: true + test_windows: false test_macintosh: true build_source_dist: true upload_artifacts: true @@ -57,6 +58,7 @@ jobs: manual_test: if: ${{ github.event_name == 'workflow_dispatch' }} + name: "Manual Test" uses: "./.github/workflows/reusable_buildtest.yml" with: test_linux: ${{ inputs.test_linux }} @@ -65,7 +67,7 @@ jobs: build_source_dist: ${{ inputs.build_source_dist }} upload_artifacts: ${{ inputs.upload_artifacts }} secrets: inherit - + # jobs: # build_and_test_linux: # if: ${{ github.event_name == 'bob' }} From eec8ce1e1594338a9b7eddc03dfd40b47be3338a Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 11:38:56 +0100 Subject: [PATCH 206/227] test collect artifacts --- .github/workflows/ci.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da97c505..10fd58b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,9 +49,9 @@ jobs: name: "Pull Request Tests" uses: "./.github/workflows/reusable_buildtest.yml" with: - test_linux: true + test_linux: false test_windows: false - test_macintosh: true + test_macintosh: false build_source_dist: true upload_artifacts: true secrets: inherit @@ -68,6 +68,22 @@ jobs: upload_artifacts: ${{ inputs.upload_artifacts }} secrets: inherit + collect_artifacts: + name: Collect Artifacts + runs-on: ubuntu-latest + needs: [manual_test] + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + # omit ‘name’ to fetch *every* artifact uploaded earlier + path: ./downloaded-artifacts + + - name: Show contents + run: | + ls -R downloaded-artifacts + # jobs: # build_and_test_linux: # if: ${{ github.event_name == 'bob' }} From 20e88926f57b64c159f815cab138a031b6b1d17a Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 11:56:59 +0100 Subject: [PATCH 207/227] update workflows --- .github/workflows/build_docs.yml | 14 +- .github/workflows/release.yml | 404 +++++++++++++++++-------------- 2 files changed, 229 insertions(+), 189 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index df0acd0b..da429b0a 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -15,7 +15,7 @@ on: description: 'If set to true, then the documentation will be published.' default: false required: false - + jobs: build_docs: name: Build Documentation @@ -41,12 +41,12 @@ jobs: rm build/html/.buildinfo touch build/html/.nojekyll - - name: Deploy docs - if: ${{ github.event.inputs.publish_doc == 'true' }} - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/build/html + # - name: Deploy docs + # if: ${{ github.event.inputs.publish_doc == 'true' }} + # uses: peaceiris/actions-gh-pages@v3 + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # publish_dir: ./docs/build/html - name: Cleanup if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2fee6bb..258408aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,196 +7,236 @@ on: type: string publish_doc: description: 'If set to true, then the documentation will be published.' - default: 'false' + default: false required: false - openssl_1_version: - description: 'The expected version of OpenSSL 1, e.g.: 1.1.1o.' - required: true - type: string - openssl_3_version: - description: 'The expected version of OpenSSL 3, e.g.: 3.0.3.' - required: true - type: string + type: boolean + test: + default: true + description: "Run test release (no docs, publish to test.pypi.org)" + type: boolean env: PYMGCLIENT_OVERRIDE_VERSION: "${{ github.event.inputs.version }}" jobs: - build_and_test_ubuntu: - strategy: - matrix: - include: - - {platform: 'ubuntu-20.04', python_version: '3.8', mgversion: '2.10.1'} - - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: '2.10.1'} - runs-on: ${{ matrix.platform }} - steps: - - name: Install system dependencies (Ubuntu 20.04) - run: | - sudo apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools - sudo pip3 install --upgrade networkx pytest pyopenssl sphinx - mkdir ~/memgraph - curl -L https://download.memgraph.com/memgraph/v${{matrix.mgversion}}/ubuntu-20.04/memgraph_${{matrix.mgversion}}-1_amd64.deb > ~/memgraph/memgraph.deb - sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. - sudo dpkg -i ~/memgraph/memgraph.deb - - uses: actions/checkout@v2 - with: - submodules: true - - name: Build source distribution - run: python3 setup.py sdist - - name: Install pymgclient - run: python3 -m pip install ./dist/pymgclient-* - - name: Run tests - run: MEMGRAPH_PORT=10000 python3 -m pytest - - name: Build docs - run: | - cd docs - make html - rm build/html/.buildinfo - touch build/html/.nojekyll - - name: Save source distribution package - uses: actions/upload-artifact@v2 - with: - name: pymgclient-${{ github.event.inputs.version }} - path: dist/ - - name: Deploy docs - if: ${{ github.event.inputs.publish_doc == 'true' }} - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/build/html + release_tests: + name: Release Package and Test + uses: "./.github/workflows/reusable_buildtest.yml" + with: + test_linux: false + test_windows: false + test_macintosh: true + build_source_dist: true + upload_artifacts: true + secrets: inherit - build_windows_and_test: - runs-on: windows-2019 - strategy: - matrix: - arch: - - { mingw: "64", msys: x86_64, python: "x64"} - python_version: - - '3.7' - - '3.8' - - '3.9' - - '3.10' - # TODO(gitbuda): Fix "The file cannot be accessed by the system... rocksdb_durability" - mgversion: - - 2.8.0 - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Setup python - uses: actions/setup-python@v2.2.2 - with: - python-version: ${{ matrix.python_version }} - architecture: ${{ matrix.arch.python }} - - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW${{ matrix.arch.mingw }} - update: true - release: false - install: git mingw-w64-${{ matrix.arch.msys }}-toolchain mingw-w64-${{ matrix.arch.msys }}-cmake mingw-w64-${{ matrix.arch.msys }}-openssl - - name: Add mingw${{ matrix.arch.mingw }} to PATH - run: | - # First make sure python would resolve to the windows native python, not mingw one - echo "C:\msys64\mingw${{ matrix.arch.mingw }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - echo "${{ env.pythonLocation }}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - - name: Print OpenSSL version - shell: msys2 {0} - run: | - openssl version -a - - name: Check version - shell: msys2 {0} - run: | - [ `openssl version -v | cut -d ' ' -f 2` == "${{ github.event.inputs.openssl_1_version }}" ] - - uses: Vampire/setup-wsl@v1 - with: - distribution: Ubuntu-20.04 - - name: Download, install and run Memgraph under WSL - shell: wsl-bash {0} # root shell - run: | - mkdir ~/memgraph - curl -L https://download.memgraph.com/memgraph/v${{matrix.mgversion}}/ubuntu-20.04/memgraph_${{matrix.mgversion}}-1_amd64.deb --output ~/memgraph/memgraph.deb - dpkg -i ~/memgraph/memgraph.deb - openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" - nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - sleep 1 # Wait for Memgraph a bit. - - run: python -m pip install -U pip wheel setuptools pytest pyopenssl - - name: Build pymgclient - run: python setup.py bdist_wheel - - name: Install pymgclient - run: python -m pip install --verbose -f dist --no-index pymgclient - env: - VERBOSE: 1 - - name: Run tests - run: | - python -m pytest -v - env: - MEMGRAPH_HOST: "localhost" - MEMGRAPH_STARTED_WITH_SSL: - - name: Save wheel package - uses: actions/upload-artifact@v2 - with: - name: pymgclient-${{ github.event.inputs.version }}-win${{ matrix.arch.mingw }}-${{ matrix.python_version }} - path: dist/ + build_docs: + name: Build Docs + uses: "./.github/workflows/build_docs.yml" + with: + publish_doc: false + secrets: inherit + + publish_artifacts: + name: Collect Artifacts + runs-on: ubuntu-latest + needs: [release_tests] - build_macos: - strategy: - matrix: - platform: [macos-11] - python_version: - - '3.7' - - '3.8' - - '3.9' - - '3.10' - include: - - {platform: [macOS-11.6, ARM64, self-hosted], python_version: '3.10'} - - {platform: [macOS-11.6, ARM64, self-hosted], python_version: '3.9'} - - {platform: [macOS-11.6, ARM64, self-hosted], python_version: '3.8'} - runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v2 + - name: Download all artifacts + uses: actions/download-artifact@v4 with: - submodules: true - - name: Install python - run: | - brew update - brew install python@${{ matrix.python_version }} - - name: Manage OpenSSL 1 on x86 machines - if: ${{ !contains(matrix.platform, 'ARM64') }} - run: | - brew uninstall -f openssl@3 - brew install openssl@1.1 - brew upgrade openssl@1.1 - brew link --force --overwrite openssl@1.1 - openssl version -a - [ `openssl version -v | cut -d ' ' -f 2` == "${{ github.event.inputs.openssl_1_version }}" ] - - name: Manage OpenSSL 3 on ARM machines - if: ${{ contains(matrix.platform, 'ARM64') }} + # omit ‘name’ to fetch *every* artifact uploaded earlier + path: ./downloaded-artifacts + + - name: Move Artifacts run: | - brew install openssl@3 - brew upgrade openssl@3 - brew link --force --overwrite openssl@3 - openssl version -a - [ `openssl version -v | cut -d ' ' -f 2` == "${{ github.event.inputs.openssl_3_version }}" ] - - name: Make used python version default + mkdir -p artifacts + mv -v downloaded-artifacts/*/* artifacts/ + + - name: Show contents run: | - brew unlink python@3 && brew link --force python@${{ matrix.python_version }} - python${{ matrix.python_version }} --version - - name: Install pytest and pyopenssl - run: python${{ matrix.python_version }} -m pip install pyopenssl pytest - - name: Build pymgclient - run: python${{ matrix.python_version }} setup.py bdist_wheel - - name: Install pymgclient - run: python${{ matrix.python_version }} -m pip install -f dist --no-index pymgclient - - name: Import mgclient to validate installation - run: python${{ matrix.python_version }} -c "import mgclient" - - name: Save artifact name on x86 machines - if: ${{ !contains(matrix.platform, 'ARM64') }} - run: echo "OS_TYPE=${{ matrix.platform }}" >> $GITHUB_ENV - - name: Save artifact name on ARM64 machines - if: ${{ contains(matrix.platform, 'ARM64') }} - # Convert macOS-11.6-ARM64 to macos-11.6-arm64 to be consistent with full lowercase naming - run: echo OS_TYPE=`echo "${{ matrix.platform[0] }}-${{ matrix.platform[1] }}" | tr "[:upper:]" "[:lower:]"` >> $GITHUB_ENV - - name: Save wheel package - uses: actions/upload-artifact@v2 - with: - name: pymgclient-${{ github.event.inputs.version }}-${{ env.OS_TYPE }}-${{ matrix.python_version }} - path: dist/ + ls artifacts/ + + + + +# jobs: +# build_and_test_ubuntu: +# strategy: +# matrix: +# include: +# - {platform: 'ubuntu-20.04', python_version: '3.8', mgversion: '2.10.1'} +# - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: '2.10.1'} +# runs-on: ${{ matrix.platform }} +# steps: +# - name: Install system dependencies (Ubuntu 20.04) +# run: | +# sudo apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools +# sudo pip3 install --upgrade networkx pytest pyopenssl sphinx +# mkdir ~/memgraph +# curl -L https://download.memgraph.com/memgraph/v${{matrix.mgversion}}/ubuntu-20.04/memgraph_${{matrix.mgversion}}-1_amd64.deb > ~/memgraph/memgraph.deb +# sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. +# sudo dpkg -i ~/memgraph/memgraph.deb +# - uses: actions/checkout@v2 +# with: +# submodules: true +# - name: Build source distribution +# run: python3 setup.py sdist +# - name: Install pymgclient +# run: python3 -m pip install ./dist/pymgclient-* +# - name: Run tests +# run: MEMGRAPH_PORT=10000 python3 -m pytest +# - name: Build docs +# run: | +# cd docs +# make html +# rm build/html/.buildinfo +# touch build/html/.nojekyll +# - name: Save source distribution package +# uses: actions/upload-artifact@v2 +# with: +# name: pymgclient-${{ github.event.inputs.version }} +# path: dist/ +# - name: Deploy docs +# if: ${{ github.event.inputs.publish_doc == 'true' }} +# uses: peaceiris/actions-gh-pages@v3 +# with: +# github_token: ${{ secrets.GITHUB_TOKEN }} +# publish_dir: ./docs/build/html + +# build_windows_and_test: +# runs-on: windows-2019 +# strategy: +# matrix: +# arch: +# - { mingw: "64", msys: x86_64, python: "x64"} +# python_version: +# - '3.7' +# - '3.8' +# - '3.9' +# - '3.10' +# # TODO(gitbuda): Fix "The file cannot be accessed by the system... rocksdb_durability" +# mgversion: +# - 2.8.0 +# steps: +# - uses: actions/checkout@v2 +# with: +# submodules: true +# - name: Setup python +# uses: actions/setup-python@v2.2.2 +# with: +# python-version: ${{ matrix.python_version }} +# architecture: ${{ matrix.arch.python }} +# - uses: msys2/setup-msys2@v2 +# with: +# msystem: MINGW${{ matrix.arch.mingw }} +# update: true +# release: false +# install: git mingw-w64-${{ matrix.arch.msys }}-toolchain mingw-w64-${{ matrix.arch.msys }}-cmake mingw-w64-${{ matrix.arch.msys }}-openssl +# - name: Add mingw${{ matrix.arch.mingw }} to PATH +# run: | +# # First make sure python would resolve to the windows native python, not mingw one +# echo "C:\msys64\mingw${{ matrix.arch.mingw }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 +# echo "${{ env.pythonLocation }}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 +# - name: Print OpenSSL version +# shell: msys2 {0} +# run: | +# openssl version -a +# - name: Check version +# shell: msys2 {0} +# run: | +# [ `openssl version -v | cut -d ' ' -f 2` == "${{ github.event.inputs.openssl_1_version }}" ] +# - uses: Vampire/setup-wsl@v1 +# with: +# distribution: Ubuntu-20.04 +# - name: Download, install and run Memgraph under WSL +# shell: wsl-bash {0} # root shell +# run: | +# mkdir ~/memgraph +# curl -L https://download.memgraph.com/memgraph/v${{matrix.mgversion}}/ubuntu-20.04/memgraph_${{matrix.mgversion}}-1_amd64.deb --output ~/memgraph/memgraph.deb +# dpkg -i ~/memgraph/memgraph.deb +# openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" +# nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & +# sleep 1 # Wait for Memgraph a bit. +# - run: python -m pip install -U pip wheel setuptools pytest pyopenssl +# - name: Build pymgclient +# run: python setup.py bdist_wheel +# - name: Install pymgclient +# run: python -m pip install --verbose -f dist --no-index pymgclient +# env: +# VERBOSE: 1 +# - name: Run tests +# run: | +# python -m pytest -v +# env: +# MEMGRAPH_HOST: "localhost" +# MEMGRAPH_STARTED_WITH_SSL: +# - name: Save wheel package +# uses: actions/upload-artifact@v2 +# with: +# name: pymgclient-${{ github.event.inputs.version }}-win${{ matrix.arch.mingw }}-${{ matrix.python_version }} +# path: dist/ + +# build_macos: +# strategy: +# matrix: +# platform: [macos-11] +# python_version: +# - '3.7' +# - '3.8' +# - '3.9' +# - '3.10' +# include: +# - {platform: [macOS-11.6, ARM64, self-hosted], python_version: '3.10'} +# - {platform: [macOS-11.6, ARM64, self-hosted], python_version: '3.9'} +# - {platform: [macOS-11.6, ARM64, self-hosted], python_version: '3.8'} +# runs-on: ${{ matrix.platform }} +# steps: +# - uses: actions/checkout@v2 +# with: +# submodules: true +# - name: Install python +# run: | +# brew update +# brew install python@${{ matrix.python_version }} +# - name: Manage OpenSSL 1 on x86 machines +# if: ${{ !contains(matrix.platform, 'ARM64') }} +# run: | +# brew uninstall -f openssl@3 +# brew install openssl@1.1 +# brew upgrade openssl@1.1 +# brew link --force --overwrite openssl@1.1 +# openssl version -a +# [ `openssl version -v | cut -d ' ' -f 2` == "${{ github.event.inputs.openssl_1_version }}" ] +# - name: Manage OpenSSL 3 on ARM machines +# if: ${{ contains(matrix.platform, 'ARM64') }} +# run: | +# brew install openssl@3 +# brew upgrade openssl@3 +# brew link --force --overwrite openssl@3 +# openssl version -a +# [ `openssl version -v | cut -d ' ' -f 2` == "${{ github.event.inputs.openssl_3_version }}" ] +# - name: Make used python version default +# run: | +# brew unlink python@3 && brew link --force python@${{ matrix.python_version }} +# python${{ matrix.python_version }} --version +# - name: Install pytest and pyopenssl +# run: python${{ matrix.python_version }} -m pip install pyopenssl pytest +# - name: Build pymgclient +# run: python${{ matrix.python_version }} setup.py bdist_wheel +# - name: Install pymgclient +# run: python${{ matrix.python_version }} -m pip install -f dist --no-index pymgclient +# - name: Import mgclient to validate installation +# run: python${{ matrix.python_version }} -c "import mgclient" +# - name: Save artifact name on x86 machines +# if: ${{ !contains(matrix.platform, 'ARM64') }} +# run: echo "OS_TYPE=${{ matrix.platform }}" >> $GITHUB_ENV +# - name: Save artifact name on ARM64 machines +# if: ${{ contains(matrix.platform, 'ARM64') }} +# # Convert macOS-11.6-ARM64 to macos-11.6-arm64 to be consistent with full lowercase naming +# run: echo OS_TYPE=`echo "${{ matrix.platform[0] }}-${{ matrix.platform[1] }}" | tr "[:upper:]" "[:lower:]"` >> $GITHUB_ENV +# - name: Save wheel package +# uses: actions/upload-artifact@v2 +# with: +# name: pymgclient-${{ github.event.inputs.version }}-${{ env.OS_TYPE }}-${{ matrix.python_version }} +# path: dist/ From 9ed9573716cc9e9f3b213a19ce7b15fc3e0614c3 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 12:00:42 +0100 Subject: [PATCH 208/227] update workflows --- .github/workflows/ci.yml | 15 --------------- .github/workflows/reusable_buildtest.yml | 4 ++-- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10fd58b7..f81f23c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,21 +68,6 @@ jobs: upload_artifacts: ${{ inputs.upload_artifacts }} secrets: inherit - collect_artifacts: - name: Collect Artifacts - runs-on: ubuntu-latest - needs: [manual_test] - - steps: - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - # omit ‘name’ to fetch *every* artifact uploaded earlier - path: ./downloaded-artifacts - - - name: Show contents - run: | - ls -R downloaded-artifacts # jobs: # build_and_test_linux: diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index d87bb86d..8ff7f1bb 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -174,8 +174,8 @@ jobs: build_source_dist: if: ${{ inputs.build_source_dist }} - name: "Build and test on Linux 👍" - runs-on: ["self-hosted", "X64"] + name: "Build Source Distribution" + runs-on: ["self-hosted", "X64", "Ubuntu-24.04"] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 From e05ce48b5ab6148d4a7f6841a0f439ef30609ff0 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 12:02:37 +0100 Subject: [PATCH 209/227] update workflows --- .github/workflows/build_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index da429b0a..198de9d1 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -19,7 +19,7 @@ on: jobs: build_docs: name: Build Documentation - runs-on: [self-hosted, Linux] + runs-on: [self-hosted, Linux, Ubuntu-24.04] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 From fa7896b4b44fc6ae6e0c1d5600806555d195bd34 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 12:15:33 +0100 Subject: [PATCH 210/227] update workflows --- .github/workflows/build_docs.yml | 3 ++- .github/workflows/release.yml | 10 +++++--- .github/workflows/reusable_buildtest.yml | 32 ++++++++++++++++++++++-- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 198de9d1..5abadff5 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -19,7 +19,8 @@ on: jobs: build_docs: name: Build Documentation - runs-on: [self-hosted, Linux, Ubuntu-24.04] + #runs-on: [self-hosted, Linux, Ubuntu-24.04] + runs-on: ubuntu-24.04 steps: - name: Checkout repository and submodules uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 258408aa..3eb1dbff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,6 @@ name: Release + + on: workflow_dispatch: inputs: @@ -24,12 +26,14 @@ jobs: with: test_linux: false test_windows: false - test_macintosh: true + test_macintosh: false build_source_dist: true upload_artifacts: true + version: ${{ inputs.version }} secrets: inherit build_docs: + needs: [release_tests] name: Build Docs uses: "./.github/workflows/build_docs.yml" with: @@ -38,8 +42,8 @@ jobs: publish_artifacts: name: Collect Artifacts - runs-on: ubuntu-latest - needs: [release_tests] + runs-on: ubuntu-24.04 + needs: [release_tests, build_docs] steps: - name: Download all artifacts diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index 8ff7f1bb..1f989ec5 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -24,7 +24,9 @@ on: type: boolean default: true description: "Upload Artifacts" - + version: + required: false + type: string jobs: build_and_test_linux: @@ -48,6 +50,12 @@ jobs: fetch-depth: 0 submodules: recursive + - name: Set override version if provided + if: ${{ inputs.version != '' }} + run: | + echo "Building version ${{ inputs.version }}" + echo "PYMGCLIENT_OVERRIDE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV + - name: Set Memgraph Version run: | if [[ "${{ matrix.mgversion }}" == "latest" ]]; then @@ -175,7 +183,8 @@ jobs: build_source_dist: if: ${{ inputs.build_source_dist }} name: "Build Source Distribution" - runs-on: ["self-hosted", "X64", "Ubuntu-24.04"] + #runs-on: ["self-hosted", "X64", "Ubuntu-24.04"] + runs-on: ubuntu-24.04 steps: - name: Checkout repository and submodules uses: actions/checkout@v4 @@ -183,6 +192,12 @@ jobs: fetch-depth: 0 submodules: recursive + - name: Set override version if provided + if: ${{ inputs.version != '' }} + run: | + echo "Building version ${{ inputs.version }}" + echo "PYMGCLIENT_OVERRIDE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV + - name: Create Python Virtual Environment run: | python3 -m venv env @@ -225,6 +240,12 @@ jobs: with: submodules: true + - name: Set override version if provided + if: ${{ inputs.version != '' }} + shell: bash + run: | + echo "Building version ${{ inputs.version }}" + echo "PYMGCLIENT_OVERRIDE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV - name: Set up MSYS2 uses: msys2/setup-msys2@v2 @@ -357,6 +378,13 @@ jobs: - uses: actions/checkout@v2 with: submodules: true + + - name: Set override version if provided + if: ${{ inputs.version != '' }} + run: | + echo "Building version ${{ inputs.version }}" + echo "PYMGCLIENT_OVERRIDE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV + - name: Install python and OpenSSL run: | brew install python@${{ matrix.python_version }} openssl@1.1 From 82ddf49a674c143c265d043c39aa61671f070531 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 13:14:09 +0100 Subject: [PATCH 211/227] download artifact --- .github/workflows/build_docs.yml | 17 +++++++++++++++++ .github/workflows/release.yml | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 5abadff5..752f5e52 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -28,12 +28,29 @@ jobs: fetch-depth: 0 submodules: recursive + - name: Install Python Dependencies run: | python3 -m venv env source env/bin/activate pip install sphinx + - name: Get Current Python Version + run: | + version="$(( python3 --version 2>&1 || echo ) | grep -Po '(?<=Python )\d+\.\d+' || true)" + echo "Found version $version" + echo "PYTHON_VERSION=$version" >> $GITHUB_ENV + + - name: Download Python Artifact + uses: actions/download-artifact@v4 + with: + name: pymgclient-linux-${{ env.PYTHON_VERSION }} + path: ./dist + + - name: Install Pymgclient + run: | + pip install dist/*.whl + - name: Build docs run: | source env/bin/activate diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3eb1dbff..444325d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: name: Release Package and Test uses: "./.github/workflows/reusable_buildtest.yml" with: - test_linux: false + test_linux: true test_windows: false test_macintosh: false build_source_dist: true From dfe8f9ee408e4ebebf40f33df1432b61a7403ed5 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 13:26:40 +0100 Subject: [PATCH 212/227] udpate workflows --- .github/workflows/build_docs.yml | 1 + .github/workflows/release.yml | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 752f5e52..211b6550 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -49,6 +49,7 @@ jobs: - name: Install Pymgclient run: | + source env/bin/activate pip install dist/*.whl - name: Build docs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 444325d9..fccc621f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,10 +12,16 @@ on: default: false required: false type: boolean + publish_pypi: + default: false + type: boolean + description: "Attempt to publish packages to PyPI" test: default: true description: "Run test release (no docs, publish to test.pypi.org)" type: boolean + + env: PYMGCLIENT_OVERRIDE_VERSION: "${{ github.event.inputs.version }}" @@ -55,15 +61,27 @@ jobs: - name: Move Artifacts run: | mkdir -p artifacts - mv -v downloaded-artifacts/*/* artifacts/ + mv -v downloaded-artifacts/*/* dist/ - name: Show contents run: | - ls artifacts/ + ls dist/ - + - name: Publish Package to PyPI + if: ${{ inputs.publish_pypi == true && inputs.test == false }} + uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + - name: Publish Package to PyPI (TEST) + if: ${{ inputs.publish_pypi == true && inputs.test }} + uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ # jobs: # build_and_test_ubuntu: # strategy: From 46070aeb5a2633c8fd1a703c1e449236593e66d2 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 13:35:00 +0100 Subject: [PATCH 213/227] fix dist directory --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fccc621f..58d49f67 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: - name: Move Artifacts run: | - mkdir -p artifacts + mkdir -p dist mv -v downloaded-artifacts/*/* dist/ - name: Show contents From 140da58ddf00c86c44eada371c6adc5fdb5d35ef Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 13:35:27 +0100 Subject: [PATCH 214/227] fix dist directory --- .github/workflows/release.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 58d49f67..69db6bc0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,17 +56,11 @@ jobs: uses: actions/download-artifact@v4 with: # omit ‘name’ to fetch *every* artifact uploaded earlier - path: ./downloaded-artifacts - - - name: Move Artifacts - run: | - mkdir -p dist - mv -v downloaded-artifacts/*/* dist/ + path: ./dist - name: Show contents run: | ls dist/ - - name: Publish Package to PyPI if: ${{ inputs.publish_pypi == true && inputs.test == false }} From 7d35c9b21a3a658fb051f71bc6ce4f3042ec468c Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 13:41:45 +0100 Subject: [PATCH 215/227] run release test on all --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69db6bc0..ffc83f1b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,8 +31,8 @@ jobs: uses: "./.github/workflows/reusable_buildtest.yml" with: test_linux: true - test_windows: false - test_macintosh: false + test_windows: true + test_macintosh: true build_source_dist: true upload_artifacts: true version: ${{ inputs.version }} From 6d94256d81540d494889c78bda8de19afab85ed8 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 13:55:22 +0100 Subject: [PATCH 216/227] revert artifact job --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffc83f1b..05e5ffb6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,12 @@ jobs: uses: actions/download-artifact@v4 with: # omit ‘name’ to fetch *every* artifact uploaded earlier - path: ./dist + path: ./downloaded-artifacts + + - name: Move Artifacts + run: | + mkdir -p dist + mv -v downloaded-artifacts/*/* dist/ - name: Show contents run: | From 6b0950e365a7b9b1f17dfa2a33d6f2398e5edd1d Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 14:09:17 +0100 Subject: [PATCH 217/227] fixed repo url --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05e5ffb6..e28952f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,7 +80,7 @@ jobs: with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ + repository_url: https://test.pypi.org/legacy/ # jobs: # build_and_test_ubuntu: # strategy: From ffae961432b50842c27915172919ff284adf1018 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 14:24:49 +0100 Subject: [PATCH 218/227] udpate docs --- docs/source/introduction.rst | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst index 309dd07c..85215de8 100644 --- a/docs/source/introduction.rst +++ b/docs/source/introduction.rst @@ -17,18 +17,19 @@ the Python programming language. Installation ############# -pymgclient has prebuilt binary packages for +pymgclient has prebuilt binary packages for `Python + `_ 3.10 - 3.13 on -* macOS BigSur (version 11) and newer on x86_64 with `Python - `_ 3.7+ +* Linux amd64 -* macOS Monterey (version 12) and newer on arm64 with `Python - `_ 3.8+ +* macOS 12 (Montery), 14 (Sonoma) and 15 (Sequoia) on arm64 -* Windows 10 x86_64 with `Python `_ 3.7+ +* Windows x86_64 -To intall pymgclient binaries on these platforms see `Install binaries`_ section -or check `Install from source`_ for other platforms. +To install pymgclient binaries on these platforms see `Install binaries`_ section. +A source distribution is also provided for other distributions and can be installed +using ``pip`` after installing `Build prerequisites`_; alternatively - +see `Install from source`_. Install binaries ################ @@ -40,7 +41,7 @@ Install binaries pymgclient can use the latest version of OpenSSL that is installed on your machine. -On macOS run:: +On Linux and macOS run:: $ pip3 install --user pymgclient @@ -52,6 +53,10 @@ Alternatively, on Windows, if the launcher is not installed, just run:: $ pip install --user pymgclient +.. note:: + Some platforms may require using the ``--break-system-packages`` flag. + + Install from source ################### From b9665a045498c2a7b8aff13010430fbee9562b8c Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 14:26:20 +0100 Subject: [PATCH 219/227] use self hosted --- .github/workflows/build_docs.yml | 3 +-- .github/workflows/reusable_buildtest.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 211b6550..4dfedf4d 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -19,8 +19,7 @@ on: jobs: build_docs: name: Build Documentation - #runs-on: [self-hosted, Linux, Ubuntu-24.04] - runs-on: ubuntu-24.04 + runs-on: [self-hosted, Linux, Ubuntu-24.04] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index 1f989ec5..f6cab888 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -183,8 +183,7 @@ jobs: build_source_dist: if: ${{ inputs.build_source_dist }} name: "Build Source Distribution" - #runs-on: ["self-hosted", "X64", "Ubuntu-24.04"] - runs-on: ubuntu-24.04 + runs-on: ["self-hosted", "X64", "Ubuntu-24.04"] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 From e15e640428f8a788386c0da22e4b390d244ef779 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 14:30:43 +0100 Subject: [PATCH 220/227] tidy up workflows --- .github/workflows/build_docs.yml | 12 +- .github/workflows/ci.yml | 355 +---------------------- .github/workflows/release.yml | 180 ------------ .github/workflows/reusable_buildtest.yml | 6 +- 4 files changed, 12 insertions(+), 541 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 4dfedf4d..fbfdc4b7 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -59,12 +59,12 @@ jobs: rm build/html/.buildinfo touch build/html/.nojekyll - # - name: Deploy docs - # if: ${{ github.event.inputs.publish_doc == 'true' }} - # uses: peaceiris/actions-gh-pages@v3 - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # publish_dir: ./docs/build/html + - name: Deploy docs + if: ${{ github.event.inputs.publish_doc == 'true' }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/build/html - name: Cleanup if: always() diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f81f23c6..1d6b1ec4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ on: jobs: weekly_build: if: ${{ github.event_name == 'schedule' }} - name: "Weekly Build" + name: Weekly Build uses: "./.github/workflows/reusable_buildtest.yml" with: test_linux: true @@ -46,7 +46,7 @@ jobs: pr_test: if: ${{ github.event_name == 'pull_request' }} - name: "Pull Request Tests" + name: Pull Request Tests uses: "./.github/workflows/reusable_buildtest.yml" with: test_linux: false @@ -58,7 +58,7 @@ jobs: manual_test: if: ${{ github.event_name == 'workflow_dispatch' }} - name: "Manual Test" + name: Manual Test uses: "./.github/workflows/reusable_buildtest.yml" with: test_linux: ${{ inputs.test_linux }} @@ -67,352 +67,3 @@ jobs: build_source_dist: ${{ inputs.build_source_dist }} upload_artifacts: ${{ inputs.upload_artifacts }} secrets: inherit - - -# jobs: -# build_and_test_linux: -# if: ${{ github.event_name == 'bob' }} -# name: "Build and test on Linux 👍" -# strategy: -# fail-fast: false -# matrix: -# include: -# - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: 'latest'} -# - {platform: 'ubuntu-24.04', python_version: '3.10', mgversion: 'latest'} -# - {platform: 'ubuntu-24.04', python_version: '3.11', mgversion: 'latest'} -# - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} -# - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} -# - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} -# runs-on: ["self-hosted", "X64"] -# steps: -# - name: Checkout repository and submodules -# uses: actions/checkout@v4 -# with: -# fetch-depth: 0 -# submodules: recursive - -# - name: Set Memgraph Version -# run: | -# if [[ "${{ matrix.mgversion }}" == "latest" ]]; then -# mgversion=$(./tools/get_memgraph_version.sh) -# else -# mgversion="${{ matrix.mgversion }}" -# fi -# echo "MGVERSION=$mgversion" >> $GITHUB_ENV - -# - name: Download Memgraph -# run: | -# if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then -# MEMGRAPH_PACKAGE_NAME="memgraph-${{ env.MGVERSION }}_1-1.x86_64.rpm" -# LOCAL_PACKAGE_NAME=memgraph.rpm -# else -# MEMGRAPH_PACKAGE_NAME="memgraph_${{ env.MGVERSION }}-1_amd64.deb" -# LOCAL_PACKAGE_NAME=memgraph.deb -# fi -# curl -L "https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/${{ matrix.platform }}/${MEMGRAPH_PACKAGE_NAME}" > "${LOCAL_PACKAGE_NAME}" -# echo "LOCAL_PACKAGE_NAME=$LOCAL_PACKAGE_NAME" >> $GITHUB_ENV - -# - name: Set up Docker Buildx -# id: buildx -# uses: docker/setup-buildx-action@v3 - -# - name: Log in to Docker Hub -# uses: docker/login-action@v3 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} - -# - name: Launch Docker Container -# run: | -# platform="${{ matrix.platform }}" -# tag=${platform//-/:} -# docker run -d --rm --name testcontainer "$tag" sleep infinity - -# - name: Set Environment Variables -# run: | -# break_packages="" -# static_ssl="" -# if [[ "${{ matrix.platform }}" == "ubuntu-24.04" ]]; then -# # this option is specific to ubuntu, not fedora -# break_packages="--break-system-packages" -# elif [[ "${{ matrix.platform }}" == fedora* ]]; then -# # rpm distros do not ship with static lib for openssl -# #static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" -# static_ssl="build_ext --static-openssl=False" -# fi -# echo "BREAK_PACKAGES=$break_packages" >> $GITHUB_ENV -# echo "STATIC_SSL=$static_ssl" >> $GITHUB_ENV - -# - name: Copy Repo Into Container -# run: | -# docker cp . testcontainer:/pymgclient - -# - name: Install system dependencies -# run: | -# docker cp $LOCAL_PACKAGE_NAME testcontainer:/$LOCAL_PACKAGE_NAME - -# # Prevents Memgraph from starting. -# docker exec -i testcontainer \ -# bash -c "mkdir -p /etc/systemd/system && ln -s /dev/null /etc/systemd/system/memgraph.service" - -# # Install dependencies -# docker exec -i testcontainer \ -# bash -c "cd /pymgclient && ./tools/install_linux_deps.sh ${{ matrix.platform }} --python-version ${{ matrix.python_version }} --force-update" - -# # Install Memgraph package -# if [[ "${{ matrix.platform }}" == "fedora-41" ]]; then -# docker exec -i testcontainer \ -# bash -c "dnf install -y /$LOCAL_PACKAGE_NAME" -# else -# docker exec -i testcontainer \ -# bash -c "dpkg -i /$LOCAL_PACKAGE_NAME" -# fi -# rm -v $LOCAL_PACKAGE_NAME - - -# - name: Build Python Wheel -# run: | -# docker exec -i testcontainer \ -# bash -c "cd /pymgclient && python${{ matrix.python_version }} setup.py ${{ env.STATIC_SSL }} bdist_wheel" - -# - name: Install pymgclient -# run: | -# docker exec -i testcontainer \ -# bash -c "python${{ matrix.python_version }} -m pip install ./pymgclient/dist/pymgclient-* ${{ env.BREAK_PACKAGES }}" - -# - name: Import mgclient to validate installation -# run: | -# docker exec -i testcontainer \ -# bash -c "python${{ matrix.python_version }} -c 'import mgclient'" - -# - name: Run tests -# run: | -# MEMGRAPH_PORT=10000 # what's this for? - -# docker exec -i testcontainer \ -# bash -c "cd /pymgclient && python${{ matrix.python_version }} -m pytest -v" - -# - name: Build docs -# run: | -# docker exec -i testcontainer \ -# bash -c "cd /pymgclient/docs && make html" - -# - name: Copy Package -# run: | -# docker cp testcontainer:/pymgclient/dist . - -# - name: Save source distribution package -# uses: actions/upload-artifact@v4 -# with: -# name: pymgclient -# path: dist/${{ matrix.platform }}-${{ matrix.python_version }} - -# - name: Cleanup -# if: always() -# run: | -# docker stop testcontainer || echo "Container does not exist" -# docker wait testcontainer || echo "Container does not exist" -# docker rmi ${{ env.MGVERSION }} || echo "Image does not exist" - - -# build_and_test_windows: -# name: Build and Test on Windows -# runs-on: ${{ matrix.os }} -# strategy: -# fail-fast: false -# matrix: -# os: [windows-2025] -# python-version: ["3.13"] -# # os: [windows-2022, windows-2025] -# # python-version: ["3.10", "3.11", "3.12", "3.13"] - -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# submodules: true - - -# - name: Set up MSYS2 -# uses: msys2/setup-msys2@v2 -# with: -# msystem: MINGW64 -# install: > -# git -# mingw-w64-x86_64-gcc -# mingw-w64-x86_64-cmake -# mingw-w64-x86_64-make -# mingw-w64-x86_64-openssl - -# - name: Add MSYS2 mingw64/bin to PATH -# shell: msys2 {0} -# run: | -# echo "/mingw64/bin" >> $GITHUB_PATH - - -# - name: Set up Windows Python -# uses: actions/setup-python@v5 -# with: -# python-version: ${{ matrix.python-version }} -# architecture: x64 - -# - name: Add Windows Python to PATH -# shell: msys2 {0} -# run: | -# echo "$pythonLocation" >> $GITHUB_PATH -# env: -# pythonLocation: ${{ env.pythonLocation }} - - -# - name: Install Python build tools -# shell: msys2 {0} -# run: | -# export PATH="$(cygpath -u "$pythonLocation"):$PATH" -# python -m pip install --upgrade pip setuptools wheel pyopenssl pytest -# env: -# pythonLocation: ${{ env.pythonLocation }} - -# - name: Build pymgclient Wheel -# shell: msys2 {0} -# run: | -# export PATH="$(cygpath -u "$pythonLocation"):$PATH" -# python setup.py bdist_wheel -# env: -# pythonLocation: ${{ env.pythonLocation }} - -# - name: Install built wheel -# shell: msys2 {0} -# run: | -# export PATH="$(cygpath -u "$pythonLocation"):$PATH" -# python -m pip install dist/*.whl -# env: -# pythonLocation: ${{ env.pythonLocation }} - -# - name: Setup WSL Ubuntu -# uses: Vampire/setup-wsl@v5 -# with: -# distribution: Ubuntu-24.04 - -# - name: Set Memgraph Version -# shell: bash -l {0} -# run: | -# mgversion=$(./tools/get_memgraph_version.sh) -# echo "MGVERSION=$mgversion" >> $GITHUB_ENV - -# - name: Install and Run Memgraph in WSL -# shell: wsl-bash {0} -# run: | -# mkdir -p $HOME/memgraph/data -# sudo apt update -# sudo apt install -y curl -# curl -L https://download.memgraph.com/memgraph/v${{ env.MGVERSION }}/ubuntu-24.04/memgraph_${{ env.MGVERSION }}-1_amd64.deb -o memgraph.deb -# sudo mkdir -p /etc/systemd/system && sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. -# sudo apt install ./memgraph.deb -# openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" -# nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & - -# # sleep here instead of using script because it just doesn't work in Windows -# sleep 3 -# # sed $'s/\r$//' ./tools/wait_for_memgraph.sh > ./tools/wait_for_memgraph.unix.sh -# # bash ./tools/wait_for_memgraph.unix.sh localhost - - -# - name: Run Tests -# shell: msys2 {0} -# run: | -# export PATH="$(cygpath -u "$pythonLocation"):/mingw64/bin:$PATH" -# echo $PATH -# python -m pytest -v - -# env: -# pythonLocation: ${{ env.pythonLocation }} -# MEMGRAPH_HOST: localhost -# MEMGRAPH_STARTED_WITH_SSL: - - -# - name: Upload Wheel Artifact -# uses: actions/upload-artifact@v4 -# with: -# name: pymgclient-win-${{ matrix.os }}-py${{ matrix.python-version }} -# path: dist/ - - -# # NOTE: Cannot run tests on Mac OS runners because: -# # - GitHub hosted runners don't have docker -# # - self-hosted runner unable to log in to docker due to requiring a password to unlock the keychain -# build_macos: -# name: Build and test on MacOS -# strategy: -# fail-fast: false -# matrix: -# platform: [macos-15, macos-14] -# python_version: -# - '3.10' -# - '3.11' -# - '3.12' -# - '3.13' -# include: -# - {platform: [self-hosted, macos-12, ARM64], python_version: '3.10'} -# - {platform: [self-hosted, macos-12, ARM64], python_version: '3.11'} -# - {platform: [self-hosted, macos-12, ARM64], python_version: '3.12'} -# - {platform: [self-hosted, macos-12, ARM64], python_version: '3.13'} -# runs-on: ${{ matrix.platform }} -# steps: -# - uses: actions/checkout@v2 -# with: -# submodules: true -# - name: Install python and OpenSSL -# run: | -# brew install python@${{ matrix.python_version }} openssl@1.1 -# brew link --force --overwrite openssl@1.1 -# openssl version -a -# - name: Manage OpenSSL 3 on ARM machines -# if: ${{ contains(matrix.platform, 'ARM64') }} -# run: | -# brew install openssl@3 -# brew link --force --overwrite openssl@3 -# openssl version -a -# - name: Make used python version default -# run: | -# brew unlink python@3 && brew link --force python@${{ matrix.python_version }} -# python${{ matrix.python_version }} --version -# - name: Create Virtual Env -# run: | -# python${{ matrix.python_version }} -m venv env - -# - name: Install pytest and pyopenssl -# run: | -# export PIP_BREAK_SYSTEM_PACKAGES=1 -# source env/bin/activate -# python${{ matrix.python_version }} -m pip install pyopenssl pytest setuptools - -# - name: Build pymgclient -# run: | -# source env/bin/activate -# python${{ matrix.python_version }} setup.py bdist_wheel - -# - name: Install pymgclient -# run: | -# export PIP_BREAK_SYSTEM_PACKAGES=1 -# source env/bin/activate -# python${{ matrix.python_version }} -m pip install dist/* -# - name: Import mgclient to validate installation -# run: | -# source env/bin/activate -# python${{ matrix.python_version }} -c "import mgclient" - -# - name: Save artifact name on x86 machines -# if: ${{ !contains(matrix.platform, 'ARM64') }} -# run: echo "OS_TYPE=${{ matrix.platform }}" >> $GITHUB_ENV - -# - name: Save artifact name on ARM64 machines -# if: ${{ contains(matrix.platform, 'ARM64') }} -# # Convert macOS-11.6-ARM64 to macos-11.6-arm64 to be consistent with full lowercase naming -# run: echo OS_TYPE=`echo "${{ matrix.platform[0] }}-${{ matrix.platform[1] }}" | tr "[:upper:]" "[:lower:]"` >> $GITHUB_ENV - -# - name: Save wheel package -# uses: actions/upload-artifact@v4 -# with: -# name: pymgclient-${{ env.OS_TYPE }}-${{ matrix.python_version }} -# path: dist/ - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e28952f3..c28d9414 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,183 +81,3 @@ jobs: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ -# jobs: -# build_and_test_ubuntu: -# strategy: -# matrix: -# include: -# - {platform: 'ubuntu-20.04', python_version: '3.8', mgversion: '2.10.1'} -# - {platform: 'ubuntu-22.04', python_version: '3.10', mgversion: '2.10.1'} -# runs-on: ${{ matrix.platform }} -# steps: -# - name: Install system dependencies (Ubuntu 20.04) -# run: | -# sudo apt install -y libpython${{ matrix.python_version }} python3-pip python3-setuptools -# sudo pip3 install --upgrade networkx pytest pyopenssl sphinx -# mkdir ~/memgraph -# curl -L https://download.memgraph.com/memgraph/v${{matrix.mgversion}}/ubuntu-20.04/memgraph_${{matrix.mgversion}}-1_amd64.deb > ~/memgraph/memgraph.deb -# sudo ln -s /dev/null /etc/systemd/system/memgraph.service # Prevents Memgraph from starting. -# sudo dpkg -i ~/memgraph/memgraph.deb -# - uses: actions/checkout@v2 -# with: -# submodules: true -# - name: Build source distribution -# run: python3 setup.py sdist -# - name: Install pymgclient -# run: python3 -m pip install ./dist/pymgclient-* -# - name: Run tests -# run: MEMGRAPH_PORT=10000 python3 -m pytest -# - name: Build docs -# run: | -# cd docs -# make html -# rm build/html/.buildinfo -# touch build/html/.nojekyll -# - name: Save source distribution package -# uses: actions/upload-artifact@v2 -# with: -# name: pymgclient-${{ github.event.inputs.version }} -# path: dist/ -# - name: Deploy docs -# if: ${{ github.event.inputs.publish_doc == 'true' }} -# uses: peaceiris/actions-gh-pages@v3 -# with: -# github_token: ${{ secrets.GITHUB_TOKEN }} -# publish_dir: ./docs/build/html - -# build_windows_and_test: -# runs-on: windows-2019 -# strategy: -# matrix: -# arch: -# - { mingw: "64", msys: x86_64, python: "x64"} -# python_version: -# - '3.7' -# - '3.8' -# - '3.9' -# - '3.10' -# # TODO(gitbuda): Fix "The file cannot be accessed by the system... rocksdb_durability" -# mgversion: -# - 2.8.0 -# steps: -# - uses: actions/checkout@v2 -# with: -# submodules: true -# - name: Setup python -# uses: actions/setup-python@v2.2.2 -# with: -# python-version: ${{ matrix.python_version }} -# architecture: ${{ matrix.arch.python }} -# - uses: msys2/setup-msys2@v2 -# with: -# msystem: MINGW${{ matrix.arch.mingw }} -# update: true -# release: false -# install: git mingw-w64-${{ matrix.arch.msys }}-toolchain mingw-w64-${{ matrix.arch.msys }}-cmake mingw-w64-${{ matrix.arch.msys }}-openssl -# - name: Add mingw${{ matrix.arch.mingw }} to PATH -# run: | -# # First make sure python would resolve to the windows native python, not mingw one -# echo "C:\msys64\mingw${{ matrix.arch.mingw }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 -# echo "${{ env.pythonLocation }}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 -# - name: Print OpenSSL version -# shell: msys2 {0} -# run: | -# openssl version -a -# - name: Check version -# shell: msys2 {0} -# run: | -# [ `openssl version -v | cut -d ' ' -f 2` == "${{ github.event.inputs.openssl_1_version }}" ] -# - uses: Vampire/setup-wsl@v1 -# with: -# distribution: Ubuntu-20.04 -# - name: Download, install and run Memgraph under WSL -# shell: wsl-bash {0} # root shell -# run: | -# mkdir ~/memgraph -# curl -L https://download.memgraph.com/memgraph/v${{matrix.mgversion}}/ubuntu-20.04/memgraph_${{matrix.mgversion}}-1_amd64.deb --output ~/memgraph/memgraph.deb -# dpkg -i ~/memgraph/memgraph.deb -# openssl req -x509 -newkey rsa:4096 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/C=GB/ST=London/L=London/O=Testing Corp./CN=PymgclientTest" -# nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="cert.pem" --bolt-key-file="key.pem" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' & -# sleep 1 # Wait for Memgraph a bit. -# - run: python -m pip install -U pip wheel setuptools pytest pyopenssl -# - name: Build pymgclient -# run: python setup.py bdist_wheel -# - name: Install pymgclient -# run: python -m pip install --verbose -f dist --no-index pymgclient -# env: -# VERBOSE: 1 -# - name: Run tests -# run: | -# python -m pytest -v -# env: -# MEMGRAPH_HOST: "localhost" -# MEMGRAPH_STARTED_WITH_SSL: -# - name: Save wheel package -# uses: actions/upload-artifact@v2 -# with: -# name: pymgclient-${{ github.event.inputs.version }}-win${{ matrix.arch.mingw }}-${{ matrix.python_version }} -# path: dist/ - -# build_macos: -# strategy: -# matrix: -# platform: [macos-11] -# python_version: -# - '3.7' -# - '3.8' -# - '3.9' -# - '3.10' -# include: -# - {platform: [macOS-11.6, ARM64, self-hosted], python_version: '3.10'} -# - {platform: [macOS-11.6, ARM64, self-hosted], python_version: '3.9'} -# - {platform: [macOS-11.6, ARM64, self-hosted], python_version: '3.8'} -# runs-on: ${{ matrix.platform }} -# steps: -# - uses: actions/checkout@v2 -# with: -# submodules: true -# - name: Install python -# run: | -# brew update -# brew install python@${{ matrix.python_version }} -# - name: Manage OpenSSL 1 on x86 machines -# if: ${{ !contains(matrix.platform, 'ARM64') }} -# run: | -# brew uninstall -f openssl@3 -# brew install openssl@1.1 -# brew upgrade openssl@1.1 -# brew link --force --overwrite openssl@1.1 -# openssl version -a -# [ `openssl version -v | cut -d ' ' -f 2` == "${{ github.event.inputs.openssl_1_version }}" ] -# - name: Manage OpenSSL 3 on ARM machines -# if: ${{ contains(matrix.platform, 'ARM64') }} -# run: | -# brew install openssl@3 -# brew upgrade openssl@3 -# brew link --force --overwrite openssl@3 -# openssl version -a -# [ `openssl version -v | cut -d ' ' -f 2` == "${{ github.event.inputs.openssl_3_version }}" ] -# - name: Make used python version default -# run: | -# brew unlink python@3 && brew link --force python@${{ matrix.python_version }} -# python${{ matrix.python_version }} --version -# - name: Install pytest and pyopenssl -# run: python${{ matrix.python_version }} -m pip install pyopenssl pytest -# - name: Build pymgclient -# run: python${{ matrix.python_version }} setup.py bdist_wheel -# - name: Install pymgclient -# run: python${{ matrix.python_version }} -m pip install -f dist --no-index pymgclient -# - name: Import mgclient to validate installation -# run: python${{ matrix.python_version }} -c "import mgclient" -# - name: Save artifact name on x86 machines -# if: ${{ !contains(matrix.platform, 'ARM64') }} -# run: echo "OS_TYPE=${{ matrix.platform }}" >> $GITHUB_ENV -# - name: Save artifact name on ARM64 machines -# if: ${{ contains(matrix.platform, 'ARM64') }} -# # Convert macOS-11.6-ARM64 to macos-11.6-arm64 to be consistent with full lowercase naming -# run: echo OS_TYPE=`echo "${{ matrix.platform[0] }}-${{ matrix.platform[1] }}" | tr "[:upper:]" "[:lower:]"` >> $GITHUB_ENV -# - name: Save wheel package -# uses: actions/upload-artifact@v2 -# with: -# name: pymgclient-${{ github.event.inputs.version }}-${{ env.OS_TYPE }}-${{ matrix.python_version }} -# path: dist/ diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index f6cab888..6c433cbe 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -42,7 +42,7 @@ jobs: - {platform: 'ubuntu-24.04', python_version: '3.12', mgversion: 'latest'} - {platform: 'ubuntu-24.04', python_version: '3.13', mgversion: 'latest'} - {platform: 'fedora-41', python_version: '3.13', mgversion: 'latest'} - runs-on: ["self-hosted", "X64"] + runs-on: [self-hosted, X64] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 @@ -182,8 +182,8 @@ jobs: build_source_dist: if: ${{ inputs.build_source_dist }} - name: "Build Source Distribution" - runs-on: ["self-hosted", "X64", "Ubuntu-24.04"] + name: Build Source Distribution + runs-on: [self-hosted, X64, Ubuntu-24.04] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 From 7d3b699f63457ce1c4e0197970c9b31a7a05d790 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 14:37:50 +0100 Subject: [PATCH 221/227] fix linux package version --- .github/workflows/reusable_buildtest.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index 6c433cbe..2da55b68 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -50,12 +50,6 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Set override version if provided - if: ${{ inputs.version != '' }} - run: | - echo "Building version ${{ inputs.version }}" - echo "PYMGCLIENT_OVERRIDE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV - - name: Set Memgraph Version run: | if [[ "${{ matrix.mgversion }}" == "latest" ]]; then @@ -91,7 +85,14 @@ jobs: run: | platform="${{ matrix.platform }}" tag=${platform//-/:} - docker run -d --rm --name testcontainer "$tag" sleep infinity + if [[ "${{ inputs.version }}" != "" ]]; then + echo "Building version ${{ inputs.version }}" + docker run -d --rm \ + -e PYMGCLIENT_OVERRIDE_VERSION=${{ inputs.version }} \ + --name testcontainer "$tag" sleep infinity + else + docker run -d --rm --name testcontainer "$tag" sleep infinity + fi - name: Set Environment Variables run: | From f127dddae0668d9d03ba7420582e681e154b535f Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 14:40:50 +0100 Subject: [PATCH 222/227] fix incorrect runner tags --- .github/workflows/build_docs.yml | 2 +- .github/workflows/reusable_buildtest.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index fbfdc4b7..95a1c40d 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -19,7 +19,7 @@ on: jobs: build_docs: name: Build Documentation - runs-on: [self-hosted, Linux, Ubuntu-24.04] + runs-on: [self-hosted, Linux, Ubuntu24.04] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index 2da55b68..4ff92ac8 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -184,7 +184,7 @@ jobs: build_source_dist: if: ${{ inputs.build_source_dist }} name: Build Source Distribution - runs-on: [self-hosted, X64, Ubuntu-24.04] + runs-on: [self-hosted, X64, Ubuntu24.04] steps: - name: Checkout repository and submodules uses: actions/checkout@v4 From b499430942efe70133288a1f4de67c0635f55eca Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 15:04:46 +0100 Subject: [PATCH 223/227] verbose --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c28d9414..f7485e61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,3 +81,4 @@ jobs: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ + verbose: true \ No newline at end of file From 1a1a5e032a4e14f0835e88ad756fb87106452197 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 15:30:58 +0100 Subject: [PATCH 224/227] auditwheel --- .github/workflows/reusable_buildtest.yml | 6 ++++++ tools/install_linux_deps.sh | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index 4ff92ac8..1c2e533a 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -141,6 +141,12 @@ jobs: docker exec -i testcontainer \ bash -c "cd /pymgclient && python${{ matrix.python_version }} setup.py ${{ env.STATIC_SSL }} bdist_wheel" + - name: Audit Wheel + run: | + docker exec -i testcontainer \ + bash -c "cd /pymgclient && auditwheel repair dist/*.whl --plat manylinux_2_39_x86_64 -w dist/ && rm dist/*linux_x86_64.whl" + + - name: Install pymgclient run: | docker exec -i testcontainer \ diff --git a/tools/install_linux_deps.sh b/tools/install_linux_deps.sh index bab5613c..dbc0f7cd 100755 --- a/tools/install_linux_deps.sh +++ b/tools/install_linux_deps.sh @@ -124,6 +124,7 @@ DEB_DEPS=( g++ libssl-dev netcat-traditional + patchelf ) RPM_DEPS=( @@ -182,7 +183,7 @@ esac # install python dependencies export PIP_BREAK_SYSTEM_PACKAGES=1 -pkgs=(networkx pytest pyopenssl sphinx setuptools wheel) +pkgs=(networkx pytest pyopenssl sphinx setuptools wheel auditwheel) if [[ $force_update == true ]]; then "$python_binary" -m pip install --upgrade --ignore-installed ${pkgs[@]} else From 66e7447efa6ff3caedd03508ae3f025ef82c230c Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 15:38:29 +0100 Subject: [PATCH 225/227] only auditwheel on ubuntu-24.04 --- .github/workflows/reusable_buildtest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index 1c2e533a..97a5b02c 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -142,6 +142,7 @@ jobs: bash -c "cd /pymgclient && python${{ matrix.python_version }} setup.py ${{ env.STATIC_SSL }} bdist_wheel" - name: Audit Wheel + if: ${{ matrix.platform == 'ubuntu-24.04' }} run: | docker exec -i testcontainer \ bash -c "cd /pymgclient && auditwheel repair dist/*.whl --plat manylinux_2_39_x86_64 -w dist/ && rm dist/*linux_x86_64.whl" From 5a449717d39b969a550ecb937e5f3b1ada97c246 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 1 May 2025 15:48:29 +0100 Subject: [PATCH 226/227] do full pr test --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d6b1ec4..df197471 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,11 +49,11 @@ jobs: name: Pull Request Tests uses: "./.github/workflows/reusable_buildtest.yml" with: - test_linux: false - test_windows: false - test_macintosh: false + test_linux: true + test_windows: true + test_macintosh: true build_source_dist: true - upload_artifacts: true + upload_artifacts: false secrets: inherit manual_test: From e3065961ec5fe5db43951da17b449ba1cb8526df Mon Sep 17 00:00:00 2001 From: Matt James Date: Thu, 1 May 2025 20:19:04 +0100 Subject: [PATCH 227/227] remove comment --- .github/workflows/reusable_buildtest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/reusable_buildtest.yml b/.github/workflows/reusable_buildtest.yml index 97a5b02c..d3b4cee5 100644 --- a/.github/workflows/reusable_buildtest.yml +++ b/.github/workflows/reusable_buildtest.yml @@ -103,7 +103,6 @@ jobs: break_packages="--break-system-packages" elif [[ "${{ matrix.platform }}" == fedora* ]]; then # rpm distros do not ship with static lib for openssl - #static_ssl="--no-build-isolation --global-option=build_ext --global-option '--static-openssl=False'" static_ssl="build_ext --static-openssl=False" fi echo "BREAK_PACKAGES=$break_packages" >> $GITHUB_ENV