Skip to content

Commit

Permalink
Update scripts (#229)
Browse files Browse the repository at this point in the history
* Apply black formatting to __init__.py and setup.py

* Update scripts
  • Loading branch information
JeffLIrion committed Oct 20, 2023
1 parent b3a33b6 commit aa89675
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion adb_shell/__init__.py
Expand Up @@ -7,4 +7,4 @@
"""


__version__ = '0.4.4'
__version__ = "0.4.4"
4 changes: 2 additions & 2 deletions scripts/bumpversion.sh
Expand Up @@ -25,10 +25,10 @@ VERSION=$($DIR/get_version.sh)
echo "Bumping the version from $VERSION to $1"

# __init__.py
sed -i "s|__version__ = '$VERSION'|__version__ = '$1'|g" $DIR/../$PACKAGE/__init__.py
sed -i "s|__version__ = \"$VERSION\"|__version__ = \"$1\"|g" $DIR/../$PACKAGE/__init__.py

# setup.py
sed -i "s|version='$VERSION',|version='$1',|g" $DIR/../setup.py
sed -i "s|version=\"$VERSION\",|version=\"$1\",|g" $DIR/../setup.py

# conf.py
sed -i "s|version = '$VERSION'|version = '$1'|g" $DIR/../docs/source/conf.py
Expand Down
6 changes: 3 additions & 3 deletions scripts/get_package_name.sh
Expand Up @@ -5,11 +5,11 @@ set -e
# get the directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

RSTRIP="'*"
LSTRIP="*'"
RSTRIP='"*'
LSTRIP='*"'

# get the package name
PACKAGE_LINE=$(grep 'name=' $DIR/../setup.py || echo '')
PACKAGE_LINE=$(grep "name=" $DIR/../setup.py || echo '')
PACKAGE_TEMP=${PACKAGE_LINE%$RSTRIP}
PACKAGE=${PACKAGE_TEMP##$LSTRIP}

Expand Down
8 changes: 4 additions & 4 deletions scripts/get_version.sh
Expand Up @@ -5,15 +5,15 @@ set -e
# get the directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

RSTRIP="'*"
LSTRIP="*'"
RSTRIP='"*'
LSTRIP='*"'

# get the package name
PACKAGE=$($DIR/get_package_name.sh)

# get the current version
VERSION_LINE=$(grep '__version__' "$DIR/../$PACKAGE/__init__.py" || echo '')
VERSION_TEMP=${VERSION_LINE%"'"}
VERSION_LINE=$(grep "__version__" "$DIR/../$PACKAGE/__init__.py" || echo '')
VERSION_TEMP=${VERSION_LINE%'"'}

VERSION=${VERSION_TEMP##$LSTRIP}

Expand Down
3 changes: 0 additions & 3 deletions scripts/git_tag.sh
Expand Up @@ -3,9 +3,6 @@
# get the directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# get the package name
PACKAGE=$($DIR/get_package_name.sh)

# get the current version
VERSION=$($DIR/get_version.sh)

Expand Down
36 changes: 19 additions & 17 deletions setup.py
Expand Up @@ -2,25 +2,27 @@

from setuptools import setup

with open('README.rst') as f:
with open("README.rst") as f:
readme = f.read()

setup(
name='adb_shell',
version='0.4.4',
description='A Python implementation of ADB with shell and FileSync functionality.',
name="adb_shell",
version="0.4.4",
description="A Python implementation of ADB with shell and FileSync functionality.",
long_description=readme,
keywords=['adb', 'android'],
url='https://github.com/JeffLIrion/adb_shell',
author='Jeff Irion',
author_email='jefflirion@users.noreply.github.com',
packages=['adb_shell', 'adb_shell.auth', 'adb_shell.transport'],
install_requires=['cryptography', 'pyasn1', 'rsa'],
tests_require=['pycryptodome', 'libusb1>=1.0.16'],
extras_require={'usb': ['libusb1>=1.0.16'], 'async': ['aiofiles>=0.4.0', 'async_timeout>=3.0.0']},
classifiers=['Operating System :: OS Independent',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2'],
test_suite='tests'
keywords=["adb", "android"],
url="https://github.com/JeffLIrion/adb_shell",
author="Jeff Irion",
author_email="jefflirion@users.noreply.github.com",
packages=["adb_shell", "adb_shell.auth", "adb_shell.transport"],
install_requires=["cryptography", "pyasn1", "rsa"],
tests_require=["pycryptodome", "libusb1>=1.0.16"],
extras_require={"usb": ["libusb1>=1.0.16"], "async": ["aiofiles>=0.4.0", "async_timeout>=3.0.0"]},
classifiers=[
"Operating System :: OS Independent",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 2",
],
test_suite="tests",
)

0 comments on commit aa89675

Please sign in to comment.