binary-inspector 0.1.2__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/.github/workflows/docs-ci.yml +6 -3
  2. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/.github/workflows/pypi-release.yml +17 -11
  3. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/.github/workflows/tests.yml +5 -3
  4. binary_inspector-0.2.1/.github/workflows/zizmor.yml +24 -0
  5. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/.readthedocs.yml +1 -1
  6. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/CHANGELOG.rst +11 -0
  7. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/PKG-INFO +7 -8
  8. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/README.rst +2 -2
  9. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/azure-pipelines.yml +1 -1
  10. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/configure +1 -1
  11. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/configure.bat +2 -2
  12. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/ci/azure-container-deb.yml +1 -1
  13. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/ci/azure-container-rpm.yml +1 -1
  14. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/utils_requirements.py +3 -3
  15. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/utils_thirdparty.py +32 -33
  16. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/pyproject.toml +1 -1
  17. binary_inspector-0.2.1/requirements-dev.txt +1 -0
  18. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/requirements.txt +3 -4
  19. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/setup.cfg +5 -5
  20. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector/blint_binary.py +11 -5
  21. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector.egg-info/PKG-INFO +7 -8
  22. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector.egg-info/SOURCES.txt +1 -0
  23. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector.egg-info/requires.txt +3 -8
  24. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/tests/data/macho/Lumen-symbols-plugin.json +67 -1
  25. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/tests/test_binary.py +1 -1
  26. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/tests/test_plugin.py +2 -2
  27. binary_inspector-0.1.2/requirements-dev.txt +0 -1
  28. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/.gitattributes +0 -0
  29. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/.gitignore +0 -0
  30. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/AUTHORS.rst +0 -0
  31. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/CODE_OF_CONDUCT.rst +0 -0
  32. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/MANIFEST.in +0 -0
  33. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/Makefile +0 -0
  34. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/NOTICE +0 -0
  35. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/apache-2.0.LICENSE +0 -0
  36. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/docs/Makefile +0 -0
  37. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/docs/make.bat +0 -0
  38. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/docs/scripts/doc8_style_check.sh +0 -0
  39. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/docs/scripts/sphinx_build_link_check.sh +0 -0
  40. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/docs/source/_static/theme_overrides.css +0 -0
  41. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/docs/source/conf.py +0 -0
  42. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/docs/source/contribute/contrib_doc.rst +0 -0
  43. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/docs/source/index.rst +0 -0
  44. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/ci/azure-posix.yml +0 -0
  45. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/ci/azure-win.yml +0 -0
  46. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/ci/install_sudo.sh +0 -0
  47. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/ci/macports-ci +0 -0
  48. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/ci/macports-ci.ABOUT +0 -0
  49. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/ci/mit.LICENSE +0 -0
  50. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/README.rst +0 -0
  51. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/check_thirdparty.py +0 -0
  52. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/fetch_thirdparty.py +0 -0
  53. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/gen_pypi_simple.py +0 -0
  54. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/gen_pypi_simple.py.ABOUT +0 -0
  55. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/gen_pypi_simple.py.NOTICE +0 -0
  56. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/gen_requirements.py +0 -0
  57. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/gen_requirements_dev.py +0 -0
  58. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/requirements.txt +0 -0
  59. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/test_utils_pip_compatibility_tags.py +0 -0
  60. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/test_utils_pip_compatibility_tags.py.ABOUT +0 -0
  61. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/test_utils_pypi_supported_tags.py +0 -0
  62. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/test_utils_pypi_supported_tags.py.ABOUT +0 -0
  63. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/update_skeleton.py +0 -0
  64. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/utils_dejacode.py +0 -0
  65. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/utils_pip_compatibility_tags.py +0 -0
  66. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/utils_pip_compatibility_tags.py.ABOUT +0 -0
  67. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/utils_pypi_supported_tags.py +0 -0
  68. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/utils_pypi_supported_tags.py.ABOUT +0 -0
  69. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/etc/scripts/utils_thirdparty.py.ABOUT +0 -0
  70. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/setup.py +0 -0
  71. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector/__init__.py +0 -0
  72. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector/binary.py +0 -0
  73. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector/blint_binary.py.ABOUT +0 -0
  74. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector/blint_binary.py.LICENSE +0 -0
  75. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector/config.py +0 -0
  76. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector/plugin.py +0 -0
  77. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector.egg-info/dependency_links.txt +0 -0
  78. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector.egg-info/entry_points.txt +0 -0
  79. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector.egg-info/not-zip-safe +0 -0
  80. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/src/binary_inspector.egg-info/top_level.txt +0 -0
  81. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/tests/data/macho/Lumen +0 -0
  82. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/tests/data/macho/Lumen-symbols.json +0 -0
  83. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/tests/data/winpe/TranslucentTB-setup.exe +0 -0
  84. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/tests/data/winpe/TranslucentTB-symbols-plugin.json +0 -0
  85. {binary_inspector-0.1.2 → binary_inspector-0.2.1}/tests/data/winpe/TranslucentTB-symbols.json +0 -0
@@ -2,6 +2,7 @@ name: CI Documentation
2
2
 
3
3
  on: [push, pull_request]
4
4
 
5
+ permissions: {}
5
6
  jobs:
6
7
  build:
7
8
  runs-on: ubuntu-24.04
@@ -9,14 +10,16 @@ jobs:
9
10
  strategy:
10
11
  max-parallel: 4
11
12
  matrix:
12
- python-version: [3.12]
13
+ python-version: [3.13]
13
14
 
14
15
  steps:
15
16
  - name: Checkout code
16
- uses: actions/checkout@v4
17
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
18
+ with:
19
+ persist-credentials: false
17
20
 
18
21
  - name: Set up Python ${{ matrix.python-version }}
19
- uses: actions/setup-python@v5
22
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
20
23
  with:
21
24
  python-version: ${{ matrix.python-version }}
22
25
 
@@ -18,35 +18,40 @@ on:
18
18
  tags:
19
19
  - "v*.*.*"
20
20
 
21
+ permissions: {}
21
22
  jobs:
22
23
  build-pypi-distribs:
23
24
  name: Build and publish library to PyPI
24
25
  runs-on: ubuntu-24.04
25
26
 
26
27
  steps:
27
- - uses: actions/checkout@v4
28
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
29
+ with:
30
+ persist-credentials: false
28
31
  - name: Set up Python
29
- uses: actions/setup-python@v5
32
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
30
33
  with:
31
34
  python-version: 3.12
32
35
 
33
36
  - name: Install pypa/build and twine
34
- run: python -m pip install --user build twine
37
+ run: python -m pip install --user --upgrade build twine pkginfo
35
38
 
36
39
  - name: Build a binary wheel and a source tarball
37
- run: python -m build --sdist --wheel --outdir dist/
40
+ run: python -m build --wheel --sdist --outdir dist/
38
41
 
39
42
  - name: Validate wheel and sdis for Pypi
40
43
  run: python -m twine check dist/*
41
44
 
42
45
  - name: Upload built archives
43
- uses: actions/upload-artifact@v4
46
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
44
47
  with:
45
48
  name: pypi_archives
46
49
  path: dist/*
47
50
 
48
51
 
49
52
  create-gh-release:
53
+ permissions:
54
+ contents: write
50
55
  name: Create GH release
51
56
  needs:
52
57
  - build-pypi-distribs
@@ -54,13 +59,13 @@ jobs:
54
59
 
55
60
  steps:
56
61
  - name: Download built archives
57
- uses: actions/download-artifact@v4
62
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
58
63
  with:
59
64
  name: pypi_archives
60
65
  path: dist
61
66
 
62
67
  - name: Create GH release
63
- uses: softprops/action-gh-release@v2
68
+ uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
64
69
  with:
65
70
  draft: true
66
71
  files: dist/*
@@ -71,16 +76,17 @@ jobs:
71
76
  needs:
72
77
  - create-gh-release
73
78
  runs-on: ubuntu-24.04
79
+ environment: pypi-publish
80
+ permissions:
81
+ id-token: write
74
82
 
75
83
  steps:
76
84
  - name: Download built archives
77
- uses: actions/download-artifact@v4
85
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
78
86
  with:
79
87
  name: pypi_archives
80
88
  path: dist
81
89
 
82
90
  - name: Publish to PyPI
83
91
  if: startsWith(github.ref, 'refs/tags')
84
- uses: pypa/gh-action-pypi-publish@release/v1
85
- with:
86
- password: ${{ secrets.PYPI_API_TOKEN }}
92
+ uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
@@ -12,14 +12,16 @@ jobs:
12
12
  strategy:
13
13
  fail-fast: false
14
14
  matrix:
15
- python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15
+ python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
16
16
  os: ["ubuntu-latest"]
17
17
 
18
18
  steps:
19
- - uses: actions/checkout@v4
19
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
20
+ with:
21
+ persist-credentials: false
20
22
 
21
23
  - name: Set up Python
22
- uses: actions/setup-python@v5
24
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
23
25
  with:
24
26
  python-version: "${{ matrix.python }}"
25
27
 
@@ -0,0 +1,24 @@
1
+ name: GitHub Actions Security Analysis with zizmor 🌈
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["**"]
8
+
9
+ permissions: {}
10
+
11
+ jobs:
12
+ zizmor:
13
+ name: Run zizmor 🌈
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20
+ with:
21
+ persist-credentials: false
22
+
23
+ - name: Run zizmor 🌈
24
+ uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
@@ -9,7 +9,7 @@ version: 2
9
9
  build:
10
10
  os: ubuntu-22.04
11
11
  tools:
12
- python: "3.11"
12
+ python: "3.13"
13
13
 
14
14
  # Build PDF & ePub
15
15
  formats:
@@ -1,6 +1,17 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ v0.2.1
5
+ ------
6
+
7
+ Patch release with updated dependencies and no version constraints.
8
+
9
+
10
+ v0.2.0
11
+ ------
12
+
13
+ Minor release with updated dependencies and python support.
14
+
4
15
  v0.1.2
5
16
  ------
6
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: binary-inspector
3
- Version: 0.1.2
3
+ Version: 0.2.1
4
4
  Summary: binary-inspector is a library and tools to inspect binaries (elf, winpe, mach0) for symbols and other information, and models to store this.
5
5
  Home-page: https://github.com/aboutcode-org/binary-inspector
6
6
  Author: nexB. Inc. and others
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Classifier: Topic :: Software Development
15
15
  Classifier: Topic :: Utilities
16
- Requires-Python: >=3.9
16
+ Requires-Python: >=3.10
17
17
  Description-Content-Type: text/x-rst
18
18
  License-File: apache-2.0.LICENSE
19
19
  License-File: NOTICE
@@ -21,13 +21,12 @@ License-File: AUTHORS.rst
21
21
  License-File: CHANGELOG.rst
22
22
  License-File: CODE_OF_CONDUCT.rst
23
23
  License-File: README.rst
24
- Requires-Dist: click!=7.0,>=6.7; python_version < "3.10"
25
- Requires-Dist: click>=8.2.0; python_version >= "3.10"
24
+ Requires-Dist: click>=8.2.0
26
25
  Requires-Dist: commoncode
27
26
  Requires-Dist: plugincode
28
27
  Requires-Dist: typecode
29
- Requires-Dist: lief==0.15.1
30
- Requires-Dist: symbolic==10.2.1
28
+ Requires-Dist: lief>=0.17.2
29
+ Requires-Dist: symbolic>=10.2.1
31
30
  Provides-Extra: dev
32
31
  Requires-Dist: scancode-toolkit; extra == "dev"
33
32
  Requires-Dist: pytest>=7.0.1; extra == "dev"
@@ -149,8 +148,8 @@ Communications Networks, Content and Technology under grant agreement No 1010695
149
148
  :height: 30
150
149
  :alt: AboutCode logo
151
150
 
152
- .. |swiss| image:: https://www.sbfi.admin.ch/sbfi/en/_jcr_content/logo/image.imagespooler.png/1493119032540/logo.png
153
- :target: https://www.sbfi.admin.ch/sbfi/en/home/seri/seri.html
151
+ .. |swiss| image:: https://www.sbfi.admin.ch/images/swiss-logo-flag.svg
152
+ :target: https://www.sbfi.admin.ch/de
154
153
  :height: 40
155
154
  :alt: Swiss logo
156
155
 
@@ -103,8 +103,8 @@ Communications Networks, Content and Technology under grant agreement No 1010695
103
103
  :height: 30
104
104
  :alt: AboutCode logo
105
105
 
106
- .. |swiss| image:: https://www.sbfi.admin.ch/sbfi/en/_jcr_content/logo/image.imagespooler.png/1493119032540/logo.png
107
- :target: https://www.sbfi.admin.ch/sbfi/en/home/seri/seri.html
106
+ .. |swiss| image:: https://www.sbfi.admin.ch/images/swiss-logo-flag.svg
107
+ :target: https://www.sbfi.admin.ch/de
108
108
  :height: 40
109
109
  :alt: Swiss logo
110
110
 
@@ -11,6 +11,6 @@ jobs:
11
11
  parameters:
12
12
  job_name: ubuntu24_cpython
13
13
  image_name: ubuntu-24.04
14
- python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
14
+ python_versions: ['3.10', '3.11', '3.12', '3.13', '3.14']
15
15
  test_suites:
16
16
  all: venv/bin/pytest -n 2 -vvs
@@ -110,7 +110,7 @@ create_virtualenv() {
110
110
  fi
111
111
 
112
112
  $PYTHON_EXECUTABLE "$VIRTUALENV_PYZ" \
113
- --wheel embed --pip embed --setuptools embed \
113
+ --pip embed --setuptools embed \
114
114
  --seeder pip \
115
115
  --never-download \
116
116
  --no-periodic-update \
@@ -110,7 +110,7 @@ if not exist "%CFG_BIN_DIR%\python.exe" (
110
110
 
111
111
  if exist "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" (
112
112
  %PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" ^
113
- --wheel embed --pip embed --setuptools embed ^
113
+ --pip embed --setuptools embed ^
114
114
  --seeder pip ^
115
115
  --never-download ^
116
116
  --no-periodic-update ^
@@ -126,7 +126,7 @@ if not exist "%CFG_BIN_DIR%\python.exe" (
126
126
  )
127
127
  )
128
128
  %PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" ^
129
- --wheel embed --pip embed --setuptools embed ^
129
+ --pip embed --setuptools embed ^
130
130
  --seeder pip ^
131
131
  --never-download ^
132
132
  --no-periodic-update ^
@@ -21,7 +21,7 @@ jobs:
21
21
  - job: ${{ parameters.job_name }}
22
22
 
23
23
  pool:
24
- vmImage: 'ubuntu-16.04'
24
+ vmImage: 'ubuntu-22.04'
25
25
 
26
26
  container:
27
27
  image: ${{ parameters.container }}
@@ -1,6 +1,6 @@
1
1
  parameters:
2
2
  job_name: ''
3
- image_name: 'ubuntu-16.04'
3
+ image_name: 'ubuntu-22.04'
4
4
  container: ''
5
5
  python_path: ''
6
6
  python_version: ''
@@ -15,7 +15,7 @@ import subprocess
15
15
  """
16
16
  Utilities to manage requirements files and call pip.
17
17
  NOTE: this should use ONLY the standard library and not import anything else
18
- because this is used for boostrapping with no requirements installed.
18
+ because this is used for bootstrapping with no requirements installed.
19
19
  """
20
20
 
21
21
 
@@ -31,7 +31,7 @@ def load_requirements(requirements_file="requirements.txt", with_unpinned=False)
31
31
 
32
32
  def get_required_name_versions(requirement_lines, with_unpinned=False):
33
33
  """
34
- Yield required (name, version) tuples given a`requirement_lines` iterable of
34
+ Yield required (name, version) tuples given a `requirement_lines` iterable of
35
35
  requirement text lines. Only accept requirements pinned to an exact version.
36
36
  """
37
37
 
@@ -47,7 +47,7 @@ def get_required_name_versions(requirement_lines, with_unpinned=False):
47
47
 
48
48
  def get_required_name_version(requirement, with_unpinned=False):
49
49
  """
50
- Return a (name, version) tuple given a`requirement` specifier string.
50
+ Return a (name, version) tuple given a `requirement` specifier string.
51
51
  Requirement version must be pinned. If ``with_unpinned`` is True, unpinned
52
52
  requirements are accepted and only the name portion is returned.
53
53
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
2
3
  #
3
4
  # Copyright (c) nexB Inc. and others. All rights reserved.
4
5
  # ScanCode is a trademark of nexB Inc.
@@ -24,13 +25,14 @@ import license_expression
24
25
  import packageurl
25
26
  import requests
26
27
  import saneyaml
27
- import utils_pip_compatibility_tags
28
28
  from commoncode import fileutils
29
29
  from commoncode.hash import multi_checksums
30
30
  from commoncode.text import python_safe_name
31
31
  from packvers import tags as packaging_tags
32
32
  from packvers import version as packaging_version
33
33
 
34
+ import utils_pip_compatibility_tags
35
+
34
36
  """
35
37
  Utilities to manage Python thirparty libraries source, binaries and metadata in
36
38
  local directories and remote repositories.
@@ -91,8 +93,7 @@ Wheel downloader
91
93
 
92
94
  - parse requirement file
93
95
  - create a TODO queue of requirements to process
94
- - done: create an empty map of processed binary requirements as
95
- {package name: (list of versions/tags}
96
+ - done: create an empty map of processed binary requirements as {package name: (list of versions/tags}
96
97
 
97
98
 
98
99
  - while we have package reqs in TODO queue, process one requirement:
@@ -114,13 +115,14 @@ TRACE_DEEP = False
114
115
  TRACE_ULTRA_DEEP = False
115
116
 
116
117
  # Supported environments
117
- PYTHON_VERSIONS = "37", "38", "39", "310"
118
+ PYTHON_VERSIONS = "310", "311", "312", "313", "314"
118
119
 
119
120
  PYTHON_DOT_VERSIONS_BY_VER = {
120
- "37": "3.7",
121
- "38": "3.8",
122
- "39": "3.9",
123
121
  "310": "3.10",
122
+ "311": "3.11",
123
+ "312": "3.12",
124
+ "313": "3.13",
125
+ "314": "3.14",
124
126
  }
125
127
 
126
128
 
@@ -132,10 +134,11 @@ def get_python_dot_version(version):
132
134
 
133
135
 
134
136
  ABIS_BY_PYTHON_VERSION = {
135
- "37": ["cp37", "cp37m", "abi3"],
136
- "38": ["cp38", "cp38m", "abi3"],
137
- "39": ["cp39", "cp39m", "abi3"],
138
137
  "310": ["cp310", "cp310m", "abi3"],
138
+ "311": ["cp311", "cp311m", "abi3"],
139
+ "312": ["cp312", "cp312m", "abi3"],
140
+ "313": ["cp313", "cp313m", "abi3"],
141
+ "314": ["cp314", "cp314m", "abi3"],
139
142
  }
140
143
 
141
144
  PLATFORMS_BY_OS = {
@@ -553,8 +556,7 @@ class Distribution(NameVer):
553
556
  Download this distribution into `dest_dir` directory.
554
557
  Return the fetched filename.
555
558
  """
556
- if not self.filename:
557
- raise ValueError(f"self.filename has no value but is required: {self.filename!r}")
559
+ assert self.filename
558
560
  if TRACE_DEEP:
559
561
  print(
560
562
  f"Fetching distribution of {self.name}=={self.version}:",
@@ -822,9 +824,9 @@ class Distribution(NameVer):
822
824
  """
823
825
  urls = LinksRepository.from_url(use_cached_index=use_cached_index).links
824
826
  errors = []
825
- extra_lic_names = [lic.get("file") for lic in self.extra_data.get("licenses", {})]
827
+ extra_lic_names = [l.get("file") for l in self.extra_data.get("licenses", {})]
826
828
  extra_lic_names += [self.extra_data.get("license_file")]
827
- extra_lic_names = [eln for eln in extra_lic_names if eln]
829
+ extra_lic_names = [ln for ln in extra_lic_names if ln]
828
830
  lic_names = [f"{key}.LICENSE" for key in self.get_license_keys()]
829
831
  for filename in lic_names + extra_lic_names:
830
832
  floc = os.path.join(dest_dir, filename)
@@ -844,7 +846,7 @@ class Distribution(NameVer):
844
846
  if TRACE:
845
847
  print(f"Fetched license from remote: {lic_url}")
846
848
 
847
- except Exception:
849
+ except:
848
850
  try:
849
851
  # try licensedb second
850
852
  lic_url = f"{LICENSEDB_API_URL}/{filename}"
@@ -857,9 +859,8 @@ class Distribution(NameVer):
857
859
  if TRACE:
858
860
  print(f"Fetched license from licensedb: {lic_url}")
859
861
 
860
- except Exception:
861
- msg = f"No text for license {filename} in expression "
862
- f"{self.license_expression!r} from {self}"
862
+ except:
863
+ msg = f'No text for license {filename} in expression "{self.license_expression}" from {self}'
863
864
  print(msg)
864
865
  errors.append(msg)
865
866
 
@@ -999,7 +1000,7 @@ def get_license_link_for_filename(filename, urls):
999
1000
  exception if no link is found or if there are more than one link for that
1000
1001
  file name.
1001
1002
  """
1002
- path_or_url = [url for url in urls if url.endswith(f"/{filename}")]
1003
+ path_or_url = [l for l in urls if l.endswith(f"/{filename}")]
1003
1004
  if not path_or_url:
1004
1005
  raise Exception(f"Missing link to file: {filename}")
1005
1006
  if not len(path_or_url) == 1:
@@ -1288,7 +1289,7 @@ class Wheel(Distribution):
1288
1289
  def is_pure_wheel(filename):
1289
1290
  try:
1290
1291
  return Wheel.from_filename(filename).is_pure()
1291
- except Exception:
1292
+ except:
1292
1293
  return False
1293
1294
 
1294
1295
 
@@ -1484,7 +1485,8 @@ class PypiPackage(NameVer):
1484
1485
  """
1485
1486
  if self.sdist:
1486
1487
  yield self.sdist
1487
- yield from self.wheels
1488
+ for wheel in self.wheels:
1489
+ yield wheel
1488
1490
 
1489
1491
  def get_url_for_filename(self, filename):
1490
1492
  """
@@ -1613,8 +1615,7 @@ class PypiSimpleRepository:
1613
1615
  type=dict,
1614
1616
  default=attr.Factory(lambda: defaultdict(dict)),
1615
1617
  metadata=dict(
1616
- help="Mapping of {name: {version: PypiPackage, version: PypiPackage, etc} "
1617
- "available in this repo"
1618
+ help="Mapping of {name: {version: PypiPackage, version: PypiPackage, etc} available in this repo"
1618
1619
  ),
1619
1620
  )
1620
1621
 
@@ -1628,8 +1629,7 @@ class PypiSimpleRepository:
1628
1629
  type=bool,
1629
1630
  default=False,
1630
1631
  metadata=dict(
1631
- help="If True, use any existing on-disk cached PyPI index files. "
1632
- "Otherwise, fetch and cache."
1632
+ help="If True, use any existing on-disk cached PyPI index files. Otherwise, fetch and cache."
1633
1633
  ),
1634
1634
  )
1635
1635
 
@@ -1638,8 +1638,7 @@ class PypiSimpleRepository:
1638
1638
  Return a mapping of all available PypiPackage version for this package name.
1639
1639
  The mapping may be empty. It is ordered by version from oldest to newest
1640
1640
  """
1641
- if not name:
1642
- raise ValueError(f"name is required: {name!r}")
1641
+ assert name
1643
1642
  normalized_name = NameVer.normalize_name(name)
1644
1643
  versions = self.packages[normalized_name]
1645
1644
  if not versions and normalized_name not in self.fetched_package_normalized_names:
@@ -1694,7 +1693,7 @@ class PypiSimpleRepository:
1694
1693
  )
1695
1694
  links = collect_urls(text)
1696
1695
  # TODO: keep sha256
1697
- links = [link.partition("#sha256=") for link in links]
1696
+ links = [l.partition("#sha256=") for l in links]
1698
1697
  links = [url for url, _, _sha256 in links]
1699
1698
  return links
1700
1699
 
@@ -1915,7 +1914,7 @@ def get_remote_file_content(
1915
1914
  # several redirects and that we can ignore content there. A HEAD request may
1916
1915
  # not get us this last header
1917
1916
  print(f" DOWNLOADING: {url}")
1918
- with requests.get(url, allow_redirects=True, stream=True, headers=headers) as response: # noqa: S113
1917
+ with requests.get(url, allow_redirects=True, stream=True, headers=headers) as response:
1919
1918
  status = response.status_code
1920
1919
  if status != requests.codes.ok: # NOQA
1921
1920
  if status == 429 and _delay < 20:
@@ -2134,7 +2133,7 @@ def call(args, verbose=TRACE):
2134
2133
  """
2135
2134
  if TRACE_DEEP:
2136
2135
  print("Calling:", " ".join(args))
2137
- with subprocess.Popen( # noqa: S603
2136
+ with subprocess.Popen(
2138
2137
  args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8"
2139
2138
  ) as process:
2140
2139
  stdouts = []
@@ -2199,7 +2198,7 @@ def download_wheels_with_pip(
2199
2198
  cli_args.extend(["--requirement", req_file])
2200
2199
 
2201
2200
  if TRACE:
2202
- print("Downloading wheels using command:", " ".join(cli_args))
2201
+ print(f"Downloading wheels using command:", " ".join(cli_args))
2203
2202
 
2204
2203
  existing = set(os.listdir(dest_dir))
2205
2204
  error = False
@@ -2232,7 +2231,7 @@ def download_wheels_with_pip(
2232
2231
 
2233
2232
  def check_about(dest_dir=THIRDPARTY_DIR):
2234
2233
  try:
2235
- subprocess.check_output(f"venv/bin/about check {dest_dir}".split()) # noqa: S603
2234
+ subprocess.check_output(f"venv/bin/about check {dest_dir}".split())
2236
2235
  except subprocess.CalledProcessError as cpe:
2237
2236
  print()
2238
2237
  print("Invalid ABOUT files:")
@@ -2283,5 +2282,5 @@ def get_license_expression(declared_licenses):
2283
2282
  return get_only_expression_from_extracted_license(declared_licenses)
2284
2283
  except ImportError:
2285
2284
  # Scancode is not installed, clean and join all the licenses
2286
- lics = [python_safe_name(lic).lower() for lic in declared_licenses]
2285
+ lics = [python_safe_name(l).lower() for l in declared_licenses]
2287
2286
  return " AND ".join(lics).lower()
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools >= 50", "wheel", "setuptools_scm[toml] >= 6"]
2
+ requires = ["setuptools >= 50", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [tool.setuptools_scm]
@@ -0,0 +1 @@
1
+ scancode-toolkit==32.4.1
@@ -1,7 +1,6 @@
1
1
  # from blint v2.3.2
2
2
  # https://github.com/owasp-dep-scan/blint/blob/1e1250a4bf6c25eccba8970bd877901ee56070c7/poetry.lock
3
- lief==0.15.1
3
+ lief==0.17.2
4
4
  symbolic==10.2.1
5
- click==8.2.1;python_version>='3.10'
6
- click==8.1.7;python_version<'3.10'
7
- commoncode==32.3.0
5
+ click==8.3.0
6
+ commoncode==32.4.0
@@ -1,6 +1,7 @@
1
1
  [metadata]
2
2
  name = binary-inspector
3
3
  license = Apache-2.0 AND MIT
4
+ version = 0.2.1
4
5
  description = binary-inspector is a library and tools to inspect binaries (elf, winpe, mach0) for symbols and other information, and models to store this.
5
6
  long_description = file:README.rst
6
7
  long_description_content_type = text/x-rst
@@ -31,15 +32,14 @@ packages = find:
31
32
  include_package_data = true
32
33
  zip_safe = false
33
34
  setup_requires = setuptools_scm[toml] >= 4
34
- python_requires = >=3.9
35
+ python_requires = >=3.10
35
36
  install_requires =
36
- click >= 6.7, !=7.0;python_version<'3.10'
37
- click >= 8.2.0;python_version>='3.10'
37
+ click >= 8.2.0
38
38
  commoncode
39
39
  plugincode
40
40
  typecode
41
- lief==0.15.1
42
- symbolic==10.2.1
41
+ lief>=0.17.2
42
+ symbolic>=10.2.1
43
43
 
44
44
  [options.entry_points]
45
45
  scancode_scan =
@@ -326,12 +326,18 @@ def process_pe_resources(parsed_obj):
326
326
  return {}
327
327
  resources = {}
328
328
  version_metadata = {}
329
- version_info: lief.PE.ResourceVersion = rm.version if rm.has_version else None
330
- if version_info and version_info.has_string_file_info:
329
+
330
+ version_info = rm.version if rm.has_version else None
331
+ if isinstance(version_info, list) and len(version_info):
332
+ if not isinstance(version_info[0], lief.lief_errors):
333
+ version_info = version_info[0]
334
+ if version_info and hasattr(version_info, "string_file_info"):
331
335
  string_file_info: lief.PE.ResourceStringFileInfo = version_info.string_file_info
332
- for lc_item in string_file_info.langcode_items:
333
- if lc_item.items:
334
- version_metadata.update(lc_item.items)
336
+ for lc_item in string_file_info.children:
337
+ if lc_item.entries:
338
+ for e in lc_item.entries:
339
+ version_metadata[e.key] = e.value
340
+
335
341
  try:
336
342
  resources = {
337
343
  "has_accelerator": rm.has_accelerator,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: binary-inspector
3
- Version: 0.1.2
3
+ Version: 0.2.1
4
4
  Summary: binary-inspector is a library and tools to inspect binaries (elf, winpe, mach0) for symbols and other information, and models to store this.
5
5
  Home-page: https://github.com/aboutcode-org/binary-inspector
6
6
  Author: nexB. Inc. and others
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Classifier: Topic :: Software Development
15
15
  Classifier: Topic :: Utilities
16
- Requires-Python: >=3.9
16
+ Requires-Python: >=3.10
17
17
  Description-Content-Type: text/x-rst
18
18
  License-File: apache-2.0.LICENSE
19
19
  License-File: NOTICE
@@ -21,13 +21,12 @@ License-File: AUTHORS.rst
21
21
  License-File: CHANGELOG.rst
22
22
  License-File: CODE_OF_CONDUCT.rst
23
23
  License-File: README.rst
24
- Requires-Dist: click!=7.0,>=6.7; python_version < "3.10"
25
- Requires-Dist: click>=8.2.0; python_version >= "3.10"
24
+ Requires-Dist: click>=8.2.0
26
25
  Requires-Dist: commoncode
27
26
  Requires-Dist: plugincode
28
27
  Requires-Dist: typecode
29
- Requires-Dist: lief==0.15.1
30
- Requires-Dist: symbolic==10.2.1
28
+ Requires-Dist: lief>=0.17.2
29
+ Requires-Dist: symbolic>=10.2.1
31
30
  Provides-Extra: dev
32
31
  Requires-Dist: scancode-toolkit; extra == "dev"
33
32
  Requires-Dist: pytest>=7.0.1; extra == "dev"
@@ -149,8 +148,8 @@ Communications Networks, Content and Technology under grant agreement No 1010695
149
148
  :height: 30
150
149
  :alt: AboutCode logo
151
150
 
152
- .. |swiss| image:: https://www.sbfi.admin.ch/sbfi/en/_jcr_content/logo/image.imagespooler.png/1493119032540/logo.png
153
- :target: https://www.sbfi.admin.ch/sbfi/en/home/seri/seri.html
151
+ .. |swiss| image:: https://www.sbfi.admin.ch/images/swiss-logo-flag.svg
152
+ :target: https://www.sbfi.admin.ch/de
154
153
  :height: 40
155
154
  :alt: Swiss logo
156
155
 
@@ -20,6 +20,7 @@ setup.py
20
20
  .github/workflows/docs-ci.yml
21
21
  .github/workflows/pypi-release.yml
22
22
  .github/workflows/tests.yml
23
+ .github/workflows/zizmor.yml
23
24
  docs/Makefile
24
25
  docs/make.bat
25
26
  docs/scripts/doc8_style_check.sh
@@ -1,14 +1,9 @@
1
+ click>=8.2.0
1
2
  commoncode
2
3
  plugincode
3
4
  typecode
4
- lief==0.15.1
5
- symbolic==10.2.1
6
-
7
- [:python_version < "3.10"]
8
- click!=7.0,>=6.7
9
-
10
- [:python_version >= "3.10"]
11
- click>=8.2.0
5
+ lief>=0.17.2
6
+ symbolic>=10.2.1
12
7
 
13
8
  [dev]
14
9
  scancode-toolkit
@@ -9,12 +9,14 @@
9
9
  "CFConstantStringClassReference",
10
10
  "CFDataGetBytePtr",
11
11
  "CFRelease",
12
+ "CFStringGetCStringPtr",
12
13
  "CGDataProviderCopyData",
13
14
  "CGDisplayCreateImage",
14
15
  "CGImageGetDataProvider",
15
16
  "CGImageGetHeight",
16
17
  "CGImageGetWidth",
17
18
  "CGMainDisplayID",
19
+ "DefaultRuneLocale",
18
20
  "IODisplayGetFloatParameter",
19
21
  "IODisplaySetFloatParameter",
20
22
  "IOIteratorNext",
@@ -54,36 +56,100 @@
54
56
  "NSUserDefaults",
55
57
  "NSWindowController",
56
58
  "NSWorkspace",
59
+ "abort",
60
+ "add",
61
+ "addMethod",
62
+ "addProperty",
63
+ "addProtocol",
64
+ "allocateClassPair",
65
+ "asprintf",
57
66
  "assign",
67
+ "autoreleasePoolPush",
58
68
  "autoreleaseReturnValue",
59
69
  "binder",
70
+ "bzero",
71
+ "calloc",
72
+ "class",
73
+ "constructInstance",
74
+ "copy",
75
+ "copyAttributeList",
76
+ "copyClassNamesForImage",
77
+ "create",
60
78
  "destroyWeak",
61
79
  "dispatch",
62
80
  "dispose",
63
81
  "dyld",
64
82
  "enumerationMutation",
65
83
  "fail",
84
+ "for",
85
+ "free",
86
+ "func",
87
+ "getClass",
88
+ "getIndexedIvars",
89
+ "getInstanceMethod",
90
+ "getInstanceSize",
91
+ "getInstanceVariable",
92
+ "getIvar",
93
+ "getIvarLayout",
94
+ "getMetaClass",
95
+ "getMethodDescription",
96
+ "getName",
97
+ "getOffset",
98
+ "getProtocol",
99
+ "getRequiredClass",
100
+ "getSuperclass",
101
+ "getUid",
66
102
  "guard",
103
+ "hash",
67
104
  "header",
105
+ "image",
106
+ "initializeClassPair",
107
+ "isMetaClass",
108
+ "ivar",
68
109
  "kCFAllocatorDefault",
110
+ "kCFCoreFoundationVersionNumber",
69
111
  "kIOMasterPortDefault",
112
+ "loadClassref",
70
113
  "loadWeakRetained",
114
+ "lock",
115
+ "lookUpClass",
71
116
  "main",
117
+ "malloc",
118
+ "memcpy",
119
+ "method",
72
120
  "mh",
73
121
  "msgSend",
74
122
  "msgSendSuper2",
123
+ "mutex",
75
124
  "object",
76
125
  "pow",
126
+ "property",
127
+ "protocol",
128
+ "pthread",
129
+ "readClassPair",
130
+ "register",
131
+ "registerClassPair",
77
132
  "release",
133
+ "replaceMethod",
134
+ "respondsToSelector",
78
135
  "retain",
79
136
  "retainAutorelease",
80
137
  "retainAutoreleaseReturnValue",
81
138
  "retainAutoreleasedReturnValue",
139
+ "search",
140
+ "sel",
141
+ "setImplementation",
142
+ "setIvar",
82
143
  "sleep",
83
144
  "stack",
84
145
  "storeStrong",
85
146
  "storeWeak",
86
- "stub"
147
+ "strcmp",
148
+ "strlen",
149
+ "strncmp",
150
+ "stub",
151
+ "unlock",
152
+ "vtable"
87
153
  ],
88
154
  "scan_errors": []
89
155
  }
@@ -64,4 +64,4 @@ def test_can_parse_and_demangle_macho_binary_symbols():
64
64
  winpe_binary = test_env.get_test_loc("winpe/TranslucentTB-setup.exe")
65
65
  winpe_symbols = binary.collect_and_parse_winpe_symbols(winpe_binary)
66
66
  expected = test_env.get_test_loc("winpe/TranslucentTB-symbols.json")
67
- check_json(expected, winpe_symbols, regen=True)
67
+ check_json(expected, winpe_symbols, regen=REGEN_TEST_FIXTURES)
@@ -25,7 +25,7 @@ def test_scancode_plugin_with_winpe_symbol_option():
25
25
  args = ["--winpe-symbol", test_file, "--json", result_file]
26
26
  run_scan_click(args)
27
27
  expected = test_env.get_test_loc("winpe/TranslucentTB-symbols-plugin.json")
28
- check_json_scan(expected, result_file, regen=True)
28
+ check_json_scan(expected, result_file, regen=REGEN_TEST_FIXTURES)
29
29
 
30
30
 
31
31
  def test_scancode_plugin_with_macho_symbol_option():
@@ -34,4 +34,4 @@ def test_scancode_plugin_with_macho_symbol_option():
34
34
  args = ["--macho-symbol", test_file, "--json", result_file]
35
35
  run_scan_click(args)
36
36
  expected = test_env.get_test_loc("macho/Lumen-symbols-plugin.json")
37
- check_json_scan(expected, result_file, regen=True)
37
+ check_json_scan(expected, result_file, regen=REGEN_TEST_FIXTURES)
@@ -1 +0,0 @@
1
- scancode-toolkit==32.3.3