Add invoke with a tag task

This commit is contained in:
Gabriel Augendre 2021-08-06 16:07:55 +02:00
parent 8a052d847c
commit 78859c7c08
3 changed files with 24 additions and 1 deletions

15
poetry.lock generated
View file

@ -65,6 +65,14 @@ docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"]
perf = ["ipython"] perf = ["ipython"]
testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"]
[[package]]
name = "invoke"
version = "1.6.0"
description = "Pythonic task execution"
category = "dev"
optional = false
python-versions = "*"
[[package]] [[package]]
name = "nodeenv" name = "nodeenv"
version = "1.6.0" version = "1.6.0"
@ -169,7 +177,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.7" python-versions = "^3.7"
content-hash = "4b25cd3ee085a876b4d47af4b3e3c69133b32a002e1953ca3b64188eaac0a042" content-hash = "c50b8d6faabcfe4f4d1bd7a7d1661a1204db028ed75cabacf871b0df7f2e08a8"
[metadata.files] [metadata.files]
"backports.entry-points-selectable" = [ "backports.entry-points-selectable" = [
@ -196,6 +204,11 @@ importlib-metadata = [
{file = "importlib_metadata-4.6.3-py3-none-any.whl", hash = "sha256:51c6635429c77cf1ae634c997ff9e53ca3438b495f10a55ba28594dd69764a8b"}, {file = "importlib_metadata-4.6.3-py3-none-any.whl", hash = "sha256:51c6635429c77cf1ae634c997ff9e53ca3438b495f10a55ba28594dd69764a8b"},
{file = "importlib_metadata-4.6.3.tar.gz", hash = "sha256:0645585859e9a6689c523927a5032f2ba5919f1f7d0e84bd4533312320de1ff9"}, {file = "importlib_metadata-4.6.3.tar.gz", hash = "sha256:0645585859e9a6689c523927a5032f2ba5919f1f7d0e84bd4533312320de1ff9"},
] ]
invoke = [
{file = "invoke-1.6.0-py2-none-any.whl", hash = "sha256:e6c9917a1e3e73e7ea91fdf82d5f151ccfe85bf30cc65cdb892444c02dbb5f74"},
{file = "invoke-1.6.0-py3-none-any.whl", hash = "sha256:769e90caeb1bd07d484821732f931f1ad8916a38e3f3e618644687fc09cb6317"},
{file = "invoke-1.6.0.tar.gz", hash = "sha256:374d1e2ecf78981da94bfaf95366216aaec27c2d6a7b7d5818d92da55aa258d3"},
]
nodeenv = [ nodeenv = [
{file = "nodeenv-1.6.0-py2.py3-none-any.whl", hash = "sha256:621e6b7076565ddcacd2db0294c0381e01fd28945ab36bcf00f41c5daf63bef7"}, {file = "nodeenv-1.6.0-py2.py3-none-any.whl", hash = "sha256:621e6b7076565ddcacd2db0294c0381e01fd28945ab36bcf00f41c5daf63bef7"},
{file = "nodeenv-1.6.0.tar.gz", hash = "sha256:3ef13ff90291ba2a4a7a4ff9a979b63ffdd00a464dbe04acf0ea6471517a4c2b"}, {file = "nodeenv-1.6.0.tar.gz", hash = "sha256:3ef13ff90291ba2a4a7a4ff9a979b63ffdd00a464dbe04acf0ea6471517a4c2b"},

View file

@ -13,6 +13,7 @@ python = "^3.7"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
pre-commit = "^2.13.0" pre-commit = "^2.13.0"
invoke = "^1.6.0"
[tool.poetry.scripts] [tool.poetry.scripts]
insee = 'insee_number_translator.main:main' insee = 'insee_number_translator.main:main'

9
tasks.py Normal file
View file

@ -0,0 +1,9 @@
from invoke import Context, task
@task
def tag(context, tag):
"""Create & push a git tag"""
context: Context
context.run(f"git tag -a {tag} -m '{tag}'")
context.run("git push --follow-tags")