Skip to content

Commit

Permalink
pyproject.toml
Browse files Browse the repository at this point in the history
package version in double quotes for black formatter
  • Loading branch information
temoto committed May 20, 2020
1 parent a1457cc commit 9fef207
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = ["setuptools", "wheel"]

[tool.black]
line-length = 121
18 changes: 9 additions & 9 deletions script/release
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ auto_prepare_release() {
last_tag=$(git tag --sort=-version:refname |head -n1)
last_tag=${last_tag##v}
version_replace="${last_tag}.post$(date -u +%y%m%d%H%M)"
update_version "setup.py" "s/VERSION =.+/VERSION = '$version_replace'/"
update_version "python2/httplib2/__init__.py" "s/__version__ =.+/__version__ = '$version_replace'/"
update_version "python3/httplib2/__init__.py" "s/__version__ =.+/__version__ = '$version_replace'/"
update_version "setup.py" "s/VERSION =.+/VERSION = \"$version_replace\"/"
update_version "python2/httplib2/__init__.py" "s/__version__ =.+/__version__ = \"$version_replace\"/"
update_version "python3/httplib2/__init__.py" "s/__version__ =.+/__version__ = \"$version_replace\"/"
version_check "$version_replace"
fi
}
Expand Down Expand Up @@ -132,18 +132,18 @@ bump_version() {
fi
echo "Next version: '$version_next'" >&2

update_version "python3/httplib2/__init__.py" "s/__version__ =.+/__version__ = '$version_next'/"
update_version "python2/httplib2/__init__.py" "s/__version__ =.+/__version__ = '$version_next'/"
update_version "setup.py" "s/VERSION =.+/VERSION = '$version_next'/"
update_version "python3/httplib2/__init__.py" "s/__version__ =.+/__version__ = \"$version_next\"/"
update_version "python2/httplib2/__init__.py" "s/__version__ =.+/__version__ = \"$version_next\"/"
update_version "setup.py" "s/VERSION =.+/VERSION = \"$version_next\"/"

confirm "Confirm changes? [yN] " || exit 1
}

update_version() {
local path="$1"
local sed_expr="$2"
# sed -E --in-place='' -e "s/VERSION =.+/VERSION = '$version_replace'/" setup.py
# sed -E --in-place='' -e "s/__version__ =.+/__version__ = '$version_replace'/" python2/httplib2/__init__.py python3/httplib2/__init__.py
# sed -E --in-place='' -e "s/VERSION =.+/VERSION = \"$version_replace\"/" setup.py
# sed -E --in-place='' -e "s/__version__ =.+/__version__ = \"$version_replace\"/" python2/httplib2/__init__.py python3/httplib2/__init__.py
echo "Updating file '$path'" >&2
if ! sed -E --in-place='' -e "$sed_expr" "$path" ; then
echo "sed error $?" >&2
Expand Down Expand Up @@ -209,7 +209,7 @@ assert_tree_clean() {

version_check() {
local need=$1
local version_setup=$(fgrep 'VERSION =' setup.py |tr -d " '" |cut -d\= -f2)
local version_setup=$(fgrep 'VERSION =' setup.py |tr -d " '\"" |cut -d\= -f2)
local version_py2=$(cd python2 ; python2 -Es -c 'import httplib2;print(httplib2.__version__)')
local version_py3=$(cd python3 ; python3 -Es -c 'import httplib2;print(httplib2.__version__)')
if [[ "$version_setup" != "$need" ]] ; then
Expand Down

0 comments on commit 9fef207

Please sign in to comment.