mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-11-27 19:57:58 -05:00
dev-python/packageurl: enable tests
Tests have a sub-module dependency, so we must include it, if the tests are enabled. Also adds pydantic as a test dependency. Adds patches from PR #225 which allows us to use purl-spec 1.0.0 for testing. The PR consists of 3 patches, the third of which is the submodule pin, this third patch is not used in favor of pinning via variable ${PURL_SPEC_PV}. Signed-off-by: bakedsnake <bakedsnake@vagrantz.xyz>
This commit is contained in:
4 files changed
+249
-11
No files matched your search
@@ -1 +1,2 @@
|
||||
DIST packageurl_python-0.17.6.tar.gz 50618 BLAKE2B 06350b9befc1d141b370a4415543a0d5e89d243daedde718f447ce08f8c39a9f5d15be029a79a58b4f5233fb215f2bf453d950db8663e4eb440a24e232493aac SHA512 b8445aeae85fd517a7ded1772592b51358fc9a71963c5d4e9a36fb33e20e1b37ccd6bd6761b19caa370e6be2756c645cfedc02e4404f98479a4ec2792d12b6a1
|
||||
DIST packageurl-0.17.6.gh.tar.gz 3637930 BLAKE2B 913118759ea1c1c50842f8f88405410cff4ffd9ee40c2024fbbe405afb376393be3b837bb75516b3d04258ded6943fae4e0939695c1ade0be2aa553ce0ed7dad SHA512 78027b3a6b9eeeb5e1f1bb222cf1b3d94c7edd1b84c96181823f70a6b660eeef73cdfc69a08f7379bd02665bacaee2b875b3c82fd23dee49e525d6256531cd14
|
||||
DIST purl-spec-1.0.0.gh.tar.gz 70378 BLAKE2B e95a5a3e4897bcbe80e9d289cd3eb5fe2c269d502c928de62dce4986cbe7deea348ac16b3aa651098704b5cba49560d34aa0ec97831f2d5d3607deb29b0a7608 SHA512 0e5fd749eb9677da627441f94ff341273097a98024edd9b6b048e35723ca4f4dc7d052b52532e7d728f1c6e9f68e3776343dc50a7921ac1575f714b3e995c813
|
||||
@@ -0,0 +1,29 @@
|
||||
From 94064987c3fa6bb2e09ad338be1b43efa73b6fa3 Mon Sep 17 00:00:00 2001
|
||||
From: Yannic Bonenberger <yannic@engflow.com>
|
||||
Date: Wed, 11 Feb 2026 12:49:47 +0100
|
||||
Subject: [PATCH 1/3] Use `safe` instead of `.replace()` for percent-encoding
|
||||
|
||||
Note that this incorrectly classifies `/` as safe character when
|
||||
it should be encoded for backward compatibility with the existing test
|
||||
suite.
|
||||
|
||||
It seems like the spec testsuite may be inconsistent whether `/` should be
|
||||
encoded or not (e.g., Bazel does while Maven doesn't).
|
||||
---
|
||||
src/packageurl/__init__.py | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/packageurl/__init__.py b/src/packageurl/__init__.py
|
||||
index 3bfae87..cff703c 100644
|
||||
--- a/src/packageurl/__init__.py
|
||||
+++ b/src/packageurl/__init__.py
|
||||
@@ -80,10 +80,9 @@ def quote(s: AnyStr) -> str:
|
||||
byte or unicode string.
|
||||
"""
|
||||
s_bytes = s.encode("utf-8") if isinstance(s, str) else s
|
||||
- quoted = _percent_quote(s_bytes)
|
||||
+ quoted = _percent_quote(s_bytes, safe=':')
|
||||
if not isinstance(quoted, str):
|
||||
quoted = quoted.decode("utf-8")
|
||||
- quoted = quoted.replace("%3A", ":")
|
||||
return quoted
|
||||
@@ -0,0 +1,188 @@
|
||||
From df6c70258bb9b48b18b7c80fcdb19b03f33071e2 Mon Sep 17 00:00:00 2001
|
||||
From: Yannic Bonenberger <yannic@engflow.com>
|
||||
Date: Wed, 11 Feb 2026 13:34:32 +0100
|
||||
Subject: [PATCH 2/3] Pass latest spec tests
|
||||
---
|
||||
|
||||
diff --git a/tests/contrib/data/url2purl.json b/tests/contrib/data/url2purl.json
|
||||
index 3a99dd2..d531b93 100644
|
||||
--- a/tests/contrib/data/url2purl.json
|
||||
+++ b/tests/contrib/data/url2purl.json
|
||||
@@ -162,19 +162,19 @@
|
||||
"http://master.dl.sourceforge.net/project/wxmozilla/wxMozilla/0.5.5/wxMozilla-0.5.5.exe": "pkg:sourceforge/wxmozilla/wxMozilla@0.5.5",
|
||||
"http://iweb.dl.sourceforge.net/project/sblim/sblim-cim-client2/2.2.5/sblim-cim-client2-2.2.5-src.zip": "pkg:sourceforge/sblim/sblim-cim-client2@2.2.5",
|
||||
"http://master.dl.sourceforge.net/project/zinnia/zinnia-win32/0.06/zinnia-win32-0.06.zip": "pkg:sourceforge/zinnia/zinnia-win32@0.06",
|
||||
- "http://iweb.dl.sourceforge.net/project/findbugs/findbugs/1.3.4/findbugs-1.3.4.tar.gz/": "pkg:sourceforge/findbugs?download_url=http://iweb.dl.sourceforge.net/project/findbugs/findbugs/1.3.4/findbugs-1.3.4.tar.gz/",
|
||||
- "http://master.dl.sourceforge.net/project/arestc/net/sf/arestc/arestc/0.1.4/arestc-0.1.4-javadoc.jar": "pkg:sourceforge/arestc?download_url=http://master.dl.sourceforge.net/project/arestc/net/sf/arestc/arestc/0.1.4/arestc-0.1.4-javadoc.jar",
|
||||
+ "http://iweb.dl.sourceforge.net/project/findbugs/findbugs/1.3.4/findbugs-1.3.4.tar.gz/": "pkg:sourceforge/findbugs?download_url=http:%2F%2Fiweb.dl.sourceforge.net%2Fproject%2Ffindbugs%2Ffindbugs%2F1.3.4%2Ffindbugs-1.3.4.tar.gz%2F",
|
||||
+ "http://master.dl.sourceforge.net/project/arestc/net/sf/arestc/arestc/0.1.4/arestc-0.1.4-javadoc.jar": "pkg:sourceforge/arestc?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Farestc%2Fnet%2Fsf%2Farestc%2Farestc%2F0.1.4%2Farestc-0.1.4-javadoc.jar",
|
||||
"http://master.dl.sourceforge.net/project/intraperson/OldFiles/intraperson/0.28/intraperson-0.28.tar.gz": "pkg:sourceforge/intraperson/intraperson@0.28",
|
||||
- "http://master.dl.sourceforge.net/project/pwiki/pwiki/0.1.2/0.1.2.zip": "pkg:sourceforge/pwiki?download_url=http://master.dl.sourceforge.net/project/pwiki/pwiki/0.1.2/0.1.2.zip",
|
||||
- "http://master.dl.sourceforge.net/project/iswraid/iswraid/0.1.4.3/2.4.28-pre3-iswraid.patch.gz": "pkg:sourceforge/iswraid?download_url=http://master.dl.sourceforge.net/project/iswraid/iswraid/0.1.4.3/2.4.28-pre3-iswraid.patch.gz",
|
||||
- "http://master.dl.sourceforge.net/project/aloyscore/aloyscore/0.1a1%20stable/0.1a1_stable_AloysCore.zip": "pkg:sourceforge/aloyscore?download_url=http://master.dl.sourceforge.net/project/aloyscore/aloyscore/0.1a1%2520stable/0.1a1_stable_AloysCore.zip",
|
||||
- "http://master.dl.sourceforge.net/project/myenterprise/OldFiles/1.0.0.2.MyEnterprise.Source.zip": "pkg:sourceforge/myenterprise?download_url=http://master.dl.sourceforge.net/project/myenterprise/OldFiles/1.0.0.2.MyEnterprise.Source.zip",
|
||||
- "http://master.dl.sourceforge.net/project/wxhaskell/wxhaskell/wxhaskell-0.9/wxhaskell-src-0.9.zip": "pkg:sourceforge/wxhaskell?download_url=http://master.dl.sourceforge.net/project/wxhaskell/wxhaskell/wxhaskell-0.9/wxhaskell-src-0.9.zip",
|
||||
- "http://master.dl.sourceforge.net/project/a2freedom/A2/1.2/a2freedom-1.2.zip": "pkg:sourceforge/a2freedom?download_url=http://master.dl.sourceforge.net/project/a2freedom/A2/1.2/a2freedom-1.2.zip",
|
||||
+ "http://master.dl.sourceforge.net/project/pwiki/pwiki/0.1.2/0.1.2.zip": "pkg:sourceforge/pwiki?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Fpwiki%2Fpwiki%2F0.1.2%2F0.1.2.zip",
|
||||
+ "http://master.dl.sourceforge.net/project/iswraid/iswraid/0.1.4.3/2.4.28-pre3-iswraid.patch.gz": "pkg:sourceforge/iswraid?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Fiswraid%2Fiswraid%2F0.1.4.3%2F2.4.28-pre3-iswraid.patch.gz",
|
||||
+ "http://master.dl.sourceforge.net/project/aloyscore/aloyscore/0.1a1%20stable/0.1a1_stable_AloysCore.zip": "pkg:sourceforge/aloyscore?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Faloyscore%2Faloyscore%2F0.1a1%2520stable%2F0.1a1_stable_AloysCore.zip",
|
||||
+ "http://master.dl.sourceforge.net/project/myenterprise/OldFiles/1.0.0.2.MyEnterprise.Source.zip": "pkg:sourceforge/myenterprise?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Fmyenterprise%2FOldFiles%2F1.0.0.2.MyEnterprise.Source.zip",
|
||||
+ "http://master.dl.sourceforge.net/project/wxhaskell/wxhaskell/wxhaskell-0.9/wxhaskell-src-0.9.zip": "pkg:sourceforge/wxhaskell?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Fwxhaskell%2Fwxhaskell%2Fwxhaskell-0.9%2Fwxhaskell-src-0.9.zip",
|
||||
+ "http://master.dl.sourceforge.net/project/a2freedom/A2/1.2/a2freedom-1.2.zip": "pkg:sourceforge/a2freedom?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Fa2freedom%2FA2%2F1.2%2Fa2freedom-1.2.zip",
|
||||
"http://master.dl.sourceforge.net/project/tinyos/OldFiles/tinyos/1.1.0/tinyos-1.1.0.tar.gz": "pkg:sourceforge/tinyos/tinyos@1.1.0",
|
||||
- "http://master.dl.sourceforge.net/project/urlchecker/lu/ng/urlchecker/urlchecker/1.7/urlchecker-1.7-javadoc.jar": "pkg:sourceforge/urlchecker?download_url=http://master.dl.sourceforge.net/project/urlchecker/lu/ng/urlchecker/urlchecker/1.7/urlchecker-1.7-javadoc.jar",
|
||||
- "http://master.dl.sourceforge.net/project/zclasspath/maven2/org/zclasspath/zclasspath/1.5/zclasspath-1.5.jar": "pkg:sourceforge/zclasspath?download_url=http://master.dl.sourceforge.net/project/zclasspath/maven2/org/zclasspath/zclasspath/1.5/zclasspath-1.5.jar",
|
||||
- "http://master.dl.sourceforge.net/project/googleimagedown/project/v1.1/GoogleImageDownloader-v1.1-src.tar.bz2": "pkg:sourceforge/googleimagedown?download_url=http://master.dl.sourceforge.net/project/googleimagedown/project/v1.1/GoogleImageDownloader-v1.1-src.tar.bz2",
|
||||
+ "http://master.dl.sourceforge.net/project/urlchecker/lu/ng/urlchecker/urlchecker/1.7/urlchecker-1.7-javadoc.jar": "pkg:sourceforge/urlchecker?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Furlchecker%2Flu%2Fng%2Furlchecker%2Furlchecker%2F1.7%2Furlchecker-1.7-javadoc.jar",
|
||||
+ "http://master.dl.sourceforge.net/project/zclasspath/maven2/org/zclasspath/zclasspath/1.5/zclasspath-1.5.jar": "pkg:sourceforge/zclasspath?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Fzclasspath%2Fmaven2%2Forg%2Fzclasspath%2Fzclasspath%2F1.5%2Fzclasspath-1.5.jar",
|
||||
+ "http://master.dl.sourceforge.net/project/googleimagedown/project/v1.1/GoogleImageDownloader-v1.1-src.tar.bz2": "pkg:sourceforge/googleimagedown?download_url=http:%2F%2Fmaster.dl.sourceforge.net%2Fproject%2Fgoogleimagedown%2Fproject%2Fv1.1%2FGoogleImageDownloader-v1.1-src.tar.bz2",
|
||||
"https://sourceforge.net/projects/scribus/files/scribus/1.6.0/scribus-1.6.0.tar.gz/download": "pkg:sourceforge/scribus@1.6.0",
|
||||
"https://sourceforge.net/projects/turbovnc/files/3.1/turbovnc-3.1.tar.gz/download": "pkg:sourceforge/turbovnc@3.1",
|
||||
"https://sourceforge.net/projects/ventoy/files/v1.0.96/Ventoy%201.0.96%20release%20source%20code.tar.gz/download": "pkg:sourceforge/ventoy@1.0.96",
|
||||
@@ -194,7 +194,7 @@
|
||||
"https://github.com/TG1999/fetchcode/fetchcode/src": "pkg:github/tg1999/fetchcode@fetchcode#src",
|
||||
"https://github.com/NEXB/SCANCODE-TOOLKIT/tree/develop/PLUGINS/scancode-ctags-macosx_10_9_intel": "pkg:github/nexb/scancode-toolkit@develop#PLUGINS/scancode-ctags-macosx_10_9_intel",
|
||||
"https://github.com/NEXB/SCANCODE-TOOLKIT/tree/DEVELOP/PLUGINS/scancode-ctags-macosx_10_9_intel": "pkg:github/nexb/scancode-toolkit@DEVELOP#PLUGINS/scancode-ctags-macosx_10_9_intel",
|
||||
- "https://github.com/apache/nifi/archive/refs/tags/rel/nifi-2.0.0-M3.tar.gz": "pkg:github/apache/nifi@rel/nifi-2.0.0-M3",
|
||||
+ "https://github.com/apache/nifi/archive/refs/tags/rel/nifi-2.0.0-M3.tar.gz": "pkg:github/apache/nifi@rel%2Fnifi-2.0.0-M3",
|
||||
"https://raw.githubusercontent.com/volatilityfoundation/dwarf2json/master/LICENSE.txt": "pkg:github/volatilityfoundation/dwarf2json@master#LICENSE.txt",
|
||||
"https://raw.githubusercontent.com/LeZuse/flex-sdk/master/frameworks/projects/mx/src/mx/containers/accordionClasses/AccordionHeader.as": "pkg:github/lezuse/flex-sdk@master#frameworks/projects/mx/src/mx/containers/accordionClasses/AccordionHeader.as",
|
||||
"https://raw.githubusercontent.com/NCIP/lexevs/master/lgSharedLibraries/jettison/jettison-1.1.jar": "pkg:github/ncip/lexevs@master#lgSharedLibraries/jettison/jettison-1.1.jar",
|
||||
@@ -218,10 +218,10 @@
|
||||
"https://github.com/fanf2/unifdef/blob/master/unifdef.c": "pkg:github/fanf2/unifdef@master#unifdef.c",
|
||||
"https://github.com/joebeeson/amazon/blob/master/vendors/aws-sdk/sdk.class.php": "pkg:github/joebeeson/amazon@master#vendors/aws-sdk/sdk.class.php",
|
||||
"https://github.com/modelfabric/yowl/blob/master/bin/yowl": "pkg:github/modelfabric/yowl@master#bin/yowl",
|
||||
- "https://github.com/syncthing/syncthing/releases/download/v0.14.36/syncthing-source-v0.14.36.tar.gz": "pkg:github/syncthing/syncthing@v0.14.36?download_url=https://github.com/syncthing/syncthing/releases/download/v0.14.36/syncthing-source-v0.14.36.tar.gz",
|
||||
- "https://github.com/torakiki/pdfsam/releases/download/v3.3.2/pdfsam-3.3.2-bin.zip": "pkg:github/torakiki/pdfsam@v3.3.2?download_url=https://github.com/torakiki/pdfsam/releases/download/v3.3.2/pdfsam-3.3.2-bin.zip",
|
||||
- "https://github.com/yarnpkg/yarn/releases/download/v1.3.2/yarn-v1.3.2.tar.gz": "pkg:github/yarnpkg/yarn@v1.3.2?download_url=https://github.com/yarnpkg/yarn/releases/download/v1.3.2/yarn-v1.3.2.tar.gz",
|
||||
- "https://github.com/z3APA3A/3proxy/releases/download/0.8.11/3proxy-0.8.11.zip": "pkg:github/z3apa3a/3proxy@0.8.11?download_url=https://github.com/z3APA3A/3proxy/releases/download/0.8.11/3proxy-0.8.11.zip",
|
||||
+ "https://github.com/syncthing/syncthing/releases/download/v0.14.36/syncthing-source-v0.14.36.tar.gz": "pkg:github/syncthing/syncthing@v0.14.36?download_url=https:%2F%2Fgithub.com%2Fsyncthing%2Fsyncthing%2Freleases%2Fdownload%2Fv0.14.36%2Fsyncthing-source-v0.14.36.tar.gz",
|
||||
+ "https://github.com/torakiki/pdfsam/releases/download/v3.3.2/pdfsam-3.3.2-bin.zip": "pkg:github/torakiki/pdfsam@v3.3.2?download_url=https:%2F%2Fgithub.com%2Ftorakiki%2Fpdfsam%2Freleases%2Fdownload%2Fv3.3.2%2Fpdfsam-3.3.2-bin.zip",
|
||||
+ "https://github.com/yarnpkg/yarn/releases/download/v1.3.2/yarn-v1.3.2.tar.gz": "pkg:github/yarnpkg/yarn@v1.3.2?download_url=https:%2F%2Fgithub.com%2Fyarnpkg%2Fyarn%2Freleases%2Fdownload%2Fv1.3.2%2Fyarn-v1.3.2.tar.gz",
|
||||
+ "https://github.com/z3APA3A/3proxy/releases/download/0.8.11/3proxy-0.8.11.zip": "pkg:github/z3apa3a/3proxy@0.8.11?download_url=https:%2F%2Fgithub.com%2Fz3APA3A%2F3proxy%2Freleases%2Fdownload%2F0.8.11%2F3proxy-0.8.11.zip",
|
||||
"https://github.com/FasterXML/woodstox/archive/woodstox-core-5.0.2.zip": "pkg:github/fasterxml/woodstox@core-5.0.2",
|
||||
"https://github.com/adobe-fonts/source-code-pro/archive/2.030R-ro/1.050R-it.tar.gz": "pkg:github/adobe-fonts/source-code-pro@1.050R-it",
|
||||
"https://github.com/cassandra-rb/simple_uuid/archive/simple_uuid-0.3.0.zip": "pkg:github/cassandra-rb/simple_uuid@0.3.0",
|
||||
@@ -250,9 +250,9 @@
|
||||
"https://bitbucket.org/TG1999/first_repo/src/master/new_folder/": "pkg:bitbucket/tg1999/first_repo@master#new_folder",
|
||||
"https://bitbucket.org/TG1999/first_repo/src/MASTER/NEW_FOLDER/": "pkg:bitbucket/tg1999/first_repo@MASTER#NEW_FOLDER",
|
||||
"https://bitbucket.org/TG1999/first_repo/new_folder/": "pkg:bitbucket/tg1999/first_repo@new_folder",
|
||||
- "https://bitbucket.org/multicoreware/x265/downloads/x265_2.6.tar.gz": "pkg:bitbucket/multicoreware/x265?download_url=https://bitbucket.org/multicoreware/x265/downloads/x265_2.6.tar.gz",
|
||||
- "https://bitbucket.org/robeden/trove/downloads/trove-3.0.3.zip": "pkg:bitbucket/robeden/trove?download_url=https://bitbucket.org/robeden/trove/downloads/trove-3.0.3.zip",
|
||||
- "https://bitbucket.org/efotinis/deskpins/downloads/DeskPins-1.31-setup.exe": "pkg:bitbucket/efotinis/deskpins?download_url=https://bitbucket.org/efotinis/deskpins/downloads/DeskPins-1.31-setup.exe",
|
||||
+ "https://bitbucket.org/multicoreware/x265/downloads/x265_2.6.tar.gz": "pkg:bitbucket/multicoreware/x265?download_url=https:%2F%2Fbitbucket.org%2Fmulticoreware%2Fx265%2Fdownloads%2Fx265_2.6.tar.gz",
|
||||
+ "https://bitbucket.org/robeden/trove/downloads/trove-3.0.3.zip": "pkg:bitbucket/robeden/trove?download_url=https:%2F%2Fbitbucket.org%2Frobeden%2Ftrove%2Fdownloads%2Ftrove-3.0.3.zip",
|
||||
+ "https://bitbucket.org/efotinis/deskpins/downloads/DeskPins-1.31-setup.exe": "pkg:bitbucket/efotinis/deskpins?download_url=https:%2F%2Fbitbucket.org%2Fefotinis%2Fdeskpins%2Fdownloads%2FDeskPins-1.31-setup.exe",
|
||||
"https://gitlab.com/TG1999/firebase/-/tree/1a122122/views": "pkg:gitlab/tg1999/firebase@1a122122#views",
|
||||
"https://gitlab.com/tg1999/firebase": "pkg:gitlab/tg1999/firebase",
|
||||
"https://gitlab.com/TG1999/firebase/-/": "pkg:gitlab/tg1999/firebase",
|
||||
@@ -269,12 +269,12 @@
|
||||
"https://hackage.haskell.org/package/3d-graphics-examples-0.0.0.2/3d-graphics-examples-0.0.0.2.tar.gz": "pkg:hackage/3d-graphics-examples@0.0.0.2",
|
||||
"https://hackage.haskell.org/package/cli-extras-0.2.0.0": "pkg:hackage/cli-extras@0.2.0.0",
|
||||
"https://hackage.haskell.org/package/cli-extras-0.2.0.0/": "pkg:hackage/cli-extras@0.2.0.0",
|
||||
- "https://salsa.debian.org/lxc-team/lxc/-/archive/master/lxc-master.tar.gz": "pkg:generic/lxc-master.tar.gz?download_url=https://salsa.debian.org/lxc-team/lxc/-/archive/master/lxc-master.tar.gz",
|
||||
+ "https://salsa.debian.org/lxc-team/lxc/-/archive/master/lxc-master.tar.gz": "pkg:generic/lxc-master.tar.gz?download_url=https:%2F%2Fsalsa.debian.org%2Flxc-team%2Flxc%2F-%2Farchive%2Fmaster%2Flxc-master.tar.gz",
|
||||
"http://apt-rpm.org/": null,
|
||||
"": null,
|
||||
- "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android-notifier/android-notifier-desktop-0.5.1-1.i386.rpm": "pkg:generic/code.google.com/android-notifier?download_url=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android-notifier/android-notifier-desktop-0.5.1-1.i386.rpm",
|
||||
+ "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android-notifier/android-notifier-desktop-0.5.1-1.i386.rpm": "pkg:generic/code.google.com/android-notifier?download_url=https:%2F%2Fstorage.googleapis.com%2Fgoogle-code-archive-downloads%2Fv2%2Fcode.google.com%2Fandroid-notifier%2Fandroid-notifier-desktop-0.5.1-1.i386.rpm",
|
||||
"https://cran.r-project.org/src/contrib/jsonlite_1.8.8.tar.gz": "pkg:cran/jsonlite@1.8.8",
|
||||
- "https://packagemanager.rstudio.com/cran/2022-06-23/src/contrib/curl_4.3.2.tar.gz": "pkg:cran/curl@4.3.2?download_url=https://packagemanager.rstudio.com/cran/2022-06-23/src/contrib/curl_4.3.2.tar.gz",
|
||||
+ "https://packagemanager.rstudio.com/cran/2022-06-23/src/contrib/curl_4.3.2.tar.gz": "pkg:cran/curl@4.3.2?download_url=https:%2F%2Fpackagemanager.rstudio.com%2Fcran%2F2022-06-23%2Fsrc%2Fcontrib%2Fcurl_4.3.2.tar.gz",
|
||||
"https://github.com/TG1999/first_repo/commit/98e516011d6e096e25247b82fc5f196bbeecff10": "pkg:github/tg1999/first_repo@98e516011d6e096e25247b82fc5f196bbeecff10",
|
||||
"https://gitlab.com/TG1999/first_repo/-/commit/bf04e5f289885cf2f20a92b387bcc6df33e30809": "pkg:gitlab/tg1999/first_repo@bf04e5f289885cf2f20a92b387bcc6df33e30809",
|
||||
"https://bitbucket.org/TG1999/first_repo/commits/16a60c4a74ef477cd8c16ca82442eaab2fbe8c86": "pkg:bitbucket/tg1999/first_repo@16a60c4a74ef477cd8c16ca82442eaab2fbe8c86"
|
||||
diff --git a/tests/data/test-suite-data.json b/tests/data/test-suite-data.json
|
||||
index 571c568..625263f 100644
|
||||
--- a/tests/data/test-suite-data.json
|
||||
+++ b/tests/data/test-suite-data.json
|
||||
@@ -122,7 +122,7 @@
|
||||
{
|
||||
"description": "maven often uses qualifiers",
|
||||
"purl": "pkg:Maven/org.apache.xmlgraphics/batik-anim@1.9.1?repositorY_url=repo.spring.io/release&classifier=sources",
|
||||
- "canonical_purl": "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?classifier=sources&repository_url=repo.spring.io/release",
|
||||
+ "canonical_purl": "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?classifier=sources&repository_url=repo.spring.io%2Frelease",
|
||||
"type": "maven",
|
||||
"namespace": "org.apache.xmlgraphics",
|
||||
"name": "batik-anim",
|
||||
@@ -134,7 +134,7 @@
|
||||
{
|
||||
"description": "maven pom reference",
|
||||
"purl": "pkg:Maven/org.apache.xmlgraphics/batik-anim@1.9.1?repositorY_url=repo.spring.io/release&extension=pom",
|
||||
- "canonical_purl": "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?extension=pom&repository_url=repo.spring.io/release",
|
||||
+ "canonical_purl": "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?extension=pom&repository_url=repo.spring.io%2Frelease",
|
||||
"type": "maven",
|
||||
"namespace": "org.apache.xmlgraphics",
|
||||
"name": "batik-anim",
|
||||
diff --git a/tests/test_packageurl.py b/tests/test_packageurl.py
|
||||
index 2c36549..6cb7362 100644
|
||||
--- a/tests/test_packageurl.py
|
||||
+++ b/tests/test_packageurl.py
|
||||
@@ -147,7 +147,7 @@ def build_tests(clazz=PurlTest, test_file="test-suite-data.json"):
|
||||
class NormalizePurlTest(unittest.TestCase):
|
||||
def test_normalize_qualifiers_as_string(self):
|
||||
qualifiers_as_dict = {"classifier": "sources", "repository_url": "repo.spring.io/release"}
|
||||
- qualifiers_as_string = "classifier=sources&repository_url=repo.spring.io/release"
|
||||
+ qualifiers_as_string = "classifier=sources&repository_url=repo.spring.io%2Frelease"
|
||||
assert qualifiers_as_string == normalize_qualifiers(qualifiers_as_dict, encode=True)
|
||||
|
||||
def test_normalize_qualifiers_as_dict(self):
|
||||
@@ -156,7 +156,7 @@ def test_normalize_qualifiers_as_dict(self):
|
||||
assert qualifiers_as_dict == normalize_qualifiers(qualifiers_as_string, encode=False)
|
||||
|
||||
def test_create_PackageURL_from_qualifiers_string(self):
|
||||
- canonical_purl = "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?classifier=sources&repository_url=repo.spring.io/release"
|
||||
+ canonical_purl = "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?classifier=sources&repository_url=repo.spring.io%2Frelease"
|
||||
type = "maven" # NOQA
|
||||
namespace = "org.apache.xmlgraphics"
|
||||
name = "batik-anim"
|
||||
@@ -168,7 +168,7 @@ def test_create_PackageURL_from_qualifiers_string(self):
|
||||
assert canonical_purl == purl.to_string()
|
||||
|
||||
def test_create_PackageURL_from_qualifiers_dict(self):
|
||||
- canonical_purl = "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?classifier=sources&repository_url=repo.spring.io/release"
|
||||
+ canonical_purl = "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?classifier=sources&repository_url=repo.spring.io%2Frelease"
|
||||
type = "maven" # NOQA
|
||||
namespace = "org.apache.xmlgraphics"
|
||||
name = "batik-anim"
|
||||
@@ -191,14 +191,14 @@ def test_normalize_encode_can_take_unicode_with_non_ascii_with_slash(self):
|
||||
encode=True,
|
||||
)
|
||||
expected = (
|
||||
- "n%c3%bacleo/n%c3%bacleo",
|
||||
- "n%C3%BAcleo/n%C3%BAcleo",
|
||||
+ "n%c3%bacleo%2fn%c3%bacleo",
|
||||
"n%C3%BAcleo/n%C3%BAcleo",
|
||||
- "n%C3%BAcleo/n%C3%BAcleo",
|
||||
- "a=n%C3%BAcleo/n%C3%BAcleo",
|
||||
+ "n%C3%BAcleo%2Fn%C3%BAcleo",
|
||||
+ "n%C3%BAcleo%2Fn%C3%BAcleo",
|
||||
+ "a=n%C3%BAcleo%2Fn%C3%BAcleo",
|
||||
"n%C3%BAcleo/n%C3%BAcleo",
|
||||
)
|
||||
- assert expected == normal
|
||||
+ assert expected == normal, normal
|
||||
|
||||
def test_normalize_decode_can_take_unicode_with_non_ascii_with_slash(self):
|
||||
uncd = "núcleo/núcleo"
|
||||
@@ -233,14 +233,14 @@ def test_normalize_encode_always_reencodes(self):
|
||||
encode=True,
|
||||
)
|
||||
expected = (
|
||||
+ "n%25c3%25bacleo%2fn%25c3%25bacleo",
|
||||
"n%25c3%25bacleo/n%25c3%25bacleo",
|
||||
- "n%25c3%25bacleo/n%25c3%25bacleo",
|
||||
- "n%25c3%25bacleo/n%25c3%25bacleo",
|
||||
- "n%25c3%25bacleo/n%25c3%25bacleo",
|
||||
- "a=n%25c3%25bacleo/n%25c3%25bacleo",
|
||||
+ "n%25c3%25bacleo%2Fn%25c3%25bacleo",
|
||||
+ "n%25c3%25bacleo%2Fn%25c3%25bacleo",
|
||||
+ "a=n%25c3%25bacleo%2Fn%25c3%25bacleo",
|
||||
"n%25c3%25bacleo/n%25c3%25bacleo",
|
||||
)
|
||||
- assert expected == normal
|
||||
+ assert expected == normal, normal
|
||||
|
||||
def test_qualifiers_must_be_key_value_pairs(self):
|
||||
purl = "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?this+is+not+a+key_value"
|
||||
|
||||
+30
-10
@@ -3,25 +3,39 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYPI_PN="packageurl-python"
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{13..15} )
|
||||
|
||||
inherit distutils-r1 pypi optfeature
|
||||
inherit distutils-r1 optfeature
|
||||
|
||||
PURL_SPEC_PV="1.0.0"
|
||||
DESCRIPTION="Python library to parse and build “purl” aka. Package URLs"
|
||||
HOMEPAGE="
|
||||
https://github.com/package-url/purl-spec
|
||||
https://pypi.org/project/packageurl-python/
|
||||
HOMEPAGE="https://packageurl.org/"
|
||||
SRC_URI="
|
||||
https://github.com/package-url/${PN}-python/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
|
||||
test? (
|
||||
https://github.com/package-url/purl-spec/archive/v${PURL_SPEC_PV}.tar.gz -> purl-spec-${PURL_SPEC_PV}.gh.tar.gz
|
||||
)
|
||||
"
|
||||
|
||||
S="${WORKDIR}/${PN}-python-${PV}"
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
# PYPI version does not provied required
|
||||
# specification json.
|
||||
RESTRICT="test"
|
||||
BDEPEND="
|
||||
test? (
|
||||
dev-python/pydantic[${PYTHON_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/safe-for-percent-encoding.patch"
|
||||
"${FILESDIR}/spec-tests.patch"
|
||||
)
|
||||
|
||||
EPYTEST_PLUGINS=( )
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
src_prepare() {
|
||||
# Remove deprecated license classifier
|
||||
@@ -37,7 +51,13 @@ src_prepare() {
|
||||
setup.cfg \
|
||||
|| die "Failed to fix license list"
|
||||
|
||||
eapply_user
|
||||
# Use purl-spec tests
|
||||
if use test; then
|
||||
rmdir spec || die
|
||||
mv "${WORKDIR}"/purl-spec-"${PURL_SPEC_PV}" spec || die
|
||||
fi
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
Reference in new issue
Block a user