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 @@ -1,47 +1,46 @@ PORTNAME= cookiecutter PORTVERSION= 2.1.1 CATEGORIES= devel python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= matthew@FreeBSD.org COMMENT= Create projects from cookiecutters (project templates) WWW= https://pypi.org/project/cookiecutter/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}binaryornot>=0.4.4:devel/py-binaryornot@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}click>=7.0<9.0.0:devel/py-click@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}jinja2-time>=0.2.0:devel/py-jinja2-time@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}Jinja2>=2.7:devel/py-Jinja2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}poyo>=0:devel/py-poyo@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}python-slugify>=4.0.0:textproc/py-python-slugify@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}requests>=2.23.0:www/py-requests@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}yaml>=5.3.1:devel/py-yaml@${PY_FLAVOR} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}freezegun>0:devel/py-freezegun@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pytest-cov>0:devel/py-pytest-cov@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pytest-mock>0:devel/py-pytest-mock@${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 NO_ARCH= yes # pytest needs a UTF-8 environment, and it will try and write outside # ${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 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,20 +1,29 @@ ---- 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: - f.write("#!/bin/bash\n") + f.write("#!/bin/sh\n") 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: - fh.write("#!/bin/bash\n") + fh.write("#!/bin/sh\n") fh.write("\n") fh.write("echo 'post generation hook';\n") fh.write("touch 'shell_post.txt'\n")