Skip to content

Commit

Permalink
misc/py-shell-gpt: don't install test files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tagattie committed Apr 2, 2023
1 parent fde810e commit c881e82
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 8 additions & 1 deletion misc/py-shell-gpt/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PORTNAME= shell-gpt
DISTVERSION= 0.8.1
PORTREVISION= 1
CATEGORIES= misc python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
Expand All @@ -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>
10 changes: 10 additions & 0 deletions misc/py-shell-gpt/files/patch-shell__gpt.egg-info_SOURCES.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c881e82

Please sign in to comment.