Hello Petr,
> I want to create a python script for making the release process more comfortable (create tag in git repository, updating my spec file and hopefully upload the file to the COPR).
Just to make sure, that you are not reinventing the wheel by mistake. Do you know tito [1] and rpkg [2] projects? They do exactly what you are describing, so if you never heard of them, you should definitely check them ;-)
> My code is as simple as this:
I tried your code and it works for me. Isn't somehow possible, that you indeed have a wrong API token? The create_from_config_file() function by default uses the ~/.config/copr file. Please make sure that it exists, has only one [copr-cli] section and it looks like this
[copr-cli]
login = mysecretlogin
username = frostyx
token = mysecrettoken
# expiration date: 2019-05-04
Jakub