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..a79e980e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,41 @@ [project] name = "Appium-Python-Client" -dynamic = [ - "version", - "description", - "readme", - "license", - "authors", - "maintainers", - "keywords", - "classifiers" +description = "Python client for Appium" +readme = "README.md" +license = "Apache-2.0" +license-files = ["LICENSE"] +authors = [ + {name = "Isaac Murchie", email = "isaac@saucelabs.com"}, +] +maintainers = [ + {name = "Kazuaki Matsuo"}, + {name = "Mykola Mokhnach"}, + {name = "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" +Issues = "https://github.com/appium/python-client/issues" +Changelog = "https://github.com/appium/python-client/blob/master/CHANGELOG.rst" [tool.uv] dev-dependencies = [ @@ -39,5 +60,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..8c42f5df 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-{}-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..be2ec03f 100644 --- a/setup.py +++ b/setup.py @@ -11,44 +11,37 @@ # 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 + +# 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+ + 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=', '.join([maintainer['name'] for maintainer in project['maintainers']]), + 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'], )