Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2023 14:27:27 GMT
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 126112cfe799 - main - devel/py-cookiecutter: switch to USE_PYTHON=pytest
Message-ID:  <202306081427.358ERRTb051070@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by matthew:

URL: https://cgit.FreeBSD.org/ports/commit/?id=126112cfe799f8a1597b5a2e2cdfbdc5af9895fb

commit 126112cfe799f8a1597b5a2e2cdfbdc5af9895fb
Author:     Matthew Seaman <matthew@FreeBSD.org>
AuthorDate: 2023-06-08 14:21:41 +0000
Commit:     Matthew Seaman <matthew@FreeBSD.org>
CommitDate: 2023-06-08 14:27:24 +0000

    devel/py-cookiecutter: switch to USE_PYTHON=pytest
    
    Use the standard pytest setup.  Disable one windows specific test
    
    While here, allow py311 flavor.  Upstream has not specified 3.11 as
    supported, but there hasn't been any significant development on this
    module since before python-3.11 was released, and the code runs just
    fine.  This means that a py311 flavour of molecule should now be
    available.
    
    No portrevision bump, as this just adds a new flavour; existing
    flavours are unchanged.
---
 devel/py-cookiecutter/Makefile                         | 13 ++++++-------
 devel/py-cookiecutter/files/patch-tests_test__hooks.py | 15 ++++++++++++---
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/devel/py-cookiecutter/Makefile b/devel/py-cookiecutter/Makefile
index 8b62d3a08a1a..d34217ea6c4a 100644
--- a/devel/py-cookiecutter/Makefile
+++ b/devel/py-cookiecutter/Makefile
@@ -25,8 +25,8 @@ TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}freezegun>0:devel/py-freezegun@${PY_FLAVOR}
 		${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \
 		git:devel/git
 
-USES=		cpe python:3.7-3.10
-USE_PYTHON=	autoplist concurrent distutils
+USES=		cpe python:3.7+
+USE_PYTHON=	autoplist concurrent distutils pytest
 
 CPE_VENDOR=	cookiecutter_project
 
@@ -36,12 +36,11 @@ NO_ARCH=	yes
 # ${WRKDIR} unless told not to.
 
 TEST_ENV=	HOME=${WRKDIR} \
-		LANG=en_US.UTF-8 \
-		LC_ALL=en_US.UTF-8 \
+		LANG=C.UTF-8 \
+		LC_ALL=C.UTF-8 \
 		TMPDIR=${WRKDIR}
 
-do-test:
-	@cd ${WRKSRC} && \
-	${SETENV} ${TEST_ENV} ${LOCALBASE}/bin/pytest-${PYTHON_VER} --cov=cookiecutter tests
+# Windows specific test
+PYTEST_IGNORED_TESTS= test_run_shell_hooks_win
 
 .include <bsd.port.mk>
diff --git a/devel/py-cookiecutter/files/patch-tests_test__hooks.py b/devel/py-cookiecutter/files/patch-tests_test__hooks.py
index bf62c10a3f07..ff6757438157 100644
--- a/devel/py-cookiecutter/files/patch-tests_test__hooks.py
+++ b/devel/py-cookiecutter/files/patch-tests_test__hooks.py
@@ -1,6 +1,6 @@
---- tests/test_hooks.py.orig	2020-12-28 09:57:55 UTC
+--- tests/test_hooks.py.orig	2022-06-01 17:00:44 UTC
 +++ tests/test_hooks.py
-@@ -42,7 +42,7 @@ def make_test_repo(name):
+@@ -41,7 +41,7 @@ def make_test_repo(name, multiple_hooks=False):
          post = 'post_gen_project.sh'
          filename = os.path.join(hook_dir, post)
          with open(filename, 'w') as f:
@@ -9,7 +9,16 @@
              f.write("\n")
              f.write("echo 'post generation hook';\n")
              f.write("touch 'shell_post.txt'\n")
-@@ -143,7 +143,7 @@ class TestExternalHooks(object):
+@@ -61,7 +61,7 @@ def make_test_repo(name, multiple_hooks=False):
+             pre = 'pre_gen_project.sh'
+             filename = os.path.join(hook_dir, pre)
+             with open(filename, 'w') as f:
+-                f.write("#!/bin/bash\n")
++                f.write("#!/bin/sh\n")
+                 f.write("\n")
+                 f.write("echo 'post generation hook';\n")
+                 f.write("touch 'shell_pre.txt'\n")
+@@ -189,7 +189,7 @@ class TestExternalHooks:
                  f.write("echo. >{{cookiecutter.file}}\n")
          else:
              with open(hook_path, 'w') as fh:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306081427.358ERRTb051070>