A simple bash script to keep my global python up to date.
- pyenv
$ git clone https://github.com/caiomts/python_update.git
$ cd python_update
$ chmod +x pyupdate.sh
$ . /path/to/the/script/pyupdate.sh
The script will create a $XDG_CONFIG_HOME/pyupdate
folder and save a requirements.txt
file in it. You can write down
all packages you use with and the script will install all of them for you in your
updated python version.
I keep a folder in my HOME
with symlinks to all my shell scripts and I add this folder into my PATH
.
This way I can call any shell script no matter where by name.
$ cd ~
$ mkdir your_folder_name
In my case the bash config file is .bashrc
in my HOME
, but it can be bash_profile
or another one depending
on the distro you are using.
$ echo 'export PATH="$PATH:$HOME/your_folder_name"' >> .bashrc
$ ln -s /path/to/the/script/pyupdate.sh ~/your_folder_name/pyupdate
In this case I create a cronjob to run weekly so I don't need to bother me with it.