CycloneDX / CycloneDX/cyclonedx-python

feat: mark dev-dependencies `component.scope` as "excluded"

Ouverte
#675 0 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
enhancement good first issue hacktoberfest help wanted source: pipenv source: poetry
Langage dominant
Python
Étoiles
390
Forks
98
Merge moyen
2 j 23 h
PR mergées (30 j)
2

Description

## Is your feature request related to a problem? Please describe.

Per CycloneDX specification, the components' scope means (see [docs](https://cyclonedx.org/docs/1.6/json/#components_items_scope))

- "required": The component is required for runtime
- "optional": The component is optional at runtime. Optional components are components that are not capable of being called due to them not be installed or otherwise accessible by any means. Components that are installed but due to configuration or other restrictions are prohibited from being called must be scoped as 'required'.
- "excluded": Components that are excluded provide the ability to document component usage for test and other non-runtime purposes. Excluded components are not reachable within a call graph at runtime.

Current implementation does not set any scope, meaning the fallback to "required".
for dev-dependencies this would be wrong.

## Describe the solution you'd like

mark all components, that are dev-dependencies only, as "excluded" in the resulting SBOM.

## Describe alternatives you've considered

none

## Additional context

### for `poetry`

poetry knowns the "dev" group/category - things that are in there only (not in any other) are dev-dependencies

### for `pipenv`

pipenv knowns a group/category called "dev-packages" - things that are in there only (not in any other) are dev-dependencies

### for `pyproject.toml`

pyproject knows optional-dependency groups. see also [PEP735 (draft)](https://peps.python.org/pep-0735/)
there is no accepted PEP for that matter (or is there?), but commonly, people use "dev" or
"devel", "development" group to tell development-dependencies. - things that are in there, but not in any other, are dev-dependencies
Since there is no consensus here, the **pyproject SHOULD have no effect** on the `component.scope`, for now

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Tracez la manière dont les scopes des composants sont générés pour les dépendances Poetry et Pipenv, puis comparez l’appartenance des paquets entre les groupes de runtime et de développement. C’est terminé lorsque les composants réservés au développement sont marqués "excluded", que les composants partagés conservent leur scope existant et que les groupes de dépendances optionnelles de pyproject.toml n’affectent pas le scope.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
security, tooling
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.