From f22b06ad14ae284a7d0a440a1a3258151f954966 Mon Sep 17 00:00:00 2001 From: Sebastian Lenzlinger Date: Wed, 12 Jun 2024 16:51:17 +0200 Subject: [PATCH] Small corrections to list_interfaces(). Also make pyproject.toml usable. --- .gitignore | 1 + code/iottb/utils/tcpdump_utils.py | 2 +- code/pyproject.toml | 11 +++++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index aac33da..0ed2dec 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ __pycache__ 2024-bsc-sebastian-lenzlinger.iml logs/ requirements.txt +*.egg-info/ diff --git a/code/iottb/utils/tcpdump_utils.py b/code/iottb/utils/tcpdump_utils.py index d9df1d5..2763f11 100644 --- a/code/iottb/utils/tcpdump_utils.py +++ b/code/iottb/utils/tcpdump_utils.py @@ -20,7 +20,7 @@ def list_interfaces() -> str: ensure_installed() try: result = subprocess.run(['tcpdump', '--list-interfaces'], capture_output=True, text=True, check=True) - return result.stdout + print(result.stdout) except subprocess.CalledProcessError as e: print(f'Failed to list interfaces: {e}') return '' diff --git a/code/pyproject.toml b/code/pyproject.toml index 8e8bad2..1261bc7 100644 --- a/code/pyproject.toml +++ b/code/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools>=42", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -7,11 +7,10 @@ name = 'iottb' version = '0.1.0' authors = [{name = "Sebastian Lenzlinger", email = "sebastian.lenzlinger@unibas.ch"}] description = "Automation Tool for Capturing Network packets of IoT devices." -license = {file = "LICENSE"} -dependencies = [ - # List your dependencies here, e.g., "numpy", "pandas>=1.0" -] -include-package-data = true +requires-python = ">=3.8" + +[tool.setuptools] +packages = ["iottb"] [project.scripts] iottb = "iottb.__main__:main" \ No newline at end of file