diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..e8698a93 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = ["setuptools", "wheel"] + +[tool.black] +line-length = 121 diff --git a/script/release b/script/release index 0f98e3ef..24032756 100755 --- a/script/release +++ b/script/release @@ -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 } @@ -132,9 +132,9 @@ 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 } @@ -142,8 +142,8 @@ bump_version() { 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 @@ -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