Skip to content

Commit a8aa780

Browse files
authored
Merge pull request #30 from pritam001/development
Add version control support with tbump
2 parents ef295f0 + cba9a5e commit a8aa780

File tree

6 files changed

+70
-5
lines changed

6 files changed

+70
-5
lines changed

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ PYTHON = python3
2121

2222
# .PHONY defines parts of the makefile that are not dependant on any specific file
2323
# This is most often used to store functions
24-
.PHONY = all help setup format lint format-n-lint test-n-cover pre-commit
24+
.PHONY = all help setup format lint format-n-lint test-n-cover pre-commit clean
2525

2626
# Defining an array variable
27-
FILES = input output
27+
IGNORED_FILES_AND_FOLDERS = .mypy_cache/ .pytest_cache/ htmlcov/ logs/ .coverage
2828

2929
# Defines the default target that `make` will to try to make, or in the case of a phony target, execute the specified commands
3030
# This target is executed whenever we just type `make`
@@ -115,3 +115,10 @@ pre-commit: #: Run pre-commit checks : format, lint, test, cover
115115
make test-n-cover
116116
@echo "\n$(BOLD_CYAN)Pre commit jobs completed$(RESET_STYLES) 👍"
117117
@echo "\n"
118+
119+
120+
clean: #: Clean unnecessary files
121+
@echo "\n$(BOLD_CYAN)Cleaning unnecessary files$(RESET_STYLES) 🚿"
122+
rm -rf $(IGNORED_FILES_AND_FOLDERS)
123+
@echo "\n"
124+

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Tools
2828
[![API Specs](https://img.shields.io/badge/specs-flasgger-6D9A00?style=flat&logo=swagger&logoColor=white)](https://github.com/flasgger/flasgger)
2929
[![Tests: pytest](https://img.shields.io/badge/%20tests-pytest-%23009BDB?style=flat)](https://docs.pytest.org/en/latest/contents.html)
3030
[![Coverage: pytest-cov](https://img.shields.io/badge/%20coverage-pytest--cov-%23009BDB?style=flat)](https://docs.pytest.org/en/latest/contents.html)
31+
[![Version Handling: tbump](https://img.shields.io/badge/%20version%20handling-tbump-%23009BDB?style=flat)](https://docs.pytest.org/en/latest/contents.html)
3132

3233

3334
Usage Guide
@@ -84,6 +85,11 @@ To be updated
8485

8586
Contributing
8687
------------------------------------------------------------------------------
88+
1. Stargaze this repository
89+
1. Fork this repository
90+
1. Commit your changes
91+
1. Create pull request to `development` branch
92+
8793
[![](https://sourcerer.io/fame/pritam001/pritam001/pyflask-microservice-base/images/0)](https://sourcerer.io/fame/pritam001/pritam001/pyflask-microservice-base/links/0)
8894
[![](https://sourcerer.io/fame/pritam001/pritam001/pyflask-microservice-base/images/1)](https://sourcerer.io/fame/pritam001/pritam001/pyflask-microservice-base/links/1)
8995
[![](https://sourcerer.io/fame/pritam001/pritam001/pyflask-microservice-base/images/2)](https://sourcerer.io/fame/pritam001/pritam001/pyflask-microservice-base/links/2)

requirements/dev-requirements.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ pytest
3636

3737
# This plugin produces coverage reports. Compared to just using coverage run, this plugin does some extras
3838
pytest-cov
39+
40+
# bump software releases
41+
tbump

requirements/dev-requirements.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
#
77
appdirs==1.4.4 # via black, virtualenv
88
astroid==2.4.2 # via pylint
9-
attrs==19.3.0 # via black, flake8-eradicate, pytest
9+
attrs==19.3.0 # via black, flake8-eradicate, pytest, tbump
1010
autoflake==1.3.1 # via -r requirements/dev-requirements.in
1111
bandit==1.6.2 # via -r requirements/dev-requirements.in
1212
black==19.10b0 # via -r requirements/dev-requirements.in
1313
cfgv==3.2.0 # via pre-commit
14+
cli-ui==0.10.3 # via tbump
1415
click==7.1.2 # via black
15-
colorama==0.4.3 # via radon
16+
colorama==0.4.3 # via cli-ui, radon
17+
contextlib2==0.6.0.post1 # via schema
1618
coverage==5.2.1 # via pytest-cov
1719
distlib==0.3.1 # via virtualenv
20+
docopt==0.6.2 # via tbump
1821
eradicate==1.0 # via flake8-eradicate
1922
filelock==3.0.12 # via virtualenv
2023
flake8-blind-except==0.1.1 # via -r requirements/dev-requirements.in
@@ -45,6 +48,7 @@ mypy-extensions==0.4.3 # via mypy
4548
mypy==0.782 # via -r requirements/dev-requirements.in
4649
nodeenv==1.4.0 # via pre-commit
4750
packaging==20.4 # via pytest
51+
path==13.3.0 # via tbump
4852
pathspec==0.8.0 # via black
4953
pbr==5.4.5 # via stevedore
5054
pep8-naming==0.11.1 # via -r requirements/dev-requirements.in
@@ -61,12 +65,17 @@ pyyaml==5.3.1 # via bandit, pre-commit
6165
r2c-py-ast==0.1.0b1 # via flake8-flask
6266
radon==4.2.0 # via -r requirements/dev-requirements.in
6367
regex==2020.7.14 # via black
68+
schema==0.7.2 # via tbump
6469
six==1.15.0 # via astroid, bandit, flake8-print, mando, packaging, virtualenv
6570
smmap==3.0.4 # via gitdb
6671
stevedore==3.2.0 # via bandit
72+
tabulate==0.8.7 # via cli-ui
73+
tbump==6.1.1 # via -r requirements/dev-requirements.in
6774
toml==0.10.1 # via black, pre-commit, pylint, pytest
75+
tomlkit==0.5.11 # via tbump
6876
typed-ast==1.4.1 # via black, mypy
6977
typing-extensions==3.7.4.2 # via mypy
78+
unidecode==1.1.1 # via cli-ui
7079
virtualenv==20.0.30 # via pre-commit
7180
wrapt==1.12.1 # via astroid
7281

settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"default": {
33
"DEBUG": true,
4-
"VERSION": "0.0.1",
4+
"VERSION": "0.2.0",
55
"PROFILER": {
66
"flask-profiler": true,
77
"line-profiler": true,

tbump.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Uncomment this if your project is hosted on GitHub:
2+
# github_url = https://github.com/<user or organization>/<project>/
3+
4+
[version]
5+
current = "0.2.0"
6+
7+
# Example of a semver regexp.
8+
# Make sure this matches current_version before
9+
# using tbump
10+
regex = '''
11+
(?P<major>\d+)
12+
\.
13+
(?P<minor>\d+)
14+
\.
15+
(?P<patch>\d+)
16+
'''
17+
18+
[git]
19+
message_template = "Bump to {new_version}"
20+
tag_template = "v{new_version}"
21+
22+
# For each file to patch, add a [[file]] config section containing
23+
# the path of the file, relative to the tbump.toml location.
24+
[[file]]
25+
src = "settings.json"
26+
search = '"VERSION": "{current_version}"'
27+
28+
# You can specify a list of commands to
29+
# run after the files have been patched
30+
# and before the git commit is made
31+
32+
[[before_commit]]
33+
name = "Run all tests"
34+
cmd = "make test-n-cover"
35+
36+
# Or run some commands after the git tag and the branch
37+
# have been pushed:
38+
# [[after_push]]
39+
# name = "publish"
40+
# cmd = "./publish.sh"

0 commit comments

Comments
 (0)