Skip to content

Commit

Permalink
common: replace deprecated pkg_resources with importlib.metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyX committed Aug 10, 2024
1 parent 19ff52e commit 873475c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/copr_common/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import json
import time
import pkg_resources
from importlib.metadata import distribution
from requests import get, post, put, RequestException


Expand All @@ -23,7 +23,7 @@ class SafeRequest:
package_name = 'copr-common'
user_agent = {
'name': package_name,
'version': pkg_resources.require(package_name)[0].version
'version': distribution(package_name).version,
}

def __init__(self, auth=None, log=None, try_indefinitely=False, timeout=2 * 60):
Expand Down

0 comments on commit 873475c

Please sign in to comment.