Skip to content

Commit 111b6db

Browse files
committed
Add changelog
remove unused code Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent 3e59fe5 commit 111b6db

File tree

2 files changed

+3
-59
lines changed

2 files changed

+3
-59
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ v0.7.0
1010
solution short of a full installation. Because this can be a security issue,
1111
there is a new "--analyze-setup-py-insecurely" command line option to enable this feature.
1212
Note that this not more insecure than actually installing a PyPI package.
13+
- Add metadata for packages.
1314

1415

1516
v0.6.5

src/python_inspector/resolution.py

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -494,43 +494,6 @@ def get_dependencies(self, candidate: Candidate) -> List[Requirement]:
494494
return list(self._iter_dependencies(candidate))
495495

496496

497-
def get_wheel_download_urls(
498-
purl: PackageURL,
499-
repos: List[PypiSimpleRepository],
500-
environment: Environment,
501-
python_version: str,
502-
) -> List[str]:
503-
"""
504-
Return a list of download urls for the given purl.
505-
"""
506-
for repo in repos:
507-
for wheel in utils_pypi.get_supported_and_valid_wheels(
508-
repo=repo,
509-
name=purl.name,
510-
version=purl.version,
511-
environment=environment,
512-
python_version=python_version,
513-
):
514-
yield wheel.download_url
515-
516-
517-
def get_sdist_download_url(
518-
purl: PackageURL, repos: List[PypiSimpleRepository], python_version: str
519-
) -> str:
520-
"""
521-
Return a list of download urls for the given purl.
522-
"""
523-
for repo in repos:
524-
sdist = utils_pypi.get_valid_sdist(
525-
repo=repo,
526-
name=purl.name,
527-
version=purl.version,
528-
python_version=python_version,
529-
)
530-
if sdist:
531-
return sdist.download_url
532-
533-
534497
def get_all_srcs(mapping: Dict, graph: DirectedGraph):
535498
"""
536499
Return a list of all sources in the graph.
@@ -559,9 +522,7 @@ def dfs(mapping: Dict, graph: DirectedGraph, src: str):
559522
)
560523

561524

562-
def format_resolution(
563-
results: Result, environment: Environment, repos: List[PypiSimpleRepository], as_tree=False
564-
):
525+
def format_resolution(results: Result, as_tree=False):
565526
"""
566527
Return a formatted resolution either as a tree or parent/children.
567528
"""
@@ -586,22 +547,6 @@ def format_resolution(
586547
)
587548
dependencies.append(str(dep_purl))
588549
dependencies.sort()
589-
python_version = get_python_version_from_env_tag(
590-
python_version=environment.python_version
591-
)
592-
wheel_urls = list(
593-
get_wheel_download_urls(
594-
purl=parent_purl,
595-
repos=repos,
596-
environment=environment,
597-
python_version=python_version,
598-
)
599-
)
600-
sdist_url = get_sdist_download_url(
601-
purl=parent_purl,
602-
repos=repos,
603-
python_version=python_version,
604-
)
605550
parent_children = dict(
606551
package=str(parent_purl),
607552
dependencies=dependencies,
@@ -777,9 +722,7 @@ def get_resolved_dependencies(
777722
if pdt_output:
778723
return (format_pdt_tree(resolver_results), package_list)
779724
return (
780-
format_resolution(
781-
resolver_results, as_tree=as_tree, environment=environment, repos=repos
782-
),
725+
format_resolution(resolver_results, as_tree=as_tree),
783726
package_list,
784727
)
785728
except Exception as e:

0 commit comments

Comments
 (0)