From 2834058d0d1450e9346717da70cbecf2dbf4a96c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 12 Sep 2026 22:34:37 +0000 Subject: [PATCH 1/5] 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 4d44616f84e36e9a367ffa6d97c7f97296e59832 Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Sun, 11 Oct 2026 08:00:57 +0000 Subject: [PATCH 2/5] test: add unit tests for get_npm function Adds unit tests in test/unit/webdriver/appium_service_test.py for get_npm covering POSIX, Windows, and executable not found cases. --- test/unit/webdriver/appium_service_test.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/unit/webdriver/appium_service_test.py b/test/unit/webdriver/appium_service_test.py index d0826c8f..7a166c70 100644 --- a/test/unit/webdriver/appium_service_test.py +++ b/test/unit/webdriver/appium_service_test.py @@ -53,3 +53,20 @@ 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 + + +class TestGetNpm: + def test_get_npm_success_posix(self, monkeypatch): + monkeypatch.setattr(appium_service.sys, 'platform', 'darwin') + monkeypatch.setattr(appium_service, 'find_executable', lambda executable: f'/usr/local/bin/{executable}') + assert appium_service.get_npm() == '/usr/local/bin/npm' + + def test_get_npm_success_win32(self, monkeypatch): + monkeypatch.setattr(appium_service.sys, 'platform', 'win32') + monkeypatch.setattr(appium_service, 'find_executable', lambda executable: f'C:\\Program Files\\nodejs\\{executable}') + assert appium_service.get_npm() == 'C:\\Program Files\\nodejs\\npm.cmd' + + def test_get_npm_not_found_raises_error(self, monkeypatch): + monkeypatch.setattr(appium_service, 'find_executable', lambda executable: None) + with pytest.raises(appium_service.AppiumServiceError, match='Node Package Manager executable cannot be found'): + appium_service.get_npm() From 7fd3898bdc67d602e7531cfdee70dd7aa185c55a Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Sun, 11 Oct 2026 08:51:41 +0000 Subject: [PATCH 3/5] test: add unit tests for get_npm function Adds unit tests in test/unit/webdriver/appium_service_test.py for get_npm covering POSIX, Windows, and executable not found cases. From 741f14bd9240eef3d04aa545adac3a391254fca7 Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Sun, 11 Oct 2026 09:35:08 +0000 Subject: [PATCH 4/5] test: add unit tests for get_npm function Adds unit tests in test/unit/webdriver/appium_service_test.py for get_npm covering POSIX, Windows, and executable not found cases. From 6a26093561a1190183fa628e581948087f8b84ff Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Sun, 11 Oct 2026 10:05:13 +0000 Subject: [PATCH 5/5] test: add unit tests for get_npm function Adds unit tests in test/unit/webdriver/appium_service_test.py for get_npm covering POSIX, Windows, and executable not found cases.