Skip to content

Commit 437df9e

Browse files
committed
Address review comments and add CHAGELOG
Signed-off-by: Tushar Goel <[email protected]>
1 parent 7d34a08 commit 437df9e

21 files changed

+32
-22
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ v0.9.2
66
------
77

88
- Make os and python version as mandatory input parameters.
9+
- Do not return duplicates binaries.
910

1011

1112
v0.9.1

src/python_inspector/package_data.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ def get_pypi_data_from_purl(
7575
python_version=python_version,
7676
)
7777
)
78-
wheel_urls.sort(reverse=True)
79-
if len(wheel_urls) > 0:
80-
valid_distribution_urls.append(wheel_urls[0])
78+
wheel_url = choose_single_wheel(wheel_urls)
79+
if wheel_url:
80+
valid_distribution_urls.append(wheel_url)
8181

8282
urls = response.get("urls") or []
8383
for url in urls:
@@ -111,6 +111,15 @@ def get_pypi_data_from_purl(
111111
)
112112

113113

114+
def choose_single_wheel(wheel_urls):
115+
"""
116+
Sort wheel urls descendingly and return the first one
117+
"""
118+
wheel_urls.sort(reverse=True)
119+
if wheel_urls:
120+
return wheel_urls[0]
121+
122+
114123
def get_pypi_bugtracker_url(project_urls):
115124
bug_tracking_url = project_urls.get("Tracker")
116125
if not (bug_tracking_url):

src/python_inspector/resolve_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
TRACE = False
2222

23-
__version__ = "0.9.1"
23+
__version__ = "0.9.2"
2424

2525
DEFAULT_PYTHON_VERSION = "38"
2626
PYPI_SIMPLE_URL = "https://pypi.org/simple"

tests/data/azure-devops.req-310-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.9.1",
5+
"tool_version": "0.9.2",
66
"options": [
77
"--requirement /home/tg1999/Desktop/python-inspector-1/tests/data/azure-devops.req.txt",
88
"--index-url https://pypi.org/simple",

tests/data/azure-devops.req-38-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.9.1",
5+
"tool_version": "0.9.2",
66
"options": [
77
"--requirement /home/tg1999/Desktop/python-inspector-1/tests/data/azure-devops.req.txt",
88
"--index-url https://pypi.org/simple",

tests/data/default-url-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.9.1",
5+
"tool_version": "0.9.2",
66
"options": [
77
"--specifier zipp==3.8.0",
88
"--index-url https://pypi.org/simple",

tests/data/environment-marker-test-requirements.txt-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.9.1",
5+
"tool_version": "0.9.2",
66
"options": [
77
"--requirement /home/tg1999/Desktop/python-inspector-1/tests/data/environment-marker-test-requirements.txt",
88
"--index-url https://pypi.org/simple",

tests/data/frozen-requirements.txt-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.9.1",
5+
"tool_version": "0.9.2",
66
"options": [
77
"--requirement /home/tg1999/Desktop/python-inspector-1/tests/data/frozen-requirements.txt",
88
"--index-url https://pypi.org/simple",

tests/data/insecure-setup-2/setup.py-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.9.1",
5+
"tool_version": "0.9.2",
66
"options": [
77
"--index-url https://pypi.org/simple",
88
"--python-version 27",

tests/data/insecure-setup/setup.py-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.9.1",
5+
"tool_version": "0.9.2",
66
"options": [
77
"--index-url https://pypi.org/simple",
88
"--python-version 27",

0 commit comments

Comments
 (0)