Skip to content

Commit 9fef207

Browse files
committed
pyproject.toml
package version in double quotes for black formatter
1 parent a1457cc commit 9fef207

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
4+
[tool.black]
5+
line-length = 121

script/release

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ auto_prepare_release() {
4545
last_tag=$(git tag --sort=-version:refname |head -n1)
4646
last_tag=${last_tag##v}
4747
version_replace="${last_tag}.post$(date -u +%y%m%d%H%M)"
48-
update_version "setup.py" "s/VERSION =.+/VERSION = '$version_replace'/"
49-
update_version "python2/httplib2/__init__.py" "s/__version__ =.+/__version__ = '$version_replace'/"
50-
update_version "python3/httplib2/__init__.py" "s/__version__ =.+/__version__ = '$version_replace'/"
48+
update_version "setup.py" "s/VERSION =.+/VERSION = \"$version_replace\"/"
49+
update_version "python2/httplib2/__init__.py" "s/__version__ =.+/__version__ = \"$version_replace\"/"
50+
update_version "python3/httplib2/__init__.py" "s/__version__ =.+/__version__ = \"$version_replace\"/"
5151
version_check "$version_replace"
5252
fi
5353
}
@@ -132,18 +132,18 @@ bump_version() {
132132
fi
133133
echo "Next version: '$version_next'" >&2
134134

135-
update_version "python3/httplib2/__init__.py" "s/__version__ =.+/__version__ = '$version_next'/"
136-
update_version "python2/httplib2/__init__.py" "s/__version__ =.+/__version__ = '$version_next'/"
137-
update_version "setup.py" "s/VERSION =.+/VERSION = '$version_next'/"
135+
update_version "python3/httplib2/__init__.py" "s/__version__ =.+/__version__ = \"$version_next\"/"
136+
update_version "python2/httplib2/__init__.py" "s/__version__ =.+/__version__ = \"$version_next\"/"
137+
update_version "setup.py" "s/VERSION =.+/VERSION = \"$version_next\"/"
138138

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

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

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

0 commit comments

Comments
 (0)