diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1d3ae8..0dc6b08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,10 +24,10 @@ jobs: pip_cache_dir: ${{ steps.pip-cache.outputs.dir }} steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5.2.0 + uses: actions/setup-python@v5.3.0 with: python-version: ${{ matrix.python-version }} @@ -60,10 +60,10 @@ jobs: python-version: [3.11, 3.12] steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5.2.0 + uses: actions/setup-python@v5.3.0 with: python-version: ${{ matrix.python-version }} @@ -92,7 +92,7 @@ jobs: pytest --cov=asusrouter --cov-report=xml:unit-tests-cov-${{ matrix.python-version }}.xml -k 'not test_devices' - name: Upload coverage to artifacts - uses: actions/upload-artifact@v4.4.0 + uses: actions/upload-artifact@v4.4.3 with: name: unit-tests-cov-${{ matrix.python-version }} path: unit-tests-cov-${{ matrix.python-version }}.xml @@ -106,10 +106,10 @@ jobs: python-version: [3.11, 3.12] steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5.2.0 + uses: actions/setup-python@v5.3.0 with: python-version: ${{ matrix.python-version }} @@ -138,7 +138,7 @@ jobs: pytest --cov=asusrouter --cov-report=xml:real-data-tests-cov-${{ matrix.python-version }}.xml tests/test_devices.py --log-cli-level=INFO - name: Upload coverage to artifacts - uses: actions/upload-artifact@v4.4.0 + uses: actions/upload-artifact@v4.4.3 with: name: real-data-tests-cov-${{ matrix.python-version }} path: real-data-tests-cov-${{ matrix.python-version }}.xml @@ -152,7 +152,7 @@ jobs: python-version: [3.11, 3.12] steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Download unit-tests coverage from artifacts uses: actions/download-artifact@v4.1.8 @@ -167,7 +167,7 @@ jobs: path: . - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4.5.0 + uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21e7d9b..2f0315f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,12 +14,12 @@ jobs: steps: - name: Checkout the repository - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 with: ref: ${{ github.event.release.target_commitish }} - name: Setup Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v5.2.0 + uses: actions/setup-python@v5.3.0 with: python-version: ${{ env.DEFAULT_PYTHON }} diff --git a/asusrouter/modules/firmware.py b/asusrouter/modules/firmware.py index a18c6aa..2e96265 100644 --- a/asusrouter/modules/firmware.py +++ b/asusrouter/modules/firmware.py @@ -140,7 +140,11 @@ def from_string(self, fw_string: Optional[str] = None) -> None: fw_string = clean_string(fw_string) if not fw_string: - return + return None + + # Special cases for old firmwares and absent data + if fw_string == "__": + return None pattern = ( r"^(?P[39].?0.?0.?[46])?[_.]?" diff --git a/pyproject.toml b/pyproject.toml index ad227f0..6ef8541 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "asusrouter" -version = "1.13.0" +version = "1.13.1" license = {text = "Apache-2.0"} requires-python = ">=3.11.0" readme = "README.md" diff --git a/tests/modules/test_firmware.py b/tests/modules/test_firmware.py index b9d9ecb..06d93b2 100644 --- a/tests/modules/test_firmware.py +++ b/tests/modules/test_firmware.py @@ -161,6 +161,7 @@ def test_update_source(self, revision, expected_source): ), # Additional cases (".386.7_120", None, 386, 7, 120, False, False), + ("__", None, None, None, None, False, False), # Invalid input ("", None, None, None, None, False, False), ("invalid", None, None, None, None, False, False),