From be8ddf425d38a6513afb1c1145a342c4120db0d7 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 22:37:29 +0900 Subject: [PATCH 1/8] chore: use version via uv --- appium/version.py | 5 ++++- pyproject.toml | 2 +- script/release.py | 8 ++------ setup.py | 4 +--- uv.lock | 1 + 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/appium/version.py b/appium/version.py index efd703e2..110f8218 100644 --- a/appium/version.py +++ b/appium/version.py @@ -1 +1,4 @@ -version = '5.1.3' +def _get_version(): + from importlib.metadata import version + return version("Appium-Python-Client") +version = _get_version() diff --git a/pyproject.toml b/pyproject.toml index a79e980e..4ea4f223 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [project] name = "Appium-Python-Client" description = "Python client for Appium" +version = "5.1.3" readme = "README.md" license = "Apache-2.0" license-files = ["LICENSE"] @@ -29,7 +30,6 @@ dependencies = [ "selenium>=4.26,<5.0", "typing-extensions~=4.13", ] -dynamic = ["version"] [project.urls] Homepage = "http://appium.io/" diff --git a/script/release.py b/script/release.py index 8c42f5df..5126a97c 100644 --- a/script/release.py +++ b/script/release.py @@ -33,9 +33,7 @@ def get_current_version(): - current = io.open(os.path.join(os.path.dirname('__file__'), 'appium', 'version.py'), encoding='utf-8').read().rstrip() - print('The current version is {}, type a new one'.format(MESSAGE_YELLOW.format(current))) - return current + call_bash_script('uv version') def get_new_version(): @@ -48,9 +46,7 @@ def get_new_version(): def update_version_file(version): - new_version = VERSION_FORMAT.format(version) - with open(VERSION_FILE_PATH, 'w') as f: - f.write(new_version) + call_bash_script(f"uv version {version}") def call_bash_script(cmd): diff --git a/setup.py b/setup.py index be2ec03f..38cea5f0 100644 --- a/setup.py +++ b/setup.py @@ -28,11 +28,9 @@ from setuptools import find_packages, setup -from appium.common.helper import library_version - setup( name=project['name'], - version=library_version(), + version=project['version'], description=project['description'], keywords=project['keywords'], author=project['authors'][0]['name'], diff --git a/uv.lock b/uv.lock index a58624af..5ab9c5c2 100644 --- a/uv.lock +++ b/uv.lock @@ -4,6 +4,7 @@ requires-python = ">=3.9" [[package]] name = "appium-python-client" +version = "5.1.3" source = { editable = "." } dependencies = [ { name = "selenium" }, From f86da7476856f04c39351569439b7c2d1683c437 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 22:41:43 +0900 Subject: [PATCH 2/8] chore: update uv version --- pyproject.toml | 1 - script/release.py | 4 ++-- setup.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4ea4f223..4bea3e81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,6 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Environment :: Console", - "License :: OSI Approved :: Apache Software License", "Topic :: Software Development :: Testing", ] requires-python = ">=3.9" diff --git a/script/release.py b/script/release.py index 5126a97c..945b8f13 100644 --- a/script/release.py +++ b/script/release.py @@ -33,7 +33,7 @@ def get_current_version(): - call_bash_script('uv version') + os.system('uv version') def get_new_version(): @@ -57,7 +57,7 @@ def call_bash_script(cmd): def commit_version_code(new_version_num): - call_bash_script('git commit {} -m "Bump {}"'.format(VERSION_FILE_PATH, new_version_num)) + call_bash_script('git commit pyproject.toml uv.lock -m "Bump {}"'.format(new_version_num)) def tag_and_generate_changelog(new_version_num): diff --git a/setup.py b/setup.py index 38cea5f0..f32eab92 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ url=project['urls']['Homepage'], package_data={'appium': ['py.typed']}, packages=find_packages(include=['appium*']), - license=project['license']['text'], + license=project['license'], classifiers=project['classifiers'], install_requires=project['dependencies'], ) From 06909268bd6a01261d45cd98c4b6ba50dd1b8e10 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 22:42:24 +0900 Subject: [PATCH 3/8] ruff --- appium/version.py | 5 ++++- script/release.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/appium/version.py b/appium/version.py index 110f8218..92d8950c 100644 --- a/appium/version.py +++ b/appium/version.py @@ -1,4 +1,7 @@ def _get_version(): from importlib.metadata import version - return version("Appium-Python-Client") + + return version('Appium-Python-Client') + + version = _get_version() diff --git a/script/release.py b/script/release.py index 945b8f13..185e9f90 100644 --- a/script/release.py +++ b/script/release.py @@ -46,7 +46,7 @@ def get_new_version(): def update_version_file(version): - call_bash_script(f"uv version {version}") + call_bash_script(f'uv version {version}') def call_bash_script(cmd): From fc88ddcd7f5d14c28c2b742b8766373698d4e54a Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 22:45:51 +0900 Subject: [PATCH 4/8] remove unused line --- script/release.py | 1 - 1 file changed, 1 deletion(-) diff --git a/script/release.py b/script/release.py index 185e9f90..02f5d502 100644 --- a/script/release.py +++ b/script/release.py @@ -21,7 +21,6 @@ import sys from typing import List -VERSION_FILE_PATH = os.path.join(os.path.dirname('__file__'), 'appium', 'version.py') CHANGELOG_PATH = os.path.join(os.path.dirname('__file__'), 'CHANGELOG.rst') APPIUM_DIR_PATH = os.path.join(os.path.dirname('__file__'), 'appium') From d00e2a3b59c399eb1fa3e1b91abea19aadd36ba3 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 22:47:51 +0900 Subject: [PATCH 5/8] fix ruff --- appium/version.py | 19 ++++++++++++++++--- script/release.py | 1 - 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/appium/version.py b/appium/version.py index 92d8950c..7a980ccd 100644 --- a/appium/version.py +++ b/appium/version.py @@ -1,7 +1,20 @@ -def _get_version(): - from importlib.metadata import version +#!/usr/bin/env python - return version('Appium-Python-Client') +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from importlib.metadata import version +def _get_version(): + return version('Appium-Python-Client') version = _get_version() diff --git a/script/release.py b/script/release.py index 02f5d502..18311135 100644 --- a/script/release.py +++ b/script/release.py @@ -14,7 +14,6 @@ """Release script to publish release module to pipy.""" import glob -import io import os import shutil import subprocess From a5c5cde6d0cf31a1b8f29aa98704f606889f6e09 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 22:59:40 +0900 Subject: [PATCH 6/8] fix ruff --- appium/version.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appium/version.py b/appium/version.py index 7a980ccd..be5d5e8c 100644 --- a/appium/version.py +++ b/appium/version.py @@ -14,7 +14,9 @@ from importlib.metadata import version + def _get_version(): return version('Appium-Python-Client') + version = _get_version() From d4645022b1184fb5323442a04282b85dd53403b6 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 23:00:53 +0900 Subject: [PATCH 7/8] fix naming --- appium/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appium/version.py b/appium/version.py index be5d5e8c..0616a7c5 100644 --- a/appium/version.py +++ b/appium/version.py @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from importlib.metadata import version +from importlib import metadata def _get_version(): - return version('Appium-Python-Client') + return metadata.version('Appium-Python-Client') version = _get_version() From 920ff5c6f7a355851ae863e64ba30e369baf9558 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 23:13:43 +0900 Subject: [PATCH 8/8] rename --- script/release.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/release.py b/script/release.py index 18311135..f3045daf 100644 --- a/script/release.py +++ b/script/release.py @@ -30,7 +30,7 @@ MESSAGE_YELLOW = '\033[1;33m{}\033[0m' -def get_current_version(): +def print_current_version(): os.system('uv version') @@ -135,7 +135,7 @@ def assert_files_count_in_package() -> None: def main(): - get_current_version() + print_current_version() new_version = get_new_version() update_version_file(new_version)