Skip to content

Commit

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

* Update scripts

* Add version in __init__.py

* Update git_tag.sh
  • Loading branch information
JeffLIrion committed Oct 20, 2023
1 parent c0dd498 commit 9ef4080
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 31 deletions.
3 changes: 1 addition & 2 deletions graphslam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
"""


__version__ = '0.0.8'
__version__ = "0.0.8"
4 changes: 2 additions & 2 deletions scripts/bumpversion.sh
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
44 changes: 27 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,34 @@

from setuptools import setup

with open('README.rst') as f:
readme = f.read().replace(':math:', '').replace('\\mathbb{R}', 'R').replace('.. image:: ', '.. image:: https://raw.githubusercontent.com/JeffLIrion/python-graphslam/master/docs/source/')
with open("README.rst") as f:
readme = (
f.read()
.replace(":math:", "")
.replace("\\mathbb{R}", "R")
.replace(
".. image:: ",
".. image:: https://raw.githubusercontent.com/JeffLIrion/python-graphslam/master/docs/source/",
)
)

setup(
name='graphslam',
version='0.0.8',
description='Graph SLAM solver in Python',
name="graphslam",
version="0.0.8",
description="Graph SLAM solver in Python",
long_description=readme,
keywords=['graphslam', 'slam', 'graph', 'optimization', 'mapping'],
url='https://github.com/JeffLIrion/python-graphslam',
license='MIT',
author='Jeff Irion',
author_email='jefflirion@users.noreply.github.com',
packages=['graphslam', 'graphslam.pose', 'graphslam.edge'],
install_requires=['numpy', 'scipy'],
tests_require=['matplotlib'],
classifiers=['License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3'],
test_suite='tests'
keywords=["graphslam", "slam", "graph", "optimization", "mapping"],
url="https://github.com/JeffLIrion/python-graphslam",
license="MIT",
author="Jeff Irion",
author_email="jefflirion@users.noreply.github.com",
packages=["graphslam", "graphslam.pose", "graphslam.edge"],
install_requires=["numpy", "scipy"],
tests_require=["matplotlib"],
classifiers=[
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
],
test_suite="tests",
)

0 comments on commit 9ef4080

Please sign in to comment.