packageurl-python icon indicating copy to clipboard operation
packageurl-python copied to clipboard

Fails to return the version if dependencies are specified

Open ajmalab opened this issue 1 year ago • 1 comments

The from_string() method does not parse purls with dependencies specified properly.

Steps to recreate:

The name is parsed as[email protected]([email protected])(typescript and the version as '4.9.4). Ideally the name should be express, version 7.0.6.

ajmalab avatar May 11 '23 12:05 ajmalab

@ajmalab Sorry for the late reply! I have never seen dependencies specified this way and this is not part of the PURL spec so far. Can you tell me where you got these from?

Now if you want to encode this the PURL would end up this way:

>>> from packageurl import *
>>> a="pkg:npm/@promster/express"; b="7.0.6([email protected])([email protected])"
>>> purl = PackageURL(type="npm", namespace="@promster", name="express", version="7.0.6([email protected])([email protected])")
>>> purl.to_string()
'pkg:npm/%40promster/[email protected]%28prom-client%4014.1.1%29%28typescript%404.9.4%29'

This would be rather odd to do. Can you tell me what you trying to achieve and which tool you may use?

pombredanne avatar Dec 08 '23 15:12 pombredanne