aboutcode-org / aboutcode-org/scancode-toolkit

Improve package url derived from ABOUT files

Offen
#1,879 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
bug package scan package-formats
Vorherrschende Sprache
Python
Sterne
2.6k
Forks
791
Ø Merge
1 T. 12 Std.
Gemergte PRs (30 T.)
5

Beschreibung

### Description

> Please leave a brief description of the bug or feature request:

The output of a `scancode --package` scan on `ABOUT` files could be improved by using additional metadata the `ABOUT` file provides.

Scanning https://github.com/nexB/scancode-toolkit/blob/develop/src/scancode/interrupt-robotframework.ABOUT returns a generic `pkg:about/robotframework@3.0.2` instead of the fully qualified `pkg:pypi/robotframework@3.0.2`. The `download_url` could be used to detect that this is a package from PyPi.

Looking at https://github.com/nexB/scancode-toolkit/blob/e3ab9d730e9c0daba2a81a35db3d8f84582b7ca2/src/typecode/magic2.py.ABOUT produces `pkg:about/python-magic`, the `download_url` gives us all the information we need to fully qualify it as `pkg:pypi/python-magic@0.4.6`.

### How To Reproduce

> Tell us how to reproduce the issue.

```
mkdir test
curl https://raw.githubusercontent.com/nexB/scancode-toolkit/e3ab9d730e9c0daba2a81a35db3d8f84582b7ca2/src/typecode/magic2.py.ABOUT >> test/magic2.py.ABOUT
curl https://raw.githubusercontent.com/nexB/scancode-toolkit/develop/src/scancode/interrupt-robotframework.ABOUT >> test/interrupt-robotframework.ABOUT
scancode --json-pp - --package test/ | grep purl
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.