diff --git a/README.md b/README.md index b7768faa..77be5a35 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ download and unarchive the source tarball (Appium-Python-Client-X.X.tar.gz). ```shell tar -xvf Appium-Python-Client-X.X.tar.gz cd Appium-Python-Client-X.X - python setup.py install + pip install . ``` 3. Install from source via [GitHub](https://github.com/appium/python-client). @@ -34,7 +34,7 @@ download and unarchive the source tarball (Appium-Python-Client-X.X.tar.gz). ```shell git clone git@github.com:appium/python-client.git cd python-client - python setup.py install + pip install . ``` ## Compatibility Matrix diff --git a/appium/version.py b/appium/version.py index 0616a7c5..6398ce53 100644 --- a/appium/version.py +++ b/appium/version.py @@ -12,11 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from importlib import metadata +from importlib.metadata import version as _metadata_version - -def _get_version(): - return metadata.version('Appium-Python-Client') - - -version = _get_version() +version = _metadata_version('Appium-Python-Client') diff --git a/pyproject.toml b/pyproject.toml index fd575e09..1735971e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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/", 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'], -)