1010 - task --list
1111
1212 add-pypi :
13- desc : " Add test-pypi repository"
13+ desc : " Add pypi or test-pypi repository"
1414 cmds :
1515 - |
1616 case {{.CLI_ARGS}} in
@@ -47,7 +47,12 @@ tasks:
4747 desc : " Bump the project semantic version"
4848 cmds :
4949 - |
50- case {{.CLI_ARGS}} in
50+ if [[ -n "{{.CLI_ARGS}}" ]]; then
51+ args="{{.CLI_ARGS}}"
52+ else
53+ args="prerelease"
54+ fi
55+ case $args in
5156 "major")
5257 poetry version major --no-ansi
5358 ;;
@@ -60,11 +65,37 @@ tasks:
6065 "prerelease")
6166 poetry version prerelease --no-ansi
6267 ;;
63- *|"" )
68+ *)
6469 echo "Invalid version"
6570 ;;
6671 esac
6772
73+ release :
74+ desc : " Set the release version manually"
75+ summary : |
76+ Set the release version manually in git.
77+
78+ USAGE
79+ task poetry:release # Bump the version to prerelease
80+ task poetry:release -- major # Bump the version to major
81+ aliases : ["release-please", "really", "plz"]
82+ cmds :
83+ - task : bump-semver
84+ - |
85+ VERSION=$(poetry version -s)
86+
87+ sed -i -e 's#__version__ = .*#__version__ = '"$(cat <<EOF
88+ '${VERSION}'
89+ EOF
90+ )"'#' src/*/__init__.py
91+
92+ git add pyproject.toml src/*/__init__.py
93+ git commit \
94+ --allow-empty \
95+ -m "chore: release ${VERSION}" \
96+ -m "Release-As: ${VERSION}" \
97+ --no-verify
98+
6899 publish :
69100 desc : " Publish the poetry bin"
70101 deps : ["add-pypi", "build"]
@@ -91,10 +122,9 @@ tasks:
91122 desc : " Update dependencies"
92123 cmds :
93124 - |
94- poetry run poetry up 2>/dev/null
125+ poetry cache clear --all pypi --no-ansi
126+ poetry up 2>/dev/null
95127 poetry update --lock --no-ansi
96- env :
97- PIP_DEFAULT_TIMEOUT : " 150"
98128
99129 export-reqs :
100130 desc : " Export requirements.txt"
@@ -103,7 +133,7 @@ tasks:
103133 cmds :
104134 - |
105135 poetry export -f requirements.txt \
106- --output {{.TLD }}/requirements.txt \
136+ --output {{.ROOT_DIR }}/requirements.txt \
107137 --without-hashes \
108138 --no-ansi
109139 ignore_error : true
0 commit comments