Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion appium/version.py
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
version = '5.1.3'
#!/usr/bin/env python

# 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 import metadata


def _get_version():
return metadata.version('Appium-Python-Client')


version = _get_version()
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand All @@ -21,15 +22,13 @@ 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"
dependencies = [
"selenium>=4.26,<5.0",
"typing-extensions~=4.13",
]
dynamic = ["version"]

[project.urls]
Homepage = "http://appium.io/"
Expand Down
16 changes: 5 additions & 11 deletions script/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
"""Release script to publish release module to pipy."""

import glob
import io
import os
import shutil
import subprocess
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')
Expand All @@ -32,10 +30,8 @@
MESSAGE_YELLOW = '\033[1;33m{}\033[0m'


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
def print_current_version():
os.system('uv version')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method does not return anything, but looks like it should

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original one was also to print the version in the stdout, so return value is not matter

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then the method name is confusing as get prefix implicitly assumes it must return something



def get_new_version():
Expand All @@ -48,9 +44,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):
Expand All @@ -61,7 +55,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):
Expand Down Expand Up @@ -141,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)
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -41,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'],
)
1 change: 1 addition & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.