aboutcode-org / aboutcode-org/scancode.io

Improve pipeline creator UX to navigate CodebaseResource

Abierto
#369 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
215
Forks
203
Merge medio
4 d 8 h
PR fusionados (30 d)
6

Descripción

In https://github.com/nexB/scancode.io/tree/app-package-files I am working toward adding details of installed files for a given package type. This is designed to run either as a secondary pipeline after another scan, or to later integrate as a step.

I found it difficult to navigate CodebaseResource for doing these operations:

- given a resource navigate up to its parent
- given a pathlib.Path get the corresponding resource
- OR given an absolute path string get the corresponding resource
- walk the filesystem project/codebase directory and be able to easily get to a corresponding CodebaseResource

Some ugly thing I did include this https://github.com/nexB/scancode.io/blob/app-package-files/scanpipe/pipelines/add_files_to_packages.py#L58

Basically the operations I am doing for PyPI packages consist in:
- iterate all DiscoveredPackage of type "pypi"
- given a METADATA file present in the codebase for an installed "pypi" package
- go to the parent dir (typically a .dist-info) and create a native distribution object that can parse all installed wheel metafiles
- for each installed file of this distribution, find its CodebaseResource. a distribution file will be a pathlib.Path
- Add the package to the CodebaseResource discovered_packages

We have a decent way for rootfs resources which are rooted by construction. But for other resources this is more involved.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.