mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Use UV instead of PIP in the CI (#113051)
This commit is contained in:
parent
57e6c8e07a
commit
7fd5c3ed61
43
.github/workflows/ci.yaml
vendored
43
.github/workflows/ci.yaml
vendored
@ -34,7 +34,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
CACHE_VERSION: 5
|
CACHE_VERSION: 5
|
||||||
PIP_CACHE_VERSION: 4
|
UV_CACHE_VERSION: 1
|
||||||
MYPY_CACHE_VERSION: 8
|
MYPY_CACHE_VERSION: 8
|
||||||
HA_SHORT_VERSION: "2024.4"
|
HA_SHORT_VERSION: "2024.4"
|
||||||
DEFAULT_PYTHON: "3.12"
|
DEFAULT_PYTHON: "3.12"
|
||||||
@ -56,7 +56,7 @@ env:
|
|||||||
# - 15.2 is the latest (as of 9 Feb 2023)
|
# - 15.2 is the latest (as of 9 Feb 2023)
|
||||||
POSTGRESQL_VERSIONS: "['postgres:12.14','postgres:15.2']"
|
POSTGRESQL_VERSIONS: "['postgres:12.14','postgres:15.2']"
|
||||||
PRE_COMMIT_CACHE: ~/.cache/pre-commit
|
PRE_COMMIT_CACHE: ~/.cache/pre-commit
|
||||||
PIP_CACHE: /tmp/pip-cache
|
UV_CACHE_DIR: /tmp/uv-cache
|
||||||
SQLALCHEMY_WARN_20: 1
|
SQLALCHEMY_WARN_20: 1
|
||||||
PYTHONASYNCIODEBUG: 1
|
PYTHONASYNCIODEBUG: 1
|
||||||
HASS_CI: 1
|
HASS_CI: 1
|
||||||
@ -243,7 +243,8 @@ jobs:
|
|||||||
python -m venv venv
|
python -m venv venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
python --version
|
python --version
|
||||||
pip install "$(cat requirements_test.txt | grep pre-commit)"
|
pip install "$(cat requirements_test.txt | grep uv)"
|
||||||
|
uv pip install "$(cat requirements_test.txt | grep pre-commit)"
|
||||||
- name: Restore pre-commit environment from cache
|
- name: Restore pre-commit environment from cache
|
||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v4.0.1
|
uses: actions/cache@v4.0.1
|
||||||
@ -447,10 +448,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- name: Generate partial pip restore key
|
- name: Generate partial uv restore key
|
||||||
id: generate-pip-key
|
id: generate-uv-key
|
||||||
run: >-
|
run: >-
|
||||||
echo "key=pip-${{ env.PIP_CACHE_VERSION }}-${{
|
echo "key=uv-${{ env.UV_CACHE_VERSION }}-${{
|
||||||
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT
|
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT
|
||||||
- name: Restore base Python virtual environment
|
- name: Restore base Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
@ -461,16 +462,16 @@ jobs:
|
|||||||
key: >-
|
key: >-
|
||||||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
needs.info.outputs.python_cache_key }}
|
needs.info.outputs.python_cache_key }}
|
||||||
- name: Restore pip wheel cache
|
- name: Restore uv wheel cache
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
uses: actions/cache@v4.0.1
|
uses: actions/cache@v4.0.1
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PIP_CACHE }}
|
path: ${{ env.UV_CACHE }}
|
||||||
key: >-
|
key: >-
|
||||||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
steps.generate-pip-key.outputs.key }}
|
steps.generate-uv-key.outputs.key }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-pip-${{ env.PIP_CACHE_VERSION }}-${{ env.HA_SHORT_VERSION }}-
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-uv-${{ env.UV_CACHE_VERSION }}-${{ env.HA_SHORT_VERSION }}-
|
||||||
- name: Install additional OS dependencies
|
- name: Install additional OS dependencies
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -492,10 +493,11 @@ jobs:
|
|||||||
python -m venv venv
|
python -m venv venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
python --version
|
python --version
|
||||||
PIP_CACHE_DIR=$PIP_CACHE pip install -U "pip>=21.3.1" setuptools wheel
|
pip install "$(cat requirements_test.txt | grep uv)"
|
||||||
PIP_CACHE_DIR=$PIP_CACHE pip install -r requirements_all.txt
|
uv pip install -U "pip>=21.3.1" setuptools wheel
|
||||||
PIP_CACHE_DIR=$PIP_CACHE pip install -r requirements_test.txt
|
uv pip install -r requirements_all.txt
|
||||||
pip install -e . --config-settings editable_mode=compat
|
uv pip install -r requirements_test.txt
|
||||||
|
uv pip install -e . --config-settings editable_mode=compat
|
||||||
|
|
||||||
hassfest:
|
hassfest:
|
||||||
name: Check hassfest
|
name: Check hassfest
|
||||||
@ -723,7 +725,8 @@ jobs:
|
|||||||
# Ideally this should be part of our dependencies
|
# Ideally this should be part of our dependencies
|
||||||
# However this plugin is fairly new and doesn't run correctly
|
# However this plugin is fairly new and doesn't run correctly
|
||||||
# on a non-GitHub environment.
|
# on a non-GitHub environment.
|
||||||
pip install pytest-github-actions-annotate-failures==0.1.3
|
pip install "$(cat requirements_test.txt | grep uv)"
|
||||||
|
uv pip install pytest-github-actions-annotate-failures==0.1.3
|
||||||
- name: Register pytest slow test problem matcher
|
- name: Register pytest slow test problem matcher
|
||||||
run: |
|
run: |
|
||||||
echo "::add-matcher::.github/workflows/matchers/pytest-slow.json"
|
echo "::add-matcher::.github/workflows/matchers/pytest-slow.json"
|
||||||
@ -876,14 +879,15 @@ jobs:
|
|||||||
# Ideally this should be part of our dependencies
|
# Ideally this should be part of our dependencies
|
||||||
# However this plugin is fairly new and doesn't run correctly
|
# However this plugin is fairly new and doesn't run correctly
|
||||||
# on a non-GitHub environment.
|
# on a non-GitHub environment.
|
||||||
pip install pytest-github-actions-annotate-failures==0.1.3
|
pip install "$(cat requirements_test.txt | grep uv)"
|
||||||
|
uv pip install pytest-github-actions-annotate-failures==0.1.3
|
||||||
- name: Register pytest slow test problem matcher
|
- name: Register pytest slow test problem matcher
|
||||||
run: |
|
run: |
|
||||||
echo "::add-matcher::.github/workflows/matchers/pytest-slow.json"
|
echo "::add-matcher::.github/workflows/matchers/pytest-slow.json"
|
||||||
- name: Install SQL Python libraries
|
- name: Install SQL Python libraries
|
||||||
run: |
|
run: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pip install mysqlclient sqlalchemy_utils
|
uv pip install mysqlclient sqlalchemy_utils
|
||||||
- name: Compile English translations
|
- name: Compile English translations
|
||||||
run: |
|
run: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
@ -1003,14 +1007,15 @@ jobs:
|
|||||||
# Ideally this should be part of our dependencies
|
# Ideally this should be part of our dependencies
|
||||||
# However this plugin is fairly new and doesn't run correctly
|
# However this plugin is fairly new and doesn't run correctly
|
||||||
# on a non-GitHub environment.
|
# on a non-GitHub environment.
|
||||||
pip install pytest-github-actions-annotate-failures==0.1.3
|
pip install "$(cat requirements_test.txt | grep uv)"
|
||||||
|
uv pip install pytest-github-actions-annotate-failures==0.1.3
|
||||||
- name: Register pytest slow test problem matcher
|
- name: Register pytest slow test problem matcher
|
||||||
run: |
|
run: |
|
||||||
echo "::add-matcher::.github/workflows/matchers/pytest-slow.json"
|
echo "::add-matcher::.github/workflows/matchers/pytest-slow.json"
|
||||||
- name: Install SQL Python libraries
|
- name: Install SQL Python libraries
|
||||||
run: |
|
run: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pip install psycopg2 sqlalchemy_utils
|
uv pip install psycopg2 sqlalchemy_utils
|
||||||
- name: Compile English translations
|
- name: Compile English translations
|
||||||
run: |
|
run: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
|
@ -50,3 +50,4 @@ types-pytz==2023.3.1.1
|
|||||||
types-PyYAML==6.0.12.12
|
types-PyYAML==6.0.12.12
|
||||||
types-requests==2.31.0.3
|
types-requests==2.31.0.3
|
||||||
types-xmltodict==0.13.0.3
|
types-xmltodict==0.13.0.3
|
||||||
|
uv==0.1.17
|
Loading…
x
Reference in New Issue
Block a user