#1459 python: warn about deprecated APIv1
Merged 3 years ago by praiskup. Opened 3 years ago by msuchy.
copr/ msuchy/copr eolapi1  into  master

@@ -11,6 +11,7 @@ 

  import os

  import logging

  import io

+ import warnings

  

  import requests

  import six
@@ -101,6 +102,10 @@ 

          self.copr_url = copr_url or "https://copr.fedorainfracloud.org/"

  

          self.no_config = no_config

+         warnings.warn("You are using Copr's deprecated APIv1. "

+                       "Please migrate to APIv3. "

+                       "See https://fedora-copr.github.io/posts/EOL-APIv1-APIv2",

+                       DeprecationWarning)

  

      def __unicode__(self):

          return (

What it prints now (taken from tests):

  /tmp/tito/rpmbuild-python-copru8ti86_2/BUILD/python-copr-git-63.38cb7d4/copr/client/client.py:105: DeprecationWarning: You are using Copr's deprecated APIv1. Please migrate to APIv3. See https://fedora-copr.github.io/posts/EOL-APIv1-APIv2

rebased onto f413df3

3 years ago

Commit 6a33fbe fixes this pull-request

Pull-Request has been merged by praiskup

3 years ago