Skip to content

Commit dacfdc0

Browse files
committed
feat: migrate from venv -> uv
1 parent 33941d8 commit dacfdc0

File tree

6 files changed

+836
-38
lines changed

6 files changed

+836
-38
lines changed

.github/workflows/lint-python.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,14 @@ jobs:
3232
- name: checkout
3333
uses: actions/checkout@v4
3434

35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v5
37+
3538
- name: Set up Python ${{ matrix.python-version }}
3639
uses: actions/setup-python@v5
3740
with:
41+
cache-dependency-path: "pyproject.toml"
3842
python-version: ${{ matrix.python-version }}
3943

40-
- uses: actions/cache@v4
41-
with:
42-
path: ~/.cache/pip
43-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
44-
restore-keys: |
45-
${{ runner.os }}-pip-
46-
4744
- name: Lint
48-
run: |
49-
pip install -r requirements.txt
50-
pip install pylint flake8 setuptools
51-
make lint_python3
45+
run: make lint_python3

Makefile

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,12 @@ clean:
99
rm -rf build/ dist/ # Cleanup build dir
1010

1111
setup:
12-
brew install pandoc sphinx-doc
12+
brew install pandoc sphinx-doc uv
1313
brew link --force sphinx-doc
14-
python3 -m pip install -r requirements.txt
14+
uv sync
1515

1616
build: clean
17-
# Upgrade setup tools
18-
python3 -m pip install --user --upgrade setuptools wheel twine
19-
# Build package
20-
python3 setup.py sdist bdist_wheel
21-
# Check package
22-
python3 -m twine check dist/*
23-
17+
uv build
2418

2519
release_debug: documentation
2620
./release.py test release
@@ -38,23 +32,23 @@ lint_python3:
3832
# adbe/adbe.py:764:8: W0601: Global variable 'screen_record_file_path_on_device' undefined at the module level (global-variable-undefined)
3933
# adbe/adbe.py:752:4: W0621: Redefining name 'screen_record_file_path_on_device' from outer scope (line 759) (redefined-outer-name)
4034
# C0111: Missing function docstring (missing-docstring)
41-
pylint --disable=C0103,C0111,C0209,W1514 release.py setup.py
42-
pylint adbe/*.py tests/*.py --disable=R0123,R0911,R0912,R0914,R0915,R1705,R1710,C0103,C0111,C0209,C0301,C0302,C1801,W0511,W0621,W0601,W0602,W0603
43-
flake8 adbe --count --ignore=F401,E126,E501,W504 --show-source --statistics
35+
uv run -- pylint --disable=C0103,C0111,C0209,W1514 release.py setup.py
36+
uv run -- pylint adbe/*.py tests/*.py --disable=R0123,R0911,R0912,R0914,R0915,R1705,R1710,C0103,C0111,C0209,C0301,C0302,C1801,W0511,W0621,W0601,W0602,W0603
37+
uv run -- flake8 adbe --count --ignore=F401,E126,E501,W504 --show-source --statistics
4438
# Default complexity limit is 10
4539
# Default line length limit is 127
46-
flake8 adbe --count --exit-zero --ignore=F401,E126,E501,W504 --max-complexity=13 --max-line-length=127 --statistics
40+
uv run -- flake8 adbe --count --exit-zero --ignore=F401,E126,E501,W504 --max-complexity=13 --max-line-length=127 --statistics
4741

4842
# To run a single test, for example, test_file_move3, try this
4943
# python3 -m pytest -v tests/adbe_tests.py -k test_file_move3
5044
test_python3:
5145
echo "Wait for device"
5246
adb wait-for-device
5347
echo "Run the tests"
54-
python3 -m pytest -v tests/adbe_tests.py # Python3 tests
48+
uv run -- pytest -v tests/adbe_tests.py # Python3 tests
5549

5650
test_python3_installation:
5751
echo "Wait for device"
5852
adb wait-for-device
5953
echo "Run the tests"
60-
python3 -m pytest -v tests/adbe_tests.py --durations=0 --testpythoninstallation true
54+
uv run -- pytest -v tests/adbe_tests.py --durations=0 --testpythoninstallation true

pyproject.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[project]
2+
authors = [
3+
{name = "Ashish Bhatia", email="ashishb@ashishb.net"},
4+
]
5+
name = "adb-enhanced"
6+
# Ref: https://pypi.org/pypi?%3Aaction=list_classifiers
7+
classifiers=[
8+
"Intended Audience :: Developers",
9+
"Operating System :: Android",
10+
]
11+
keywords=["Android ADB developer"]
12+
version = "2.5.24"
13+
description = "ADB-Enhanced is a Swiss army knife for Android testing and development"
14+
readme = "README.md"
15+
license= ["Apache-2.0"]
16+
requires-python = ">=3.10"
17+
dependencies = [
18+
"docopt>=0.6.2",
19+
"psutil>=7.0.0",
20+
]
21+
22+
[project.scripts]
23+
adbe = "adbe.main:main"
24+
25+
[dependency-groups]
26+
dev = [
27+
"flake8>=7.2.0",
28+
"pylint>=3.3.6",
29+
"pytest>=8.3.5",
30+
"setuptools>=78.1.0",
31+
"types-docopt>=0.6.11.20241107",
32+
"types-psutil>=7.0.0.20250401",
33+
"twine>=6.1.0",
34+
"wheel>=0.45.1",
35+
]

requirements.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@
2929
description="Swiss-army knife for Android testing and development",
3030
long_description=long_description,
3131
long_description_content_type="text/x-rst",
32-
classifiers=["Intended Audience :: Developers"],
33-
# Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
34-
keywords="Android ADB developer",
35-
author="Ashish Bhatia",
36-
author_email="ashishb@ashishb.net",
3732
url="https://github.com/ashishb/adb-enhanced",
38-
license="Apache",
3933
packages=find_packages(exclude=["ez_setup", "examples", "tests"]),
4034
include_package_data=True,
4135
zip_safe=True,

0 commit comments

Comments
 (0)