From a29896d9d0d178e41a02daa0ba8a40fce705d464 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Mon, 9 Oct 2023 10:45:55 +0200 Subject: [PATCH] Use HEAD hogql_paresr in CI --- .github/actions/run-backend-tests/action.yml | 24 ++++++++++++++++---- hogql_parser/setup.py | 12 +++++----- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/actions/run-backend-tests/action.yml b/.github/actions/run-backend-tests/action.yml index 48812f4caf992..2a591366f5826 100644 --- a/.github/actions/run-backend-tests/action.yml +++ b/.github/actions/run-backend-tests/action.yml @@ -52,8 +52,8 @@ runs: - name: Install SAML (python3-saml) dependencies shell: bash run: | - sudo apt-get update - sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl + apt update + apt install libxml2-dev libxmlsec1-dev libxmlsec1-openssl - uses: syphar/restore-virtualenv@v1 id: cache-backend-tests @@ -63,12 +63,26 @@ runs: - uses: syphar/restore-pip-download-cache@v1 if: steps.cache-backend-tests.outputs.cache-hit != 'true' - - name: Install python dependencies + - name: Install Python dependencies if: steps.cache-backend-tests.outputs.cache-hit != 'true' shell: bash run: | - python -m pip install -r requirements-dev.txt - python -m pip install -r requirements.txt + pip install -r requirements.txt -r requirements-dev.txt + + - name: Install local hogql-parser + shell: bash + # This is not cached currently, as it's important to build the current HEAD version (we can't just look at + # requirements.txt, which only has the published version) and caching just one package is not worth the effort + run: | + apt install libboost-all-dev unzip cmake curl uuid pkg-config + curl https://www.antlr.org/download/antlr4-cpp-runtime-4.13.1-source.zip --output antlr4-source.zip + unzip antlr4-source.zip -d antlr4-source && cd antlr4-source + cmake . + DESTDIR=out make install + cp -r out/usr/local/include/antlr4-runtime /usr/include/ + cp out/usr/local/lib/libantlr4-runtime.so* /usr/lib/ + ldconfig + pip install ./hogql_parser - name: Set up needed files shell: bash diff --git a/hogql_parser/setup.py b/hogql_parser/setup.py index 488bf4d71e368..b6401836afa13 100644 --- a/hogql_parser/setup.py +++ b/hogql_parser/setup.py @@ -20,12 +20,12 @@ "parser.cpp", ], include_dirs=[ - f"{homebrew_location}/include/" if is_macos else "/usr/include/", - f"{homebrew_location}/include/antlr4-runtime/" if is_macos else "/usr/include/antlr4-runtime/", - ], - library_dirs=[ - f"{homebrew_location}/lib/" if is_macos else "/usr/lib64/", - ], + f"{homebrew_location}/include/", + f"{homebrew_location}/include/antlr4-runtime/", + ] + if is_macos + else ["/usr/include/", "/usr/include/antlr4-runtime/"], + library_dirs=[f"{homebrew_location}/lib/"] if is_macos else ["/usr/lib/", "/usr/lib64/"], libraries=["antlr4-runtime"], extra_compile_args=["-std=c++20"], )