From 43dd4f018285bb8cb739a8dd4a59f4f6008676bb Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 21:32:31 +0900 Subject: [PATCH 1/7] use uv build --- README.md | 6 +++--- pyproject.toml | 41 ++++++++++++++++++++++++++++-------- script/release.py | 5 +++-- setup.py | 53 ++++++++++++++++++++--------------------------- 4 files changed, 60 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 2469bfa4..92758047 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ the Selenium Python binding update might affect the Appium Python Client behavio For example, some changes in the Selenium binding could break the Appium client. > **Note** -> We strongly recommend you manage dependencies with version management tools such as +> We strongly recommend you manage dependencies with version management tools such as > [uv](https://docs.astral.sh/uv/) to keep compatible version combinations. @@ -450,7 +450,7 @@ You have two methods to extend the read timeout. ```bash make install-uv -exec $SHELL +exec $SHELL make sync-dev ``` @@ -533,7 +533,7 @@ Follow the below steps. ```bash uv pip install setuptools uv pip install twine -uv pip install git+https://github.com/vaab/gitchangelog.git # Getting via GitHub repository is necessary for Python 3.7 +uv pip install gitchangelog # Type the new version number and 'yes' if you can publish it # You can test the command with DRY_RUN DRY_RUN=1 ./release.sh diff --git a/pyproject.toml b/pyproject.toml index 8ee6a84f..aad5b59c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,36 @@ [project] name = "Appium-Python-Client" -dynamic = [ - "version", - "description", - "readme", - "license", - "authors", - "maintainers", - "keywords", - "classifiers" +description = "Python client for Appium" +readme = "README.md" +license = {text = "Apache 2.0"} +authors = [ + {name = "Isaac Murchie", email = "isaac@saucelabs.com"}, +] +maintainers = [ + {name = "Kazuaki Matsuo, Mykola Mokhnach, Mori Atsushi"}, +] +keywords = ["appium", "selenium", "python client", "mobile automation"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "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" dependencies = [ "selenium>=4.26,<5.0", "typing-extensions~=4.13", ] +dynamic = ["version"] + +[project.urls] +Homepage = "http://appium.io/" +Repository = "https://github.com/appium/python-client" [tool.uv] dev-dependencies = [ @@ -39,5 +55,12 @@ source = "regex" path = "appium/version.py" pattern = "(?P\\d+\\.\\d+\\.\\d+)" +[tool.hatch.build] +exclude = [ + "test/", + "script/", + "release.sh" +] + [tool.hatch.build.targets.wheel] packages = ["appium"] diff --git a/script/release.py b/script/release.py index 1beab96f..4a09e636 100644 --- a/script/release.py +++ b/script/release.py @@ -71,9 +71,10 @@ def tag_and_generate_changelog(new_version_num): def upload_sdist(new_version_num): + wheel_file = 'dist/appium_python_client-{}3-py3-none-any.whl'.format(new_version_num) push_file = 'dist/appium_python_client-{}.tar.gz'.format(new_version_num) try: - call_bash_script('uv run twine upload "{}"'.format(push_file)) + call_bash_script(f"uv run twine upload '{wheel_file}' '{push_file}'") except Exception as e: print( 'Failed to upload {} to pypi. Please fix the original error and push it again later. Original error: {}'.format( @@ -99,7 +100,7 @@ def ensure_publication(new_version_num): def build_sdist(): - call_bash_script('uv run python setup.py sdist') + call_bash_script('uv build') def build() -> None: diff --git a/setup.py b/setup.py index adf89441..5c003b03 100644 --- a/setup.py +++ b/setup.py @@ -11,44 +11,35 @@ # 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. -import io -import os + +try: + # Python 3.11+ + import tomllib +except Exception: + # for older versions + import tomli as tomllib + +with open("pyproject.toml", "rb") as f: + pyproject = tomllib.load(f) + project = pyproject["project"] from setuptools import find_packages, setup from appium.common.helper import library_version + setup( - name='Appium-Python-Client', + name=project["name"], version=library_version(), - description='Python client for Appium', - long_description=io.open(os.path.join(os.path.dirname('__file__'), 'README.md'), encoding='utf-8').read(), - long_description_content_type='text/markdown', - keywords=['appium', 'selenium', 'selenium 4', 'python client', 'mobile automation'], - author='Isaac Murchie', - author_email='isaac@saucelabs.com', - maintainer='Kazuaki Matsuo, Mykola Mokhnach, Mori Atsushi', - url='http://appium.io/', + description=project["description"], + keywords=project["keywords"], + author=project["authors"][0]["name"], + author_email=project["authors"][0]["email"], + maintainer=project["maintainers"][0]["name"], + url=project["urls"]["Homepage"], package_data={'appium': ['py.typed']}, packages=find_packages(include=['appium*']), - license='Apache 2.0', - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Environment :: Console', - 'Environment :: MacOS X', - 'Environment :: Win32 (MS Windows)', - 'Intended Audience :: Developers', - 'Intended Audience :: Other Audience', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: OS Independent', - 'Topic :: Software Development :: Quality Assurance', - 'Topic :: Software Development :: Testing', - ], - install_requires=['selenium ~= 4.26, < 5.0'], + license=project["license"]["text"], + classifiers=project['classifiers'], + install_requires=project['dependencies'], ) From ebbf8a7d9330c543458a6441c8bc423440b93ec8 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 21:39:15 +0900 Subject: [PATCH 2/7] add comment --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 5c003b03..0c7bdab3 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +# FIXME: Remove this setup.py completely + try: # Python 3.11+ import tomllib From 98d4b046cb8f5bec39703a418d7cc0d01f7cf6d8 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 21:39:39 +0900 Subject: [PATCH 3/7] add comment --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0c7bdab3..300fd4bf 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# FIXME: Remove this setup.py completely +# FIXME: Remove this setup.py completely. +# Then, we should bump the major version since the package will not include setup.py. try: # Python 3.11+ From 7ef0b718d6bdcf07bbd8b70ae4a6009d1761c2be Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 21:43:02 +0900 Subject: [PATCH 4/7] remove a new line --- script/release.py | 2 +- setup.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/script/release.py b/script/release.py index 4a09e636..8c42f5df 100644 --- a/script/release.py +++ b/script/release.py @@ -71,7 +71,7 @@ def tag_and_generate_changelog(new_version_num): def upload_sdist(new_version_num): - wheel_file = 'dist/appium_python_client-{}3-py3-none-any.whl'.format(new_version_num) + wheel_file = 'dist/appium_python_client-{}-py3-none-any.whl'.format(new_version_num) push_file = 'dist/appium_python_client-{}.tar.gz'.format(new_version_num) try: call_bash_script(f"uv run twine upload '{wheel_file}' '{push_file}'") diff --git a/setup.py b/setup.py index 300fd4bf..f11ad328 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ from appium.common.helper import library_version - setup( name=project["name"], version=library_version(), From f32d3d5ef58c73d470df9cfb9334a2e2106c92f9 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 21:44:53 +0900 Subject: [PATCH 5/7] reformat --- setup.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index f11ad328..0b0d739a 100644 --- a/setup.py +++ b/setup.py @@ -22,26 +22,26 @@ # for older versions import tomli as tomllib -with open("pyproject.toml", "rb") as f: +with open('pyproject.toml', 'rb') as f: pyproject = tomllib.load(f) - project = pyproject["project"] + project = pyproject['project'] from setuptools import find_packages, setup from appium.common.helper import library_version setup( - name=project["name"], + name=project['name'], version=library_version(), - description=project["description"], - keywords=project["keywords"], - author=project["authors"][0]["name"], - author_email=project["authors"][0]["email"], - maintainer=project["maintainers"][0]["name"], - url=project["urls"]["Homepage"], + description=project['description'], + keywords=project['keywords'], + author=project['authors'][0]['name'], + author_email=project['authors'][0]['email'], + maintainer=project['maintainers'][0]['name'], + url=project['urls']['Homepage'], package_data={'appium': ['py.typed']}, packages=find_packages(include=['appium*']), - license=project["license"]["text"], + license=project['license']['text'], classifiers=project['classifiers'], install_requires=project['dependencies'], ) From 97172e55bd036b5ceaf14d8142782633ee3b7c96 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 22:07:56 +0900 Subject: [PATCH 6/7] update review, metadatas --- pyproject.toml | 9 +++++++-- setup.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aad5b59c..a79e980e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,12 +2,15 @@ name = "Appium-Python-Client" description = "Python client for Appium" readme = "README.md" -license = {text = "Apache 2.0"} +license = "Apache-2.0" +license-files = ["LICENSE"] authors = [ {name = "Isaac Murchie", email = "isaac@saucelabs.com"}, ] maintainers = [ - {name = "Kazuaki Matsuo, Mykola Mokhnach, Mori Atsushi"}, + {name = "Kazuaki Matsuo"}, + {name = "Mykola Mokhnach"}, + {name = "Mori Atsushi"}, ] keywords = ["appium", "selenium", "python client", "mobile automation"] classifiers = [ @@ -31,6 +34,8 @@ dynamic = ["version"] [project.urls] Homepage = "http://appium.io/" Repository = "https://github.com/appium/python-client" +Issues = "https://github.com/appium/python-client/issues" +Changelog = "https://github.com/appium/python-client/blob/master/CHANGELOG.rst" [tool.uv] dev-dependencies = [ diff --git a/setup.py b/setup.py index 0b0d739a..978d5116 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ keywords=project['keywords'], author=project['authors'][0]['name'], author_email=project['authors'][0]['email'], - maintainer=project['maintainers'][0]['name'], + maintainer=", ".join([maintainer["name"] for maintainer in project['maintainers']]), url=project['urls']['Homepage'], package_data={'appium': ['py.typed']}, packages=find_packages(include=['appium*']), From cc6bd5ddec07e13d67c65723dbb448d18598fb3d Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 7 Aug 2025 22:10:39 +0900 Subject: [PATCH 7/7] fix format --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 978d5116..be2ec03f 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ keywords=project['keywords'], author=project['authors'][0]['name'], author_email=project['authors'][0]['email'], - maintainer=", ".join([maintainer["name"] for maintainer in project['maintainers']]), + maintainer=', '.join([maintainer['name'] for maintainer in project['maintainers']]), url=project['urls']['Homepage'], package_data={'appium': ['py.typed']}, packages=find_packages(include=['appium*']),