aboutcode-org / aboutcode-org/scancode-toolkit

Improve package url derived from ABOUT files

Aperta
#1,879 1 commento 1 reazione 0 assegnatari Vedi su GitHub
bug package scan package-formats
Lingua principale
Python
Stelle
2.6k
Fork
791
Merge medio
1g 12h
PR unite (30g)
5

Descrizione

### 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
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.