Skip to content

Commit 05dea9d

Browse files
authored
Merge pull request #16 from smkent/dev
Add conditionally rendered project badges to template README.md
2 parents 2caedce + c0f3860 commit 05dea9d

15 files changed

Lines changed: 336 additions & 10 deletions

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [Cookiecutter][cookiecutter] template for new Python projects
22

3-
[![coookie-python][logo]](#)
3+
[![cookie-python][logo]](#)
44

55
A template for new Python projects, with:
66

@@ -28,6 +28,8 @@ Prerequisites: [Poetry][poetry]
2828
* Setup: `poetry install`
2929
* Test template rendering and run rendered project tests: `poetry run poe test`
3030
* Fix linting errors: `poetry run poe lint`
31+
* Update test expected output files from test results:
32+
`poetry run poe updatetests`
3133

3234
[cookiecutter]: https://github.com/cookiecutter/cookiecutter
3335
[logo]: https://raw.github.com/smkent/cookie-python/master/img/cookie-python.png

cookiecutter.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"author_name": "",
3-
"author_email": "",
42
"project_name": "",
53
"project_slug": "{{ cookiecutter.project_name|lower|replace('-', '_') }}",
64
"project_description": "",
@@ -13,5 +11,8 @@
1311
"MIT"
1412
],
1513
"enable_coverage": "yes",
16-
"enable_pypi_publish": "no"
14+
"enable_pypi_publish": "no",
15+
"author_name": "",
16+
"author_email": "",
17+
"github_user": ""
1718
}

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ flake8 = { cmd = "flake8" }
5959
mypy = { cmd = "mypy" }
6060
pytest = { cmd = "pytest" }
6161

62+
updatetests = { cmd = "pytest --update-expected-outputs" }
63+
6264
[tool.isort]
6365
atomic = true
6466
profile = "black"

tests/conftest.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pytest
2+
3+
4+
def pytest_addoption(parser: pytest.Parser) -> None:
5+
group = parser.getgroup("cookie", "python-cookie test helpers")
6+
group.addoption(
7+
"--update-expected-outputs",
8+
action="store_true",
9+
dest="update_expected_outputs",
10+
help="Update expected test data with generated results",
11+
)
12+
13+
14+
@pytest.fixture
15+
def opt_update_expected_outputs(request: pytest.FixtureRequest) -> bool:
16+
value = request.config.getoption("--update-expected-outputs")
17+
assert isinstance(value, bool)
18+
return value
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# test-baked-cookie: This is a test project called "test-baked-cookie"
2+
3+
[![Build](https://img.shields.io/github/checks-status/ness/test-baked-cookie/master?label=build)][gh-actions]
4+
[![GitHub stars](https://img.shields.io/github/stars/ness/test-baked-cookie?style=social)][repo]
5+
6+
## Development
7+
8+
Prerequisites: [Poetry][poetry]
9+
10+
* Setup: `poetry install`
11+
* Run all tests: `poetry run poe test`
12+
* Fix linting errors: `poetry run poe lint`
13+
14+
---
15+
16+
Created from [smkent/cookie-python][cookie-python] using
17+
[cookiecutter][cookiecutter]
18+
19+
[cookie-python]: https://github.com/smkent/cookie-python
20+
[cookiecutter]: https://github.com/cookiecutter/cookiecutter
21+
[gh-actions]: https://github.com/ness/test-baked-cookie/actions?query=branch%3Amaster
22+
[poetry]: https://python-poetry.org/docs/#installation
23+
[repo]: https://github.com/ness/test-baked-cookie
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# test-baked-cookie: This is a test project called "test-baked-cookie"
2+
3+
[![Build](https://img.shields.io/github/checks-status/ness/test-baked-cookie/master?label=build)][gh-actions]
4+
[![codecov](https://codecov.io/gh/ness/test-baked-cookie/branch/master/graph/badge.svg)][codecov]
5+
[![GitHub stars](https://img.shields.io/github/stars/ness/test-baked-cookie?style=social)][repo]
6+
7+
## Development
8+
9+
Prerequisites: [Poetry][poetry]
10+
11+
* Setup: `poetry install`
12+
* Run all tests: `poetry run poe test`
13+
* Fix linting errors: `poetry run poe lint`
14+
15+
---
16+
17+
Created from [smkent/cookie-python][cookie-python] using
18+
[cookiecutter][cookiecutter]
19+
20+
[codecov]: https://codecov.io/gh/ness/test-baked-cookie
21+
[cookie-python]: https://github.com/smkent/cookie-python
22+
[cookiecutter]: https://github.com/cookiecutter/cookiecutter
23+
[gh-actions]: https://github.com/ness/test-baked-cookie/actions?query=branch%3Amaster
24+
[poetry]: https://python-poetry.org/docs/#installation
25+
[repo]: https://github.com/ness/test-baked-cookie
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# test-baked-cookie: This is a test project called "test-baked-cookie"
2+
3+
[![PyPI](https://img.shields.io/pypi/v/test-baked-cookie)][pypi]
4+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/test-baked-cookie)][pypi]
5+
[![Build](https://img.shields.io/github/checks-status/ness/test-baked-cookie/master?label=build)][gh-actions]
6+
[![codecov](https://codecov.io/gh/ness/test-baked-cookie/branch/master/graph/badge.svg)][codecov]
7+
[![GitHub stars](https://img.shields.io/github/stars/ness/test-baked-cookie?style=social)][repo]
8+
9+
## Development
10+
11+
Prerequisites: [Poetry][poetry]
12+
13+
* Setup: `poetry install`
14+
* Run all tests: `poetry run poe test`
15+
* Fix linting errors: `poetry run poe lint`
16+
17+
---
18+
19+
Created from [smkent/cookie-python][cookie-python] using
20+
[cookiecutter][cookiecutter]
21+
22+
[codecov]: https://codecov.io/gh/ness/test-baked-cookie
23+
[cookie-python]: https://github.com/smkent/cookie-python
24+
[cookiecutter]: https://github.com/cookiecutter/cookiecutter
25+
[gh-actions]: https://github.com/ness/test-baked-cookie/actions?query=branch%3Amaster
26+
[poetry]: https://python-poetry.org/docs/#installation
27+
[pypi]: https://pypi.org/project/test-baked-cookie/
28+
[repo]: https://github.com/ness/test-baked-cookie
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# test-baked-cookie: This is a test project called "test-baked-cookie"
2+
3+
[![PyPI](https://img.shields.io/pypi/v/test-baked-cookie)][pypi]
4+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/test-baked-cookie)][pypi]
5+
[![Build](https://img.shields.io/github/checks-status/ness/test-baked-cookie/master?label=build)][gh-actions]
6+
[![GitHub stars](https://img.shields.io/github/stars/ness/test-baked-cookie?style=social)][repo]
7+
8+
## Development
9+
10+
Prerequisites: [Poetry][poetry]
11+
12+
* Setup: `poetry install`
13+
* Run all tests: `poetry run poe test`
14+
* Fix linting errors: `poetry run poe lint`
15+
16+
---
17+
18+
Created from [smkent/cookie-python][cookie-python] using
19+
[cookiecutter][cookiecutter]
20+
21+
[cookie-python]: https://github.com/smkent/cookie-python
22+
[cookiecutter]: https://github.com/cookiecutter/cookiecutter
23+
[gh-actions]: https://github.com/ness/test-baked-cookie/actions?query=branch%3Amaster
24+
[poetry]: https://python-poetry.org/docs/#installation
25+
[pypi]: https://pypi.org/project/test-baked-cookie/
26+
[repo]: https://github.com/ness/test-baked-cookie
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# test-baked-cookie: This is a test project called "test-baked-cookie"
2+
3+
## Development
4+
5+
Prerequisites: [Poetry][poetry]
6+
7+
* Setup: `poetry install`
8+
* Run all tests: `poetry run poe test`
9+
* Fix linting errors: `poetry run poe lint`
10+
11+
---
12+
13+
Created from [smkent/cookie-python][cookie-python] using
14+
[cookiecutter][cookiecutter]
15+
16+
[cookie-python]: https://github.com/smkent/cookie-python
17+
[cookiecutter]: https://github.com/cookiecutter/cookiecutter
18+
[poetry]: https://python-poetry.org/docs/#installation
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# test-baked-cookie: This is a test project called "test-baked-cookie"
2+
3+
## Development
4+
5+
Prerequisites: [Poetry][poetry]
6+
7+
* Setup: `poetry install`
8+
* Run all tests: `poetry run poe test`
9+
* Fix linting errors: `poetry run poe lint`
10+
11+
---
12+
13+
Created from [smkent/cookie-python][cookie-python] using
14+
[cookiecutter][cookiecutter]
15+
16+
[cookie-python]: https://github.com/smkent/cookie-python
17+
[cookiecutter]: https://github.com/cookiecutter/cookiecutter
18+
[poetry]: https://python-poetry.org/docs/#installation

0 commit comments

Comments
 (0)