Skip to content

Commit

Permalink
Bump cookiecutter from 1.7.3 to 2.1.1 (#606)
Browse files Browse the repository at this point in the history
* Bump cookiecutter from 1.7.3 to 2.1.1

Bumps [cookiecutter](https://github.com/cookiecutter/cookiecutter) from 1.7.3 to 2.1.1.
- [Release notes](https://github.com/cookiecutter/cookiecutter/releases)
- [Changelog](https://github.com/cookiecutter/cookiecutter/blob/master/HISTORY.md)
- [Commits](cookiecutter/cookiecutter@1.7.3...2.1.1)

---
updated-dependencies:
- dependency-name: cookiecutter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* test: Change order of returncode and exception test

* test: Intercept yaml parsing

* test: Add type: ignore

* test: Intercept yaml parsing

* test: Intercept yaml parsing

* test: Patch user config template

* test: Fix lint

* test: Patch user config template in every test

* test: Intercept yaml parsing

* test: Replace pytest-cookies with a fork

* test: Cleanup

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrii Khomiak <homiakandrii@gmail.com>
  • Loading branch information
dependabot[bot] and andriihomiak committed Jun 14, 2022
1 parent b21458d commit 4b67369
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
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

0 comments on commit 4b67369

Please sign in to comment.