#819 Drop pre-2.6 compat function koji.util._relpath
Merged by mikem. Opened by tkopecek.
tkopecek/koji issue818  into  master

Download 819.patch

Fixes: https://pagure.io/koji/issue/818

:thumbsup:

Hmm, with this dropped, it's a little funny for the rest of the code access relpath through koji.util.

I guess we shouldn't immediately drop the relpath = os.path.relpath line from util.py yet, for compat reasons. It looks a little odd there alone -- probably worth an explanatory comment.

What about creating small wrapper with printing deprecation message (with e.g. 1.19 target) and removing usage of this code from koji itself? So potential users outside koji will get this message and can tweak their code meanwhile.

What about creating small wrapper with printing deprecation message (with e.g. 1.19 target) and removing usage of this code from koji itself? So potential users outside koji will get this message and can tweak their code meanwhile.

Sounds good.

I think the "right" way to issue a deprecation warning in a python library is to use warnings.warn(), as we do in genMockConfig.

I think the "right" way to issue a deprecation warning in a python library is to use warnings.warn(), as we do in genMockConfig.

The problem with this, though, is that Deprecations are filtered by default :frowning:

I guess we could forcibly change the filter, as this snippet does:
https://stackoverflow.com/questions/2536307/how-do-i-deprecate-python-functions

rebased onto 967f957652ffb6b09cdcfb0169eb16456a05336f

I've made some more warnings consolidation.

Looks good, but instead of listing a specific future version, let's create an issue ( #834 ) to track final removal and refer to that instead. E.g.

deprecated("koji.util.relpath() is deprecated and will be removed in a "
        "future version. See: https://pagure.io/koji/issue/834")

Text updated.

rebased onto b2b43b2c652c4c0a5bd2a07e6be58e9a8a5037ec

Commit e120ee7e fixes this pull-request

Pull-Request has been merged by mikem

Metadata