aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroki Tagato <tagattie@FreeBSD.org>2023-04-02 06:23:12 +0000
committerHiroki Tagato <tagattie@FreeBSD.org>2023-04-02 06:25:08 +0000
commitc881e82101784ab6b0ee63de2485eb90fd37570f (patch)
tree7ed793d2eba6c42cc4c606ae4d99f7089ce250b4
parentfde810e393d969970f6d603cca616d84d8dad3e2 (diff)
downloadports-c881e82101784ab6b0ee63de2485eb90fd37570f.tar.gz
ports-c881e82101784ab6b0ee63de2485eb90fd37570f.zip
misc/py-shell-gpt: don't install test files
py-shell-gpt and py-notus-scanner both try to install test files to a generic location (/usr/local/lib/python3.9/site-packages/tests). py-shell-gtp does not require test files for normal operations, so avoid collision by not installing test files. PR: 270542 Reported by: John Hein <jcfyecrayz@liamekaens.com>
-rw-r--r--misc/py-shell-gpt/Makefile9
-rw-r--r--misc/py-shell-gpt/files/patch-shell__gpt.egg-info_SOURCES.txt10
2 files changed, 18 insertions, 1 deletions
diff --git a/misc/py-shell-gpt/Makefile b/misc/py-shell-gpt/Makefile
index 8331ba46c8c4..0032fccf71d5 100644
--- a/misc/py-shell-gpt/Makefile
+++ b/misc/py-shell-gpt/Makefile
@@ -1,5 +1,6 @@
PORTNAME= shell-gpt
DISTVERSION= 0.8.1
+PORTREVISION= 1
CATEGORIES= misc python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -24,8 +25,14 @@ USE_PYTHON= autoplist distutils pytest
BINARY_ALIAS= python=${PYTHON_CMD}
NO_ARCH= yes
+post-extract:
+ @${RM} ${WRKSRC}/tests/__init__.py
+
+post-patch:
+ @${FIND} ${WRKSRC} -type f -name '*.orig' -delete
+
do-test:
- cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} tests/unittests.py
+ cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m unittest tests/unittests.py
cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest tests/integrational_tests.py
.include <bsd.port.mk>
diff --git a/misc/py-shell-gpt/files/patch-shell__gpt.egg-info_SOURCES.txt b/misc/py-shell-gpt/files/patch-shell__gpt.egg-info_SOURCES.txt
new file mode 100644
index 000000000000..8afe86591b47
--- /dev/null
+++ b/misc/py-shell-gpt/files/patch-shell__gpt.egg-info_SOURCES.txt
@@ -0,0 +1,10 @@
+--- shell_gpt.egg-info/SOURCES.txt.orig 2023-04-02 05:52:27 UTC
++++ shell_gpt.egg-info/SOURCES.txt
+@@ -15,6 +15,3 @@ shell_gpt.egg-info/dependency_links.txt
+ shell_gpt.egg-info/entry_points.txt
+ shell_gpt.egg-info/requires.txt
+ shell_gpt.egg-info/top_level.txt
+-tests/__init__.py
+-tests/integrational_tests.py
+-tests/unittests.py
+\ No newline at end of file