Skip to content

Commit 43dd4f0

Browse files
committed
use uv build
1 parent d3c7511 commit 43dd4f0

File tree

4 files changed

+60
-45
lines changed

4 files changed

+60
-45
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ the Selenium Python binding update might affect the Appium Python Client behavio
5656
For example, some changes in the Selenium binding could break the Appium client.
5757

5858
> **Note**
59-
> We strongly recommend you manage dependencies with version management tools such as
59+
> We strongly recommend you manage dependencies with version management tools such as
6060
> [uv](https://docs.astral.sh/uv/) to keep compatible version combinations.
6161

6262

@@ -450,7 +450,7 @@ You have two methods to extend the read timeout.
450450
451451
```bash
452452
make install-uv
453-
exec $SHELL
453+
exec $SHELL
454454
make sync-dev
455455
```
456456
@@ -533,7 +533,7 @@ Follow the below steps.
533533
```bash
534534
uv pip install setuptools
535535
uv pip install twine
536-
uv pip install git+https://github.com/vaab/gitchangelog.git # Getting via GitHub repository is necessary for Python 3.7
536+
uv pip install gitchangelog
537537
# Type the new version number and 'yes' if you can publish it
538538
# You can test the command with DRY_RUN
539539
DRY_RUN=1 ./release.sh

pyproject.toml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
[project]
22
name = "Appium-Python-Client"
3-
dynamic = [
4-
"version",
5-
"description",
6-
"readme",
7-
"license",
8-
"authors",
9-
"maintainers",
10-
"keywords",
11-
"classifiers"
3+
description = "Python client for Appium"
4+
readme = "README.md"
5+
license = {text = "Apache 2.0"}
6+
authors = [
7+
{name = "Isaac Murchie", email = "[email protected]"},
8+
]
9+
maintainers = [
10+
{name = "Kazuaki Matsuo, Mykola Mokhnach, Mori Atsushi"},
11+
]
12+
keywords = ["appium", "selenium", "python client", "mobile automation"]
13+
classifiers = [
14+
"Development Status :: 5 - Production/Stable",
15+
"Programming Language :: Python :: 3.9",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
20+
"Environment :: Console",
21+
"License :: OSI Approved :: Apache Software License",
22+
"Topic :: Software Development :: Testing",
1223
]
1324
requires-python = ">=3.9"
1425
dependencies = [
1526
"selenium>=4.26,<5.0",
1627
"typing-extensions~=4.13",
1728
]
29+
dynamic = ["version"]
30+
31+
[project.urls]
32+
Homepage = "http://appium.io/"
33+
Repository = "https://github.com/appium/python-client"
1834

1935
[tool.uv]
2036
dev-dependencies = [
@@ -39,5 +55,12 @@ source = "regex"
3955
path = "appium/version.py"
4056
pattern = "(?P<version>\\d+\\.\\d+\\.\\d+)"
4157

58+
[tool.hatch.build]
59+
exclude = [
60+
"test/",
61+
"script/",
62+
"release.sh"
63+
]
64+
4265
[tool.hatch.build.targets.wheel]
4366
packages = ["appium"]

script/release.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ def tag_and_generate_changelog(new_version_num):
7171

7272

7373
def upload_sdist(new_version_num):
74+
wheel_file = 'dist/appium_python_client-{}3-py3-none-any.whl'.format(new_version_num)
7475
push_file = 'dist/appium_python_client-{}.tar.gz'.format(new_version_num)
7576
try:
76-
call_bash_script('uv run twine upload "{}"'.format(push_file))
77+
call_bash_script(f"uv run twine upload '{wheel_file}' '{push_file}'")
7778
except Exception as e:
7879
print(
7980
'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):
99100

100101

101102
def build_sdist():
102-
call_bash_script('uv run python setup.py sdist')
103+
call_bash_script('uv build')
103104

104105

105106
def build() -> None:

setup.py

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,35 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
import io
15-
import os
14+
15+
try:
16+
# Python 3.11+
17+
import tomllib
18+
except Exception:
19+
# for older versions
20+
import tomli as tomllib
21+
22+
with open("pyproject.toml", "rb") as f:
23+
pyproject = tomllib.load(f)
24+
project = pyproject["project"]
1625

1726
from setuptools import find_packages, setup
1827

1928
from appium.common.helper import library_version
2029

30+
2131
setup(
22-
name='Appium-Python-Client',
32+
name=project["name"],
2333
version=library_version(),
24-
description='Python client for Appium',
25-
long_description=io.open(os.path.join(os.path.dirname('__file__'), 'README.md'), encoding='utf-8').read(),
26-
long_description_content_type='text/markdown',
27-
keywords=['appium', 'selenium', 'selenium 4', 'python client', 'mobile automation'],
28-
author='Isaac Murchie',
29-
author_email='[email protected]',
30-
maintainer='Kazuaki Matsuo, Mykola Mokhnach, Mori Atsushi',
31-
url='http://appium.io/',
34+
description=project["description"],
35+
keywords=project["keywords"],
36+
author=project["authors"][0]["name"],
37+
author_email=project["authors"][0]["email"],
38+
maintainer=project["maintainers"][0]["name"],
39+
url=project["urls"]["Homepage"],
3240
package_data={'appium': ['py.typed']},
3341
packages=find_packages(include=['appium*']),
34-
license='Apache 2.0',
35-
classifiers=[
36-
'Development Status :: 5 - Production/Stable',
37-
'Programming Language :: Python',
38-
'Programming Language :: Python :: 3.9',
39-
'Programming Language :: Python :: 3.10',
40-
'Programming Language :: Python :: 3.11',
41-
'Programming Language :: Python :: 3.12',
42-
'Programming Language :: Python :: 3.13',
43-
'Environment :: Console',
44-
'Environment :: MacOS X',
45-
'Environment :: Win32 (MS Windows)',
46-
'Intended Audience :: Developers',
47-
'Intended Audience :: Other Audience',
48-
'License :: OSI Approved :: Apache Software License',
49-
'Operating System :: OS Independent',
50-
'Topic :: Software Development :: Quality Assurance',
51-
'Topic :: Software Development :: Testing',
52-
],
53-
install_requires=['selenium ~= 4.26, < 5.0'],
42+
license=project["license"]["text"],
43+
classifiers=project['classifiers'],
44+
install_requires=project['dependencies'],
5445
)

0 commit comments

Comments
 (0)