-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #509 from chinapandaman/PPF-508
PPF-508: add bump version script
- Loading branch information
Showing
5 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Contains any object users might need.""" | ||
|
||
__version__ = "1.4.9" | ||
__version__ = "1.4.10" | ||
|
||
from .wrapper import PdfWrapper, PyPDFForm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ theme: | |
name: readthedocs | ||
logo: img/logo.png | ||
extra: | ||
version: v1.4.9 | ||
version: v1.4.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Bumps a minor version.""" | ||
|
||
import os | ||
import re | ||
|
||
if __name__ == "__main__": | ||
with open("PyPDFForm/__init__.py", encoding="utf8") as f: | ||
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1) | ||
|
||
new_version = ".".join( | ||
version.split(".")[:-1] + [str(int(version.split(".")[-1]) + 1)] | ||
) | ||
|
||
with open("PyPDFForm/__init__.py", encoding="utf8") as f: | ||
content = f.read().replace(version, new_version) | ||
|
||
os.remove("PyPDFForm/__init__.py") | ||
with open("PyPDFForm/__init__.py", mode="w", encoding="utf8") as f: | ||
f.write(content) | ||
|
||
with open("mkdocs.yml", encoding="utf8") as f: | ||
content = f.read().replace(version, new_version) | ||
|
||
os.remove("mkdocs.yml") | ||
with open("mkdocs.yml", mode="w", encoding="utf8") as f: | ||
f.write(content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
if [[ "$VIRTUAL_ENV" == "" ]]; then | ||
source "./venv/bin/activate" | ||
fi | ||
|
||
python ./scripts/bump_version.py | ||
|
||
git add ./PyPDFForm/__init__.py mkdocs.yml | ||
BRANCH=$(git symbolic-ref HEAD 2>/dev/null) | ||
BRANCH=${BRANCH##refs/heads/} | ||
git commit -m "${BRANCH}: bump version" | ||
git push --set-upstream origin ${BRANCH} |