A combination of vim and bash that I find useful
pipd now updates version number in setup.py automatically
2 files changed, +18 -1
+18-0gfuncs.sh
| @@ -143,3 +143,21 @@ function dev { | ||
| 143 | 143 | done |
| 144 | 144 | cd $start |
| 145 | 145 | } |
| 146 | +function pipd () { | |
| 147 | + updatesetupversion | |
| 148 | + rm -rf dist *.egg-info build | |
| 149 | + python setup.py bdist_wheel | |
| 150 | + pm twine upload --skip-existing dist/* | |
| 151 | + rm -rf dist *.egg-info build | |
| 152 | + gcom `cat setup.py | grep version` | |
| 153 | + git push origin main | |
| 154 | +} | |
| 155 | +function updatesetupversion () { | |
| 156 | + local num=`cat setup.py | grep version | tr -dc '0-9.'` | |
| 157 | + local updatePart=`echo $num | grep -oE '[^.]+$'` | |
| 158 | + local updatedPart=$((updatePart+1)) | |
| 159 | + local firstPart=`echo $num | grep -oE -m 0 '[^.]+$'` | |
| 160 | + local update=$((firstPart)).$updatedPart | |
| 161 | + echo $update | |
| 162 | + sed -i "s/$num/$update/g" setup.py | |
| 163 | +} |
+0-1ghost.sh
| @@ -31,6 +31,5 @@ alias dwipe='~/.ghost/dwipe.sh' | ||
| 31 | 31 | alias Ggit='vim ~/.gitconfig' |
| 32 | 32 | alias ddev='docker compose -f dev-compose.yml up -d --remove-orphans' |
| 33 | 33 | alias Gcd='cd ~/.ghost' |
| 34 | -alias pipd='rm -rf dist *.egg-info && python setup.py bdist_wheel && pm twine upload dist/* ; rm -rf dist *.egg-info build' | |
| 35 | 34 | |
| 36 | 35 | source ~/.ghost/gfuncs.sh |