Skip to content

Commit 2cb5578

Browse files
setup
1 parent af4c330 commit 2cb5578

File tree

5 files changed

+26
-33
lines changed

5 files changed

+26
-33
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -488,19 +488,19 @@ export "PATH=/venv/root/folder/bin:$PATH"
488488
#### Unit
489489
490490
```bash
491-
$ uv run pytest test/unit
491+
uv run pytest test/unit
492492
```
493493
494494
Run in parallel (2 threads)
495495
496496
```bash
497-
$ uv run pytest -n 2 test/unit
497+
uv run pytest -n 2 test/unit
498498
```
499499
500500
#### Functional
501501
502502
```bash
503-
$ uv run pytest test/functional/ios/search_context/find_by_ios_class_chain_tests.py
503+
uv run pytest test/functional/ios/search_context/find_by_ios_class_chain_tests.py
504504
```
505505
506506
#### In parallel for iOS
@@ -509,20 +509,21 @@ $ uv run pytest test/functional/ios/search_context/find_by_ios_class_chain_tests
509509
1. Run tests
510510
511511
```bash
512-
$ uv run pytest -n 2 test/functional/ios/search_context/find_by_ios_class_chain_tests.py
512+
uv run pytest -n 2 test/functional/ios/search_context/find_by_ios_class_chain_tests.py
513513
```
514514
515515
## Release
516516
517517
Follow the below steps.
518518
519519
```bash
520-
$ pip install twine
521-
$ pip install git+git://github.com/vaab/gitchangelog.git # Getting via GitHub repository is necessary for Python 3.7
520+
uv pip install setuptools
521+
uv pip install twine
522+
uv pip install git+https://github.com/vaab/gitchangelog.git # Getting via GitHub repository is necessary for Python 3.7
522523
# Type the new version number and 'yes' if you can publish it
523524
# You can test the command with DRY_RUN
524-
$ DRY_RUN=1 ./release.sh
525-
$ ./release.sh # release
525+
DRY_RUN=1 ./release.sh
526+
./release.sh # release
526527
```
527528
528529
If the `pypi` was not able to publish with user name and password, please try out `-u` and `-p` option by yourself with `twine` such as `twine upload -u <name> -p <pass> dist/Appium-Python-Client-4.1.0.tar.gz`.

pyproject.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
[project]
22
name = "Appium-Python-Client"
3-
dynamic = ["version"]
3+
dynamic = [
4+
"version",
5+
"description",
6+
"readme",
7+
"license",
8+
"authors",
9+
"maintainers",
10+
"keywords",
11+
"classifiers"
12+
]
413
requires-python = ">=3.9"
514
dependencies = [
6-
"selenium==4.33.0",
15+
"selenium>=4.26,<5.0",
716
"typing-extensions~=4.13.2",
817
]
918

release.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
set -e
44
set -o pipefail
55

6-
if [ -z "$PYTHON_BIN_PATH" ]; then
7-
PYTHON_BIN_PATH=$(which python || true)
8-
fi
9-
10-
export PYTHON_BIN_PATH
11-
126
CONFIGURE_DIR=$(dirname "$0")
13-
"$PYTHON_BIN_PATH" "${CONFIGURE_DIR}/script/release.py" "$@"
7+
uv run python "${CONFIGURE_DIR}/script/release.py" "$@"
148

159
echo "Finish release process"

script/release.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ def commit_version_code(new_version_num):
6666

6767
def tag_and_generate_changelog(new_version_num):
6868
call_bash_script('git tag "v{}"'.format(new_version_num))
69-
call_bash_script('gitchangelog > {}'.format(CHANGELOG_PATH))
69+
call_bash_script('uv run gitchangelog > {}'.format(CHANGELOG_PATH))
7070
call_bash_script('git commit {} -m "Update changelog for {}"'.format(CHANGELOG_PATH, new_version_num))
7171

7272

7373
def upload_sdist(new_version_num):
7474
push_file = 'dist/appium_python_client-{}.tar.gz'.format(new_version_num)
7575
try:
76-
call_bash_script('twine upload "{}"'.format(push_file))
76+
call_bash_script('uv run twine upload "{}"'.format(push_file))
7777
except Exception as e:
7878
print(
7979
'Failed to upload {} to pypi. Please fix the original error and push it again later. Original error: {}'.format(
@@ -99,21 +99,12 @@ def ensure_publication(new_version_num):
9999

100100

101101
def build_sdist():
102-
call_bash_script('{} setup.py sdist'.format(sys.executable))
103-
104-
105-
def validate_release_env():
106-
if os.system('which twine') != 0:
107-
sys.exit("Please get twine via 'pip install twine'")
108-
if os.system('which gitchangelog') != 0:
109-
sys.exit(
110-
"Please get twine via 'pip install gitchangelog' or 'pip install git+git://github.com/vaab/gitchangelog.git' for Python 3.7"
111-
)
102+
call_bash_script('uv run python setup.py sdist')
112103

113104

114105
def build() -> None:
115106
shutil.rmtree(BUILT_APPIUM_DIR_PATH, ignore_errors=True)
116-
status, output = subprocess.getstatusoutput('{} setup.py install'.format(os.getenv('PYTHON_BIN_PATH')))
107+
status, output = subprocess.getstatusoutput('uv run python setup.py install')
117108
if status != 0:
118109
sys.exit(f'Failed to build the package:\n{output}')
119110

@@ -149,8 +140,6 @@ def assert_files_count_in_package() -> None:
149140

150141

151142
def main():
152-
validate_release_env()
153-
154143
get_current_version()
155144
new_version = get_new_version()
156145

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)