Skip to content

Commit

Permalink
Replace deb_pkg_tools with debian-inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmoguy committed Jan 10, 2025
1 parent 3edbb4d commit a8de803
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
bitstring
codecov
concurrencytest
deb_pkg_tools
debian-inspector
exabgp==4.2.22
importlab>=0.3.1
netifaces
Expand Down
22 changes: 12 additions & 10 deletions tests/unit/packaging/test_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
import os
import unittest

from deb_pkg_tools.control import parse_control_fields
from deb_pkg_tools.deb822 import parse_deb822
from deb_pkg_tools.deps import VersionedRelationship
from debian_inspector import debcon
from debian_inspector.deps import VersionedRelationship
import requirements


Expand All @@ -43,15 +42,18 @@ def _parse_deb_control(self, control_file):
break
faucet_dpkg += "\n{}".format(line)

faucet_dpkg = parse_control_fields(parse_deb822(faucet_dpkg))
faucet_dpkg = debcon.parse_control_fields(
debcon.Debian822.from_string(faucet_dpkg)
)
self.faucet_dpkg_deps = {}
for dep in faucet_dpkg["Depends"]:
if isinstance(dep, VersionedRelationship):
if dep.name not in self.faucet_dpkg_deps:
self.faucet_dpkg_deps[dep.name] = []
self.faucet_dpkg_deps[dep.name].append(
"{}{}".format(dep.operator, dep.version)
)
if not isinstance(dep, VersionedRelationship):
continue
if dep.name not in self.faucet_dpkg_deps:
self.faucet_dpkg_deps[dep.name] = []
self.faucet_dpkg_deps[dep.name].append(
"{}{}".format(dep.operator, dep.version)
)

def _parse_pip_requirements(self, requirements_file):
self.faucet_pip_reqs = {}
Expand Down

0 comments on commit a8de803

Please sign in to comment.