Browse Source

Bump tinytuya to 1.18.0 release

- update development environment to fully utilize uv, replacing requirements.txt, requirements-dev.txt and setup.cfg with pyproject.toml
- enabled some extra ruff checks
Jason Rumney 1 day ago
parent
commit
429f742d2f

+ 0 - 1
.github/workflows/hacs-validate.yml

@@ -19,4 +19,3 @@ jobs:
         with:
         with:
           category: integration
           category: integration
           ignore: wheels
           ignore: wheels
-

+ 1 - 3
.github/workflows/jsontests.yml

@@ -38,7 +38,5 @@ jobs:
           python-version: ${{ matrix.python-version }}
           python-version: ${{ matrix.python-version }}
       - name: Install uv
       - name: Install uv
         uses: astral-sh/setup-uv@v7
         uses: astral-sh/setup-uv@v7
-      - name: Install dependencies
-        run: uv pip install -r requirements-dev.txt
       - name: Translations check with pytest
       - name: Translations check with pytest
-        run: pytest tests/test_translations.py
+        run: uv run pytest tests/test_translations.py

+ 4 - 6
.github/workflows/linting.yml

@@ -22,13 +22,11 @@ jobs:
 
 
       - name: Install uv
       - name: Install uv
         uses: astral-sh/setup-uv@v7
         uses: astral-sh/setup-uv@v7
-      - name: Install dependencies
-        run: uv pip install -r requirements-dev.txt
       - name: Python lint
       - name: Python lint
-        run: ruff check --output-format=github .
+        run: uv run ruff check --output-format=github .
       - name: Python include order
       - name: Python include order
-        run: ruff check --select I --diff .
+        run: uv run ruff check --select I --diff .
       - name: Python coding style
       - name: Python coding style
-        run: ruff format --check --diff .
+        run: uv run ruff format --check --diff .
       - name: YAML lint
       - name: YAML lint
-        run: yamllint --format github custom_components/tuya_local/devices
+        run: uv run yamllint --format github custom_components/tuya_local/devices

+ 1 - 2
.github/workflows/tests.yml

@@ -39,9 +39,8 @@ jobs:
         run: |
         run: |
           sudo apt-get update
           sudo apt-get update
           sudo apt-get install libturbojpeg
           sudo apt-get install libturbojpeg
-          uv pip install -r requirements-dev.txt
       - name: Full test with pytest
       - name: Full test with pytest
-        run: pytest --cov=custom_components/tuya_local --cov-report term:skip-covered --junit-xml=test-results.xml
+        run: uv run pytest --cov=custom_components/tuya_local --cov-report term:skip-covered --junit-xml=test-results.xml
       - name: Surface results
       - name: Surface results
         if: always()
         if: always()
         uses: pmeier/pytest-results-action@main
         uses: pmeier/pytest-results-action@main

+ 2 - 4
.github/workflows/yamltests.yml

@@ -36,9 +36,7 @@ jobs:
           python-version: ${{ matrix.python-version }}
           python-version: ${{ matrix.python-version }}
       - name: Install uv
       - name: Install uv
         uses: astral-sh/setup-uv@v7
         uses: astral-sh/setup-uv@v7
-      - name: Install dependencies
-        run:  uv pip install -r requirements-dev.txt
       - name: Device configs check with pytest
       - name: Device configs check with pytest
         run: |
         run: |
-          pytest tests/test_device_config.py
-          python util/untranslated_entities.py
+          uv run pytest tests/test_device_config.py
+          uv run python util/untranslated_entities.py

+ 2 - 2
custom_components/tuya_local/manifest.json

@@ -15,8 +15,8 @@
         "tinytuya"
         "tinytuya"
     ],
     ],
     "requirements": [
     "requirements": [
-        "tinytuya==1.17.6",
+        "tinytuya==1.18.0",
         "tuya-device-sharing-sdk~=0.2.4"
         "tuya-device-sharing-sdk~=0.2.4"
     ],
     ],
-    "version": "2026.4.1"
+    "version": "2026.4.2"
 }
 }

+ 40 - 2
pyproject.toml

@@ -1,5 +1,43 @@
-[tool.black]
-target-version = ["py313"]
+[project]
+name = "Tuya-Local"
+description = "A Home Assistant integration for local control of Tuya devices."
+version = "2026.4.2"
+requires-python = ">3.14.2"
+dependencies = [
+  "tinytuya~=1.18.0",
+  "tuya-device-sharing-sdk~=0.2.4"
+]
+readme = "README.md"
+license = "MIT"
+license-file = "LICENSE.md"
+
+[dependency-groups]
+dev = [
+  "fuzzywuzzy",
+  "infrared-protocols~=1.1",
+  "levenshtein",
+  "PyTurboJPEG~=1.8.0",
+  "pytest-homeassistant-custom-component==0.13.322",
+  "pytest",
+  "pytest-asyncio",
+  "pytest-cov",
+  "pytest-mock",
+  "ruff",
+  "yamllint"
+]
 
 
 [tool.pytest.ini_options]
 [tool.pytest.ini_options]
 asyncio_mode = "auto"
 asyncio_mode = "auto"
+
+[tool.ruff]
+target-version = "py314"
+
+[tool.ruff.lint]
+select = [
+  "F",     # pyflakes
+  "E",     # pycodestyle
+  "W",     # pycodestyle warnings
+  "S",     # flake8-bandit
+  "B",     # flake8-bugbear
+  "A",     # flake8-builtins
+]

+ 0 - 13
requirements-dev.txt

@@ -1,13 +0,0 @@
-fuzzywuzzy
-infrared-protocols~=1.1
-levenshtein
-PyTurboJPEG~=1.8.0
-pytest-homeassistant-custom-component==0.13.322
-pytest
-pytest-asyncio
-pytest-cov
-pytest-mock
-ruff
-tinytuya~=1.17.6
-tuya-device-sharing-sdk~=0.2.8
-yamllint

+ 0 - 2
requirements.txt

@@ -1,2 +0,0 @@
-tinytuya~=1.17.6
-tuya-device-sharing-sdk~=0.2.4

+ 0 - 5
setup.cfg

@@ -1,5 +0,0 @@
-[isort]
-profile=black
-
-[tool:pytest]
-asyncio_mode=auto