Define pkg as a PackageURL class attribute#184
Conversation
|
@jaimergp this is fine by me BTW... no objections to make it easier to reuse! |
|
Ah, I see, this is now with #186 |
|
Ah, @pombredanne, if you are fine with this type of change, yes, please, let's reopen! |
|
@pombredanne (or anyone with merge rights!) gentle ping for a hopefully uncontroversial review! |
src/packageurl/__init__.py
Outdated
| https://github.com/package-url/purl-spec | ||
| """ | ||
|
|
||
| SCHEME: str = "pkg" |
There was a problem hiding this comment.
I'm wondering if using lower-caps scheme for consistency with existing vars would make more sense. I don't see anything declared as upper-caps in that module.
There was a problem hiding this comment.
I used uppercase because it's supposed to be constant for the class, maybe I can indicate that with ClassVar[str] instead.
There was a problem hiding this comment.
Changed to ClassVar[str]
|
Thanks @tdruez, let me know if I addressed your concerns! |
|
@jaimergp Thanks! LGTM. @pombredanne Could you give it another look and take care of the merge? |
This will allow library users to subclass
PackageURLand redefine the scheme to create PURL-like derivatives. (e.g. for thedep:idea described here):Which can be used in the same way and happily accepts PEP440-like version ranges in the
versionfield 🥳: