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 copr_url = https://copr.fedorainfracloud.org # expiration date: 2019-05-04 Please check the expiration date of your token and also that it is equal to https://copr.fedorainfracloud.org/api/ . [1] https://github.com/dgoodwin/tito/ [2] https://pagure.io/rpkg-util Jakub On Tue, Dec 4, 2018 at 10:08 PM Petr Stefan <[email protected]> wrote: > Hi, > > I'm using COPR for building couple of projects for Fedora and CentOS. Now > 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). I've found python-copr library and > it works fine when I want for example to get list of existing builds. > However, creating a new build fails with CoprRequestException (Login > invalid/expired. Please visit https://copr.fedorainfracloud.org/api to > get or renew your API token.). But I guess my token is ok, because it's > freshly generated and works with other endpoins. > > My code is as simple as this: > ---------- > from copr.v3 import BuildProxy > build_proxy = BuildProxy.create_from_config_file() > result = build_proxy.create_from_file("user", "project", > "spec/file/path.spec") > ---------- > > Is there any solution to my problem? Thanks, > /semai > _______________________________________________ > copr-devel mailing list -- [email protected] > To unsubscribe send an email to [email protected] > Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html > List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines > List Archives: > https://lists.fedorahosted.org/archives/list/[email protected] >
_______________________________________________ copr-devel mailing list -- [email protected] To unsubscribe send an email to [email protected] Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/[email protected]
