From b1cf0fc90baa75c4a40d638855a8f61040c83c71 Mon Sep 17 00:00:00 2001 From: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com> Date: Thu, 2 Mar 2023 13:48:47 -0500 Subject: [PATCH] Generate package during CI testing; support python 3.11 (#143) * Update pytest.yml * Grammar * Publish artifact for inspection * Fix whitespace * test 3.11 * Update const.py * Add notes to README for PR --- .github/workflows/pytest.yml | 23 +++++++++++++++++++++-- README.md | 1 + generate_phacc/const.py | 3 ++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 4145c4d..6767edd 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10"] + python-version: ["3.10", "3.11"] steps: - uses: actions/checkout@v2 @@ -23,9 +23,28 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install dependencies generate run: | python -m pip install --upgrade pip + pip install -r requirements_generate.txt + - name: execute generate package + run: | + export PYTHONPATH=$PYTHONPATH:$(pwd) + python generate_phacc/generate_phacc.py --regen + - name: list files + run: ls -a + - name: publish artifact + uses: actions/upload-artifact@v2 + with: + name: generated-package + path: | + ./ + !**/*.pyc + !tmp_dir/ + !.git/ + if-no-files-found: error + - name: Install dependencies test + run: | pip install -e . - name: Test with pytest run: | diff --git a/README.md b/README.md index 0efb597..6cfc3c6 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ This repository is set up to be nearly fully automatic. * Version of home-assistant/core is given in `ha_version`, `pytest_homeassistant_custom_component.const`, and in the README above. * This package is generated against published releases of homeassistant and updated daily. +* PRs should not include changes to the `pytest_homeassistant_custom_component` files. CI testing will automatically generate the new files. ### Version Strategy * When changes in extraction are required, there will be a change in the minor version. diff --git a/generate_phacc/const.py b/generate_phacc/const.py index 3500d99..99828cf 100644 --- a/generate_phacc/const.py +++ b/generate_phacc/const.py @@ -12,12 +12,13 @@ files = [ "__init__.py", + "asyncio_legacy.py", # remove when it is not longer needed "common.py", "conftest.py", "ignore_uncaught_exceptions.py", "components/recorder/common.py", "syrupy.py", - "typing.py" + "typing.py", ] # remove requirements for development only, i.e not related to homeassistant tests