Skip to content

Commit 67aa94c

Browse files
committed
Fix cookiecutter variables v1.0
1 parent 63b89f3 commit 67aa94c

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"email": "nullhack@users.noreply.github.com",
44
"github_username": "nullhack",
55
"project_name": "My Python Project",
6-
"package_name": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
6+
"package_name": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_').replace('project', 'module') }}",
77
"module_name": "{{ cookiecutter.package_name.lower().replace(' ', '_').replace('-', '_').replace('package', 'module') }}",
88
"project_short_description": "Python Project with some awesome tools to quickstart any Python project.",
99
"version": "0.1.0",

{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[tool.poetry]
2-
name = "new_package"
3-
version = "0.1.0"
4-
description = ""
5-
authors = ["Eric Lopes <nullhack@users.noreply.github.com>"]
2+
name = "{{cookiecutter.full_name}}"
3+
version = "{{cookiecutter.version}}"
4+
description = "{{cookiecutter.project_short_description}}"
5+
authors = ["{{cookiecutter.full_name}} <{{cookiecutter.email}}>"]
66

77
[tool.poetry.dependencies]
88
python = "^3.9"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
22

3-
"""Public package docstring."""
3+
"""{{cookiecutter.project_short_description}}."""

{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/{{cookiecutter.module_name}}.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import logging
66
from numbers import Real
77

8-
# TODO(Author_Name): check how to write todos!
9-
# https://github.com/orsinium-labs/flake8-todos/issues/1337
8+
# TODO({{cookiecutter.full_name}}): Check how to write todos!
9+
# https://github.com/{{cookiecutter.github_name}}/{{cookiecutter.projec_name}}/issues/1337
1010

1111
logger = logging.getLogger("test")
1212
logger.info("This is a {word}", extra={"word": "Log"})

{{cookiecutter.project_name}}/tests/new_package_test.py renamed to {{cookiecutter.project_name}}/tests/{{cookiecutter.module_name}}_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import pytest
1919

20-
from new_package import new_module
20+
from {{cookiecutter.package_name}} import {{cookiecutter.module_name}} as m
2121

2222

2323
@pytest.mark.parametrize(
@@ -69,7 +69,7 @@ def test_divide_ok(a, b, expected):
6969
expected (Real): expected result.
7070
7171
"""
72-
assert new_module.Calculator.divide(a, b) == expected
72+
assert m.Calculator.divide(a, b) == expected
7373

7474

7575
@pytest.mark.parametrize(
@@ -92,4 +92,4 @@ def test_divide_error(a, b, expected):
9292
9393
"""
9494
with pytest.raises(expected):
95-
new_module.Calculator.divide(a, b)
95+
m.Calculator.divide(a, b)

0 commit comments

Comments
 (0)