Add an option to skip version validation in `package.get_nva`

Open
#50 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
debian, python

Research direction

Start with package.get_nva in debian_inspector/package.py, then inspect its call from the Debian mining pipeline linked in the issue. Check how the version is currently validated and identify the existing tests for package filename parsing. Done means an optional flag permits collecting an otherwise invalid version while preserving validation by default.

Written by the indexing model from the issue text.

Description

We're using package.get_nva to extract name and version from a Debian package filename in pipeline to mine Debian PURLs. At PackageURL mining stage if we find a package version upstream we need to collect it, and we are not concerned whether or not the given version is a syntactically correct version at that stage. To insure this we should have an optional flag in package.get_nva to skip version validation.

Log from mine_debain pipeline:

2025-12-08 12:11:14.248750 UTC Failed to get PURL field from: gcc-bpf_14.3.0-10+_s390x.deb with error ValueError('Invalid version string: "14.3.0-10+"'):
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/minecode_pipelines/pipes/debian.py", line 131, in get_packages
    name, version, arch = debian_inspector.package.get_nva(file_name)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/debian_inspector/package.py", line 163, in get_nva
    return name, Version.from_string(evr), arch
                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/debian_inspector/version.py", line 135, in from_string
    raise ValueError('Invalid version string: "{}"'.format(version))
ValueError: Invalid version string: "14.3.0-10+"
Dominant language
Python
Stars
17
Forks
7
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aboutcode-org/debian-inspector

All issues in aboutcode-org/debian-inspector

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.