pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-pip-audit: improve



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <tk%giga.or.at@localhost>
Pushed By:	wiz
Date:		Tue Nov 9 22:49:39 2021 +0100
Changeset:	680c2da132404827a0c417e34292a86f9617de76

Modified Files:
	py-pip-audit/Makefile
	py-pip-audit/distinfo
	py-pip-audit/patches/patch-setup.py
Added Files:
	py-pip-audit/patches/patch-pip__audit_service_pypi.py

Log Message:
py-pip-audit: improve

Use github tarball, it includes all needed test files.
Update test status.
Fix for python 3.6.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=680c2da132404827a0c417e34292a86f9617de76

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-pip-audit/Makefile                              | 23 ++++++++++++++++------
 py-pip-audit/distinfo                              |  9 +++++----
 .../patches/patch-pip__audit_service_pypi.py       | 16 +++++++++++++++
 py-pip-audit/patches/patch-setup.py                | 11 +++++++----
 4 files changed, 45 insertions(+), 14 deletions(-)

diffs:
diff --git a/py-pip-audit/Makefile b/py-pip-audit/Makefile
index ecc245ebb1..09df1560c5 100644
--- a/py-pip-audit/Makefile
+++ b/py-pip-audit/Makefile
@@ -3,7 +3,11 @@
 DISTNAME=	pip-audit-0.0.4
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=	security python
-MASTER_SITES=	${MASTER_SITE_PYPI:=p/pip-audit/}
+# pypi file does not include tests
+#MASTER_SITES=	${MASTER_SITE_PYPI:=p/pip-audit/}
+MASTER_SITES=	${MASTER_SITE_GITHUB:=trailofbits/}
+GITHUB_PROJECT=	pip-audit
+GITHUB_TAG=	v${PKGVERSION_NOREV}
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=	https://pypi.org/project/pip-audit/
@@ -20,19 +24,26 @@ DEPENDS+=	${PYPKGPREFIX}-resolvelib>=0.8.0:../../wip/py-resolvelib
 TEST_DEPENDS+=	${PYPKGPREFIX}-pretend-[0-9]*:../../devel/py-pretend
 TEST_DEPENDS+=	${PYPKGPREFIX}-test-[0-9]*:../../devel/py-test
 
-USE_LANGUAGES=	# none
+PYTHON_VERSIONS_INCOMPATIBLE=	27
+
+.include "../../lang/python/pyversion.mk"
 
-PYTHON_VERSIONS_INCOMPATIBLE=	27 36
+.if ${_PYTHON_VERSION} == 36
+DEPENDS+=	${PYPKGPREFIX}-dataclasses>=0.6:../../devel/py-dataclasses
+.endif
+
+USE_LANGUAGES=	# none
 
 post-install:
 	cd ${DESTDIR}${PREFIX}/bin && \
         ${MV} pip-audit pip-audit-${PYVERSSUFFIX} || ${TRUE}
 
-# needs package installed
-# 2 test failures as of 0.0.4:
+# as of 0.0.4
+# 2 failed, 46 passed
 # https://github.com/trailofbits/pip-audit/issues/115
+TEST_ENV+=	PYTHONPATH=${WRKSRC}/build/lib:${WRKSRC}/build/lib/test
 do-test:
-	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} pytest-${PYVERSSUFFIX}
+	cd ${WRKSRC} && ${SETENV} ${TEST_ENV} pytest-${PYVERSSUFFIX}
 
 .include "../../lang/python/egg.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/py-pip-audit/distinfo b/py-pip-audit/distinfo
index ec9b375f58..c053b6e8fe 100644
--- a/py-pip-audit/distinfo
+++ b/py-pip-audit/distinfo
@@ -1,6 +1,7 @@
 $NetBSD: distinfo,v 1.40 2021/10/26 10:18:45 nia Exp $
 
-BLAKE2s (pip-audit-0.0.4.tar.gz) = 00f5e7539b10ae2659cdc9a2f4b91b5d4612ab1be2fa40dd70d3da748b93ee3e
-SHA512 (pip-audit-0.0.4.tar.gz) = e314caff5841b2595d4de61f7865794fd6fe6bc623badc0201f553404c64c6d51f6fe52effe68b3e317965e1d3658a78555dc0556e3410f13b7c2d962263bfa1
-Size (pip-audit-0.0.4.tar.gz) = 26124 bytes
-SHA1 (patch-setup.py) = 1808507d47b7d95d772636ab2db8bde54224b5b8
+BLAKE2s (pip-audit-0.0.4.tar.gz) = 07e726eb27ca453638d64a84490a1a4fc934e819868c1fb50bd0a3bd2c023174
+SHA512 (pip-audit-0.0.4.tar.gz) = 3192547e0c7bccda1c69ff20d7a23175f29260a05d882769f474577485da086f98dbe05af5c3e8c3eaed9b033cb251315832b84ed864986183fae8e157006bda
+Size (pip-audit-0.0.4.tar.gz) = 31496 bytes
+SHA1 (patch-pip__audit_service_pypi.py) = e9d290bd6b318e1ce0850b9e8de397b5da771620
+SHA1 (patch-setup.py) = af06b6796795e581e23fa0d89aa2d77e0832e784
diff --git a/py-pip-audit/patches/patch-pip__audit_service_pypi.py b/py-pip-audit/patches/patch-pip__audit_service_pypi.py
new file mode 100644
index 0000000000..0d826de2fb
--- /dev/null
+++ b/py-pip-audit/patches/patch-pip__audit_service_pypi.py
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Adapt for CacheControl 0.12.10.
+https://github.com/trailofbits/pip-audit/commit/185c7a27ee40bfe333b95deeb71f937680d8ed8c
+
+--- pip_audit/service/pypi.py.orig	2021-11-09 16:12:41.000000000 +0000
++++ pip_audit/service/pypi.py
+@@ -44,7 +44,7 @@ class _SafeFileCache(FileCache):
+                 self._logged_warning = True
+             return None
+ 
+-    def set(self, key: str, value: bytes) -> None:
++    def set(self, key: str, value: bytes, expires: Optional[Any] = None) -> None:
+         try:
+             self._set_impl(key, value)
+         except Exception as e:  # pragma: no cover
diff --git a/py-pip-audit/patches/patch-setup.py b/py-pip-audit/patches/patch-setup.py
index 016712706a..7e580461d5 100644
--- a/py-pip-audit/patches/patch-setup.py
+++ b/py-pip-audit/patches/patch-setup.py
@@ -1,16 +1,19 @@
 $NetBSD$
 
-Do not insist on one particular version.
-Remove python 3.6-only dependency.
+Fix dataclasses dependency
+https://github.com/trailofbits/pip-audit/pull/114/files
+
+Do not insist on one particular version of CacheControl.
 
 --- setup.py.orig	2021-11-09 16:12:41.000000000 +0000
 +++ setup.py
-@@ -30,12 +30,10 @@ setup(
+@@ -30,12 +30,12 @@ setup(
      install_requires=[
          "pip-api>=0.0.23",
          "packaging>=21.0.0",
--        # TODO: Remove this once 3.7 is our minimally supported version.
+         # TODO: Remove this once 3.7 is our minimally supported version.
 -        "dataclasses>=0.6",
++        "dataclasses>=0.6; python_version < '3.7'",
          "progress>=1.6",
          "resolvelib>=0.8.0",
          "html5lib>=1.1",


Home | Main Index | Thread Index | Old Index