Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump cookiecutter from 1.7.3 to 2.1.1 #606

Merged
merged 12 commits into from
Jun 14, 2022
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cookiecutter==1.7.3
cookiecutter==2.1.1
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-r base.txt
black==22.1.0
flake8==4.0.1
git+https://github.com/andriihomiak/pytest-cookies.git@fix/quotes_in_user_config # pytest-cookies==0.6.1
isort==5.10.1
mypy==0.961
pipx==1.1.0
pre-commit==2.19.0
PyGithub==1.55 # Bump also {{cookiecutter.project_dir}}/.github/workflows/update-neuro-flow-actions.yml:15
pytest==6.2.5
pytest-asyncio==0.18.3
pytest-cookies==0.6.1
git+https://github.com/man-group/pytest-plugins@c2bc068#egg=pytest-virtualenv&subdirectory=pytest-virtualenv
pytest-xdist==2.5.0
PyYAML==6.0
Expand Down
21 changes: 16 additions & 5 deletions tests/unit/test_bake_project.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import logging
import os
import subprocess
import sys
from pathlib import Path

import py
import pytest
import yaml
from cookiecutter.exceptions import FailedHookException
Expand All @@ -14,15 +14,19 @@
from tests.utils import inside_dir


logger = logging.getLogger(__name__)


def test_project_tree(cookies: Cookies) -> None:
result = cookies.bake(extra_context={"project_dir": "test-project"})
assert result.exit_code == 0
assert result.exception is None
assert result.exit_code == 0
assert result.project_path.name == "test-project"


def test_run_flake8(cookies: Cookies) -> None:
result = cookies.bake(extra_context={"project_dir": "flake8-compat"})
assert result.exception is None
with inside_dir(str(result.project_path)):
subprocess.check_call(["flake8"])

Expand Down Expand Up @@ -127,7 +131,7 @@ def test_project_description(cookies: Cookies) -> None:

@pytest.mark.parametrize("venv_install_packages", ["", "neuro-cli", "neuro-all"])
def test_user_role_added(
tmpdir: py.path.local, venv_install_packages: str, monkeypatch: pytest.MonkeyPatch
tmp_path: Path, venv_install_packages: str, monkeypatch: pytest.MonkeyPatch
) -> None:
cwd = Path(os.getcwd())

Expand All @@ -145,11 +149,18 @@ def test_user_role_added(
venv.install_package(venv_install_packages, installer="pip")

venv.run(
("cookiecutter", cwd, "-o", tmpdir, "--no-input", "--default-config"),
(
"cookiecutter",
cwd,
"-o",
str(tmp_path),
"--no-input",
"--default-config",
),
capture=True,
)
proj_yml = yaml.safe_load(
Path(tmpdir / "neuro project" / ".neuro" / "project.yml").read_text()
Path(tmp_path / "neuro project" / ".neuro" / "project.yml").read_text()
)

if venv_install_packages:
Expand Down