diff --git a/appium/version.py b/appium/version.py index 0616a7c5..108a17d0 100644 --- a/appium/version.py +++ b/appium/version.py @@ -16,7 +16,10 @@ def _get_version(): - return metadata.version('Appium-Python-Client') + try: + return metadata.version('Appium-Python-Client') + except metadata.PackageNotFoundError: + return 'unknown' version = _get_version() diff --git a/pyproject.toml b/pyproject.toml index fd575e09..50eabe90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "Appium-Python-Client" description = "Python client for Appium" -version = "5.3.0" +version = "6.0.0" readme = "README.md" license = "Apache-2.0" license-files = ["LICENSE"] @@ -64,11 +64,6 @@ dev = [ requires = ["hatchling"] build-backend = "hatchling.build" -[tool.hatch.version] -source = "regex" -path = "appium/version.py" -pattern = "(?P\\d+\\.\\d+\\.\\d+)" - [tool.hatch.build] exclude = [ "test/", @@ -94,7 +89,7 @@ major_on_zero = true allow_zero_version = false no_git_verify = false tag_format = "v{version}" -version_toml = ["pyproject.toml:project.version"] +version_toml = ["pyproject.toml:project.version", "appium/version.py:version"] [tool.semantic_release.branches.main] match = "(main|master)" diff --git a/setup.py b/setup.py deleted file mode 100644 index f32eab92..00000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/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. - -# 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 - -setup( - name=project['name'], - version=project['version'], - 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=project['license'], - classifiers=project['classifiers'], - install_requires=project['dependencies'], -) diff --git a/uv.lock b/uv.lock index b2748668..74cc641f 100644 --- a/uv.lock +++ b/uv.lock @@ -43,7 +43,7 @@ wheels = [ [[package]] name = "appium-python-client" -version = "5.3.0" +version = "6.0.0" source = { editable = "." } dependencies = [ { name = "selenium", version = "4.36.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" },