Skip to content

Commit dac6f82

Browse files
committed
Moved the metadata into setup.cfg.
Added `pyproject.toml`. Version is now populated automatically from git tags using `setuptools_scm`. Deleted `bumpversion.sh`. Fixed some missing metadata fields.
1 parent bf4d348 commit dac6f82

File tree

10 files changed

+57
-65
lines changed

10 files changed

+57
-65
lines changed

.github/workflows/python-package.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28+
python -m pip install --upgrade build wheel setuptools setuptools_scm
2829
if python --version 2>&1 | grep -q "Python 2"; then pip install mock rsa==4.0 libusb1==1.9.3; fi
2930
python -m pip install flake8 pylint coveralls cryptography libusb1>=1.0.16 pycryptodome
3031
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31-
pip install .
32+
python -m build -nwsx .;
33+
pip install ./dist/*.whl;
3234
if python --version 2>&1 | grep -q "Python 3.7" || python --version 2>&1 | grep -q "Python 3.8" || python --version 2>&1 | grep -q "Python 3.9" || python --version 2>&1 | grep -q "Python 3.10"; then pip install aiofiles; fi
3335
- name: Lint with pylint and flake8
3436
run: |
@@ -41,3 +43,8 @@ jobs:
4143
run: |
4244
if python --version 2>&1 | grep -q "Python 2" || python --version 2>&1 | grep -q "Python 3.5" || python --version 2>&1 | grep -q "Python 3.6" ; then for synctest in $(cd tests && ls test*.py | grep -v async); do python -m unittest discover -s tests/ -t . -p "$synctest" || exit 1; done; fi
4345
if python --version 2>&1 | grep -q "Python 3.7" || python --version 2>&1 | grep -q "Python 3.8" || python --version 2>&1 | grep -q "Python 3.9" || python --version 2>&1 | grep -q "Python 3.10"; then coverage run --source adb_shell -m unittest discover -s tests/ -t . && coverage report -m && coveralls; fi
46+
- name: Upload wheel as a workflow artifact
47+
uses: actions/upload-artifact@v2
48+
with:
49+
name: wheel
50+
path: dist/*.whl

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Autogenerated version file
2+
/adb_shell/version.py
3+
14
# Python files
25
*.idea
36
*.pyc

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ addons:
1212
- swig
1313
- libusb-1.0-0-dev
1414
install:
15-
- pip install .
15+
- pip install --upgrade pip
16+
- pip install --upgrade build
17+
- python -m build -nwx .
18+
- pip install ./dist/*.whl
1619
- pip install flake8 pylint coveralls cryptography libusb1>=1.0.16 pycryptodome
1720
- python --version 2>&1 | grep -q "Python 2" && pip install mock || true
1821
- if python --version 2>&1 | grep -q "Python 3.7" || python --version 2>&1 | grep -q "Python 3.8" || python --version 2>&1 | grep -q "Python 3.9"; then pip install aiofiles; fi

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ release:
33
rm -rf dist
44
rm -rf build
55
scripts/git_tag.sh
6-
python setup.py sdist bdist_wheel
6+
python -m build -nwsx
77
twine upload dist/*
88

99
.PHONY: docs

adb_shell/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"""
88

99

10-
__version__ = '0.4.2'
10+
from .version import __version__ # noqa: F401

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[build-system]
2+
requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
write_to = "adb_shell/version.py"
7+
write_to_template = "'''Generated by setuptools_scm'''\n__version__ = '{version}'\n"

scripts/bumpversion.sh

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

scripts/rename_package.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ sed -i "s|$PACKAGE|$1|g" $DIR/../Doxyfile
3232
# Makefile
3333
sed -i "s|$PACKAGE|$1|g" $DIR/../Makefile
3434

35-
# setup.py
36-
sed -i "s|$PACKAGE|$1|g" $DIR/../setup.py
35+
# setup.cfg
36+
sed -i "s|$PACKAGE|$1|g" $DIR/../setup.cfg
3737

3838
# docs/Makefile
3939
sed -i "s|$PACKAGE|$1|g" $DIR/../docs/Makefile

setup.cfg

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[metadata]
2+
name = adb_shell
3+
author = Jeff Irion
4+
author_email = [email protected]
5+
description = A Python implementation of ADB with shell and FileSync functionality.
6+
license = Apache-2.0
7+
keywords = adb, android
8+
url = https://github.com/JeffLIrion/adb_shell
9+
long_description = file: README.rst
10+
long_description_contet_type = text/x-rst
11+
classifiers =
12+
Operating System :: OS Independent
13+
License :: OSI Approved :: Apache Software License
14+
Programming Language :: Python :: 3
15+
Programming Language :: Python :: 2
16+
17+
[options]
18+
packages =
19+
adb_shell
20+
adb_shell.auth
21+
adb_shell.transport
22+
install_requires = cryptography; pyasn1; rsa
23+
test_suite = tests
24+
tests_require = pycryptodome; libusb1>=1.0.16
25+
26+
[options.extras_require]
27+
usb = libusb1>=1.0.16
28+
async = aiofiles>=0.4.0
29+
30+
[bdist_wheel]
31+
universal = 1

setup.py

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

0 commit comments

Comments
 (0)