diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 271da33..babdffd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,11 +16,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Installing build dependencies - run: ./install_dependencies.sh - - name: Installing msgq - run: SCONS_EXTRAS=1 pip3 install --break-system-packages .[dev] - - name: python tests + - name: Building msgq + run: | + export BUILD_TESTS=1 + scripts/install_dependencies.sh + pip3 install --break-system-packages .[dev] + - name: Python tests run: ${{ matrix.backend }}=1 pytest --continue-on-collection-errors --cov --cov-report=xml --cov-append - name: C++ tests run: | diff --git a/.gitignore b/.gitignore index 05501ec..d7e38f2 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,6 @@ services.h libcereal_shared.* .mypy_cache/ msgq.egg-info -build +build/ +dist/ +catch2/ diff --git a/MANIFEST.in b/MANIFEST.in index f7d3094..a65dcef 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,4 @@ exclude msgq/**/*.o -recursive-exclude msgq/tests * -recursive-exclude msgq/visionipc/tests * include SConscript include SConstruct recursive-include site_scons * diff --git a/scripts/build_wheel.sh b/scripts/build_wheel.sh new file mode 100755 index 0000000..846ae36 --- /dev/null +++ b/scripts/build_wheel.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +cd $DIR + +./install_dependencies.sh +cd .. +python3 -m build diff --git a/install_dependencies.sh b/scripts/install_dependencies.sh similarity index 81% rename from install_dependencies.sh rename to scripts/install_dependencies.sh index ec0d008..2acdda9 100755 --- a/install_dependencies.sh +++ b/scripts/install_dependencies.sh @@ -2,7 +2,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -cd $DIR +cd $DIR/../ SUDO="" @@ -49,8 +49,10 @@ $SUDO apt-get install -y --no-install-recommends \ xz-utils \ zlib1g-dev -git clone -b v2.x --depth 1 https://github.com/catchorg/Catch2.git -cd Catch2 -mv single_include/* ../ -cd .. -rm -rf Catch2 +if [[ -n "$BUILD_TESTS" ]]; then + git clone -b v2.x --depth 1 https://github.com/catchorg/Catch2.git + cd Catch2 + mv single_include/* ../ + cd .. + rm -rf Catch2 +fi diff --git a/setup.py b/setup.py index 4dfcee7..0741723 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ class SconsBuild(Command): pass def run(self) -> None: - scons_flags = '--minimal' if 'SCONS_EXTRAS' not in os.environ else '' + scons_flags = '' if 'BUILD_TESTS' in os.environ else '--minimal' subprocess.run([f"scons {scons_flags} -j$(nproc)"], shell=True).check_returncode() class CustomBuild(build):