Skip to content

Commit f1127cd

Browse files
committed
Fix ResolutionImpossible for lief==0.15.1
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent 09d4554 commit f1127cd

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed

src/python_inspector/package_data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def get_pypi_data_from_purl(
6464
)
6565
)
6666

67+
valid_distribution_urls = [url for url in valid_distribution_urls if url]
68+
6769
# if prefer_source is True then only source distribution is used
6870
# in case of no source distribution available then wheel is used
6971
if not valid_distribution_urls or not prefer_source:

src/python_inspector/utils_pypi.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ def get_python_dot_version(version):
145145
"manylinux1_x86_64",
146146
"manylinux2010_x86_64",
147147
"manylinux2014_x86_64",
148+
"manylinux2014_aarch6",
149+
"musllinux_1_2_x86_64",
150+
"manylinux_2_33_aarch64"
148151
],
149152
"macos": [
150153
"macosx_10_6_intel",
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"files": [],
3+
"packages": [
4+
{
5+
"type": "pypi",
6+
"namespace": null,
7+
"name": "lief",
8+
"version": "0.15.1",
9+
"qualifiers": {},
10+
"subpath": null,
11+
"primary_language": "Python",
12+
"description": "Library to instrument executable formats\nAbout\n=====\n\nThe purpose of this project is to provide a cross platform library that can parse, modify and\nabstract ELF, PE and MachO formats.\n\nMain features:\n\n * **Parsing**: LIEF can parse ELF, PE, MachO, OAT, DEX, VDEX, ART and provides an user-friendly API to access to format internals.\n * **Modify**: LIEF enables to modify some parts of these formats\n * **Abstract**: Three formats have common features like sections, symbols, entry point... LIEF factors them.\n * **API**: LIEF can be used in C, C++ and Python\n\n\nDownloads / Install\n===================\n\nFirst, make sure to have an updated version of setuptools:\n\n.. code-block:: console\n\n $ pip install setuptools --upgrade\n\nTo install the latest **version** (release):\n\n.. code-block:: console\n\n $ pip install lief\n\nTo install nightly build:\n\n.. code-block:: console\n\n $ pip install [--user] --index-url https://lief.s3-website.fr-par.scw.cloud/latest lief\n\n\nGetting started\n===============\n\nPython\n------\n\n.. code-block:: python\n\n import lief\n\n # ELF\n binary = lief.parse(\"/usr/bin/ls\")\n print(binary)\n\n # PE\n binary = lief.parse(\"C:\\\\Windows\\\\explorer.exe\")\n print(binary)\n\n # Mach-O\n binary = lief.parse(\"/usr/bin/ls\")\n print(binary)\n\nC++\n---\n\n.. code-block:: cpp\n\n #include <LIEF/LIEF.hpp>\n\n int main(int argc, char** argv) {\n // ELF\n try {\n std::unique_ptr<LIEF::ELF::Binary> elf = LIEF::ELF::Parser::parse(\"/bin/ls\");\n std::cout << *elf << '\\n';\n } catch (const LIEF::exception& err) {\n std::cerr << err.what() << '\\n';\n }\n\n // PE\n try {\n std::unique_ptr<LIEF::PE::Binary> pe = LIEF::PE::Parser::parse(\"C:\\\\Windows\\\\explorer.exe\");\n std::cout << *pe << '\\n';\n } catch (const LIEF::exception& err) {\n std::cerr << err.what() << '\\n';\n }\n\n // Mach-O\n try {\n std::unique_ptr<LIEF::MachO::FatBinary> macho = LIEF::MachO::Parser::parse(\"/bin/ls\");\n std::cout << *macho << '\\n';\n } catch (const LIEF::exception& err) {\n std::cerr << err.what() << '\\n';\n }\n\n return 0;\n }\n\nC (Limited API)\n----------------\n\n.. code-block:: cpp\n\n #include <LIEF/LIEF.h>\n\n int main(int argc, char** argv) {\n Elf_Binary_t* elf = elf_parse(\"/usr/bin/ls\");\n\n Elf_Section_t** sections = elf->sections;\n\n for (size_t i = 0; sections[i] != NULL; ++i) {\n printf(\"%s\\n\", sections[i]->name);\n }\n\n elf_binary_destroy(elf);\n return 0;\n }\n\nDocumentation\n=============\n\n* `Main documentation <https://lief-project.github.io/doc/latest/index.html>`_\n* `Tutorial <https://lief-project.github.io/doc/latest/tutorials/index.html>`_\n* `API <https://lief-project.github.io/doc/latest/api/index.html>`_\n* `Doxygen <https://lief-project.github.io/doc/latest/doxygen/index.html>`_\n\nContact\n=======\n\n* **Mail**: contact at lief.re\n* **Gitter**: `lief-project <https://gitter.im/lief-project>`_\n\n\nAuthors\n=======\n\nRomain Thomas `@rh0main <https://twitter.com/rh0main>`_ - `Quarkslab <https://www.quarkslab.com>`_\n\n----\n\nLIEF is provided under the `Apache 2.0 license <https://github.com/lief-project/LIEF/blob/0.12.3/LICENSE>`_",
13+
"release_date": "2024-07-23T14:52:11",
14+
"parties": [
15+
{
16+
"type": "person",
17+
"role": "author",
18+
"name": null,
19+
"email": "Romain Thomas <contact@lief.re>",
20+
"url": null
21+
}
22+
],
23+
"keywords": [
24+
"parser",
25+
"elf",
26+
"pe",
27+
"macho",
28+
"reverse-engineering",
29+
"Development Status :: 4 - Beta",
30+
"Programming Language :: C++",
31+
"Programming Language :: Python :: 3",
32+
"Topic :: Software Development :: Libraries"
33+
],
34+
"homepage_url": "https://lief-project.github.io/",
35+
"download_url": "https://files.pythonhosted.org/packages/bd/e8/398583add15a3a74207624be6a853a30a986252440f19b4052022cea911a/lief-0.15.1-cp312-cp312-musllinux_1_2_x86_64.whl",
36+
"size": 2476427,
37+
"sha1": null,
38+
"md5": "0a223b5258a2a5a112b92af3f38cf9f2",
39+
"sha256": "c2ec738bcafee8a569741f4a749f0596823b12f10713306c7d0cbbf85759f51c",
40+
"sha512": null,
41+
"bug_tracking_url": "https://github.com/lief-project/LIEF/issues",
42+
"code_view_url": null,
43+
"vcs_url": null,
44+
"copyright": null,
45+
"license_expression": null,
46+
"declared_license": {
47+
"license": "Apache License 2.0"
48+
},
49+
"notice_text": null,
50+
"source_packages": [],
51+
"file_references": [],
52+
"extra_data": {},
53+
"dependencies": [],
54+
"repository_homepage_url": null,
55+
"repository_download_url": null,
56+
"api_data_url": "https://pypi.org/pypi/lief/0.15.1/json",
57+
"datasource_id": null,
58+
"purl": "pkg:pypi/lief@0.15.1"
59+
}
60+
],
61+
"resolution": [
62+
{
63+
"package": "pkg:pypi/lief@0.15.1",
64+
"dependencies": []
65+
}
66+
]
67+
}

tests/test_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ def test_api_with_python_311():
107107
check_data_results(results=results.to_dict(generic_paths=True), expected_file=expected_file)
108108

109109

110+
def test_api_with_lief_python_312():
111+
expected_file = test_env.get_test_loc("test-api-with-lief-python-312.json", must_exist=False)
112+
results = resolver_api(
113+
specifiers=["lief==0.15.1"],
114+
python_version="3.12",
115+
operating_system="linux",
116+
prefer_source=True,
117+
)
118+
check_data_results(results=results.to_dict(generic_paths=True), expected_file=expected_file)
119+
110120
def test_api_with_partial_setup_py():
111121
expected_file = test_env.get_test_loc("test-api-with-partial-setup-py.json", must_exist=False)
112122
results = resolver_api(

0 commit comments

Comments
 (0)