diff --git a/contrib/osc.spec b/contrib/osc.spec index 8f607bef..6c065706 100644 --- a/contrib/osc.spec +++ b/contrib/osc.spec @@ -83,7 +83,6 @@ BuildRequires: %{use_python_pkg}-devel >= 3.6 BuildRequires: %{use_python_pkg}-rpm BuildRequires: %{use_python_pkg}-setuptools BuildRequires: %{use_python_pkg}-urllib3 -BuildRequires: %{use_python_pkg}-requests BuildRequires: %{yaml_pkg} BuildRequires: diffstat %if %{with fdupes} @@ -95,7 +94,6 @@ BuildRequires: git-core Requires: %{use_python_pkg}-cryptography Requires: %{use_python_pkg}-rpm Requires: %{use_python_pkg}-urllib3 -BuildRequires: %{use_python_pkg}-requests Requires: %{yaml_pkg} # needed for git-obs completion diff --git a/osc/core.py b/osc/core.py index a60c9ccc..0bcb10b7 100644 --- a/osc/core.py +++ b/osc/core.py @@ -16,7 +16,6 @@ import locale import os import platform import re -import requests import shlex import shutil import subprocess @@ -1400,16 +1399,18 @@ def show_devel_project(apiurl, prj, pac): package_obj = obs_api.Package.from_api(apiurl, prj, pac) if package_obj.devel is None: - if prj == 'openSUSE:Factory' or prj == 'openSUSE.org:openSUSE:Factory': + if prj == "openSUSE:Factory" or prj == "openSUSE.org:openSUSE:Factory": # If OBS api doesn't return a devel project, query the gitea devel_packages file try: - response = requests.get(DEVEL_PACKAGES_URL) + response = http_request("GET", DEVEL_PACKAGES_URL) + response.auto_close = False except: return None, None - if response.status_code == 200 and response.text: + if response.status == 200: # locate pac in the devel_packages file - for line in response.text.splitlines(): - devel_pkg, _, devel_prj = line.partition(' ') + for line in io.TextIOWrapper(response): + devel_pkg, _, devel_prj = line.partition(" ") + devel_prj = devel_prj.strip() if devel_pkg == pac: # found the package, return devel project and package if devel_pkg and devel_prj: diff --git a/setup.cfg b/setup.cfg index 5c14b817..a8549fb1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,7 +47,6 @@ install_requires = # rpm is not available on pip, install a matching package manually prior installing osc rpm ruamel.yaml - urllib3 [options.extras_require] lint =