From 6ecbaa04e06f18193c061344578c9f7e45599500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Helmke?= Date: Sat, 2 Nov 2024 17:39:19 +0100 Subject: [PATCH 1/4] move to pyproject.toml --- codescanner_analysis/__init__.py | 21 ++++++++++++++++----- pyproject.toml | 31 +++++++++++++++++++++++++++++++ setup.cfg | 23 ----------------------- setup.py | 3 --- 4 files changed, 47 insertions(+), 31 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/codescanner_analysis/__init__.py b/codescanner_analysis/__init__.py index 5b339e0..df77114 100644 --- a/codescanner_analysis/__init__.py +++ b/codescanner_analysis/__init__.py @@ -10,10 +10,21 @@ # major, minor, micro, release, serial -__VERSION_INFO__ = (1, 3, 0, 'final', 0) -__VERSION__ = '%d.%d' % (__VERSION_INFO__[0], __VERSION_INFO__[1]) +__VERSION_INFO__ = (1, 3, 1, 'final', 0) +__VERSION__ = '%d.%d.%d' % ( + __VERSION_INFO__[0], + __VERSION_INFO__[1], + __VERSION_INFO__[2], +) __all__ = [ - __VERSION__, - CodescannerAnalysisData, - ComparisonAnalysis, + '__VERSION__', + 'CodescannerAnalysisData', + 'ComparisonAnalysis', + 'ColorMap', + 'file_header_parser', + 'OverlayPlot', + 'PlotBase', + 'BytePlot', + 'utils', + 'CodescanInterface', ] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5edefe6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ["setuptools >= 61.0", "matplotlib"] +build-backend = "setuptools.build_meta" + +[project] +name = "codescanner_analysis" +description = "Analysis module to classify regions of arbitrary binaries" +authors = [ + {name = "Fraunhofer FKIE CA&D"}, + {name = "Viviane Zwanger", email = "viviane.zwanger@fkie.fraunhofer.de"}, + {name = "Henning Braun", email = "henning.braun@fkie.fraunhofer.de"}, +] +dynamic = ["version"] +keywords = ["codescanner", "code regions"] +license = {text = "Fraunhofer non-commercial License 'Codescanner'"} +dependencies = ["matplotlib", "numpy"] +requires-python = ">=3.8" + + +[project.urls] +repository = "https://github.com/fkie-cad/Codescanner" + +[tool.setuptools] +packages = ["codescanner_analysis"] + +[tool.setuptools.dynamic] +version = {attr = "codescanner_analysis.__VERSION__"} + +[tool.setuptools.package-data] +codescanner_analysis = ["res/lib/codescan", "res/lib/*.so", "res/lib/languages/*.lang"] + diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 238361f..0000000 --- a/setup.cfg +++ /dev/null @@ -1,23 +0,0 @@ -[metadata] -name = codescanner_analysis -version = attr: codescanner_analysis.__VERSION__ -description = Analysis module to classify regions of arbitrary binaries -author = Fraunhofer FKIE CA&D, Viviane Zwanger, Henning Braun -author_email = viviane.zwanger@fkie.fraunhofer.de, henning.braun@fkie.fraunhofer.de -url = https://github.com/fkie-cad/Codescanner -keywords = codescanner, code regions -license = Fraunhofer non-commercial License "Codescanner" - -[options] -packages = - codescanner_analysis - codescanner_analysis.utils -install_requires = - matplotlib - numpy - -[options.package_data] -codescanner_analysis = - res/lib/codescan - res/lib/*.so - res/lib/languages/*.lang diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() From 77812945a0f7437eca7c0fde91801d9c8553b6f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Helmke?= Date: Sat, 2 Nov 2024 17:42:06 +0100 Subject: [PATCH 2/4] update readme stats --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7cb28c2..efce41e 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ The Codescanner detects machine code in files and identifies the cpu architecture, endianness, and bitness. It can be used against data files (pdf, jpgs, unknown binary files). -Version: 1.3.0 -Last changed: 10. May 2022 +Version: 1.3.1 +Last changed: 02. Nov 2024 ## What this contains From 23f54c942b53bc086553b29b805c2f61ab3ea59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Helmke?= Date: Sat, 2 Nov 2024 17:46:14 +0100 Subject: [PATCH 3/4] fix: git workflows --- .github/workflows/lint_action.yml | 2 +- .github/workflows/pytest_action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint_action.yml b/.github/workflows/lint_action.yml index 8874d55..aa1cb70 100644 --- a/.github/workflows/lint_action.yml +++ b/.github/workflows/lint_action.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: 3.10 + python-version: 3.10.15 - name: Install Python dependencies run: pip install black flake8 diff --git a/.github/workflows/pytest_action.yml b/.github/workflows/pytest_action.yml index 292d04e..ab888fe 100644 --- a/.github/workflows/pytest_action.yml +++ b/.github/workflows/pytest_action.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: 3.10 + python-version: 3.10.15 - name: Install Python dependencies run: pip install -U pip pytest From 26498a6f817ee97d9799ac807aed5257dbff7330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Helmke?= Date: Sat, 2 Nov 2024 18:45:19 +0100 Subject: [PATCH 4/4] fix: cyclic import --- codescanner_analysis/__init__.py | 24 +++++++++++------------- pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/codescanner_analysis/__init__.py b/codescanner_analysis/__init__.py index df77114..ccf06ea 100644 --- a/codescanner_analysis/__init__.py +++ b/codescanner_analysis/__init__.py @@ -1,4 +1,3 @@ -from codescanner_analysis import utils from codescanner_analysis.byte_plot import BytePlot from codescanner_analysis.codescan_interface import CodescanInterface from codescanner_analysis.codescanner_analysis import CodescannerAnalysisData @@ -10,21 +9,20 @@ # major, minor, micro, release, serial -__VERSION_INFO__ = (1, 3, 1, 'final', 0) -__VERSION__ = '%d.%d.%d' % ( +__VERSION_INFO__ = (1, 3, 1, "final", 0) +__VERSION__ = "%d.%d.%d" % ( __VERSION_INFO__[0], __VERSION_INFO__[1], __VERSION_INFO__[2], ) __all__ = [ - '__VERSION__', - 'CodescannerAnalysisData', - 'ComparisonAnalysis', - 'ColorMap', - 'file_header_parser', - 'OverlayPlot', - 'PlotBase', - 'BytePlot', - 'utils', - 'CodescanInterface', + "__VERSION__", + "CodescannerAnalysisData", + "ComparisonAnalysis", + "ColorMap", + "file_header_parser", + "OverlayPlot", + "PlotBase", + "BytePlot", + "CodescanInterface", ] diff --git a/pyproject.toml b/pyproject.toml index 5edefe6..da740fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ requires-python = ">=3.8" repository = "https://github.com/fkie-cad/Codescanner" [tool.setuptools] -packages = ["codescanner_analysis"] +packages = ["codescanner_analysis", "codescanner_analysis.utils"] [tool.setuptools.dynamic] version = {attr = "codescanner_analysis.__VERSION__"}