diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index aaf91788e..f8abd8926 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,4 +1,3 @@ -# Run check and build of the lib using the Bitcraze builder docker image name: Nightly Build on: @@ -13,28 +12,31 @@ jobs: matrix: os: [ubuntu-latest, lab-mac, windows-latest] python-version: ["3.10", "3.11", "3.12", "3.13"] - exclude: - - os: lab-mac - python-version: "3.13" runs-on: ${{ matrix.os }} + env: + UV_PYTHON_PREFERENCE: only-managed + steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - if: runner.os == 'Linux' || runner.os == 'Windows' - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} + enable-cache: true - - name: Set up Python ${{ matrix.python-version }} and venv on macOS - if: runner.os == 'macOS' + - name: Create venv + shell: bash run: | - brew install python@${{ matrix.python-version }} - $(brew --prefix)/bin/python${{ matrix.python-version }} -m venv venv - echo "PATH=$(pwd)/venv/bin:$PATH" >> $GITHUB_ENV + uv venv --clear --python ${{ matrix.python-version }} + if [ "$RUNNER_OS" = "Windows" ]; then + echo "$PWD/.venv/Scripts" >> $GITHUB_PATH + else + echo "$PWD/.venv/bin" >> $GITHUB_PATH + fi - name: Set up MSVC environment (Windows) uses: ilammy/msvc-dev-cmd@v1 @@ -42,49 +44,34 @@ jobs: arch: x64 if: runner.os == 'Windows' - - name: Install dependencies - run: | - python3 -m pip install --upgrade pip build setuptools - python3 -m pip install pre-commit - - - name: Code quality checks - run: pre-commit run --all-files - - name: Build wheel - run: python3 -m build --wheel + run: uv build --wheel - name: Install the built wheel + shell: bash run: | - # Find the built wheel WHEEL_FILE=$(ls dist/*.whl | head -n 1) echo "Installing wheel: $WHEEL_FILE" - pip install "$WHEEL_FILE" - shell: bash - if: runner.os != 'Windows' - - - name: Install the built wheel (Windows) - run: | - for /f %%i in ('dir /b dist\*.whl') do set WHEEL_FILE=dist\%%i - echo Installing wheel: %WHEEL_FILE% - pip install %WHEEL_FILE% - shell: cmd - if: runner.os == 'Windows' + uv pip install "$WHEEL_FILE" - name: Test - run: python3 -m unittest discover test/ + run: python -m unittest discover test/ build-docs: runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: - python-version: '3.x' + python-version: "3.13" + enable-cache: true - name: Install dependencies run: | - python3 -m pip install --upgrade pip setuptools - python3 -m pip install pdoc3 pyyaml + uv venv --clear + uv pip install -e . pdoc3 + echo "$PWD/.venv/bin" >> $GITHUB_PATH + echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV - name: Build docs run: ./tools/build-docs/build-docs diff --git a/pyproject.toml b/pyproject.toml index a2c3a5dc7..29d370615 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ dependencies = [ "scipy~=1.14", "numpy~=2.2", "packaging~=25.0", + "pyyaml>=6.0.3", ] [project.urls]