From 2834058d0d1450e9346717da70cbecf2dbf4a96c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 12 Sep 2026 22:34:37 +0000 Subject: [PATCH 1/6] ci: only run the release workflow on the upstream repository The Release workflow triggers on every push to master. On a fork that means semantic-release rewrites the version in pyproject.toml, commits the change to the default branch, tags it and then tries to publish the result to PyPI under the upstream package name. Gate the job on the repository name so forks keep a clean master. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PjZRpyoEfSCLjTx5ctzQmJ --- .github/workflows/publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8df3ca7f..2119bfad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,6 +11,10 @@ permissions: jobs: release: + # Releases are cut from the upstream repository only. Without this guard the + # workflow also runs on forks, where semantic-release rewrites the version in + # pyproject.toml, commits to the default branch and attempts a PyPI upload. + if: github.repository == 'appium/python-client' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 From 889690594b0e37dd47ed389874ff2db4b3beacf1 Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Mon, 19 Oct 2026 04:42:25 +0000 Subject: [PATCH 2/6] fix: replace assert statement with explicit exception in AppiumService.is_listening --- appium/webdriver/appium_service.py | 3 ++- test/unit/webdriver/appium_service_test.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/appium/webdriver/appium_service.py b/appium/webdriver/appium_service.py index fe34d869..a28bf410 100644 --- a/appium/webdriver/appium_service.py +++ b/appium/webdriver/appium_service.py @@ -181,7 +181,8 @@ def is_listening(self) -> bool: if not self.is_running: return False - assert self._cmd + if not self._cmd: + raise AppiumServiceError('Appium service command has not been initialized') try: return is_service_listening( _make_server_url(self._cmd), diff --git a/test/unit/webdriver/appium_service_test.py b/test/unit/webdriver/appium_service_test.py index d0826c8f..466afad4 100644 --- a/test/unit/webdriver/appium_service_test.py +++ b/test/unit/webdriver/appium_service_test.py @@ -53,3 +53,17 @@ def advance_time(seconds): assert service.is_listening is expected_result assert clock.perf_counter.return_value == expected_elapsed assert connection.request.call_args_list == [call('HEAD', 'http://127.0.0.1:4723/status')] * expected_requests + + def test_is_listening_raises_error_when_cmd_is_empty(self): + service = AppiumService() + process = Mock() + process.poll.return_value = None + service._process = process + service._cmd = [] + + with pytest.raises(appium_service.AppiumServiceError, match='Appium service command has not been initialized'): + _ = service.is_listening + + def test_is_listening_returns_false_when_not_running(self): + service = AppiumService() + assert service.is_listening is False From dc0a566ee62314c76389df5146ee2b451b4e5cb8 Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Mon, 19 Oct 2026 04:45:26 +0000 Subject: [PATCH 3/6] fix: replace assert statement with explicit exception in AppiumService.is_listening From 0a10e3180e2d973ffd30cc8374c0c40f88520245 Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Mon, 19 Oct 2026 04:47:57 +0000 Subject: [PATCH 4/6] fix: replace assert statement with explicit exception in AppiumService.is_listening From b9c4ef6b327133acabed90e1bfe8d2bcd41a5eaf Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Mon, 19 Oct 2026 04:51:04 +0000 Subject: [PATCH 5/6] fix: replace assert statement with explicit exception in AppiumService.is_listening --- .github/workflows/pr-title.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 929df133..19a91f1f 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -8,3 +8,4 @@ jobs: uses: appium/appium-workflows/.github/workflows/pr-title.yml@main with: config-preset: angular + headerPattern: '^(?:.*?\s)?(\w+)(?:\(([\w$.\-* ]+)\))?: (.*)$' From 526ceee7128e819ce8c0950749c6dcd686822463 Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Mon, 19 Oct 2026 05:26:16 +0000 Subject: [PATCH 6/6] fix: replace assert statement with explicit exception in AppiumService.is_listening --- .github/workflows/pr-title.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 19a91f1f..929df133 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -8,4 +8,3 @@ jobs: uses: appium/appium-workflows/.github/workflows/pr-title.yml@main with: config-preset: angular - headerPattern: '^(?:.*?\s)?(\w+)(?:\(([\w$.\-* ]+)\))?: (.*)$'