Skip to content

Commit

Permalink
Merge pull request #12 from beam-pyio/feature/update-template
Browse files Browse the repository at this point in the history
Update template configurations
  • Loading branch information
jaehyeon-kim authored Jun 30, 2024
2 parents 5a46321 + ea5b73f commit 8758bb3
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
![doc](https://github.com/beam-pyio/pyio-cookiecutter/workflows/doc/badge.svg)
![test](https://github.com/beam-pyio/pyio-cookiecutter/workflows/test/badge.svg)
[![release](https://img.shields.io/github/release/beam-pyio/pyio-cookiecutter.svg)](https://github.com/beam-pyio/pyio-cookiecutter/releases)
[![python](https://img.shields.io/badge/python-3.8%2C%203.9%2C%203.10%2C%203.11-blue)]()
[![os](https://img.shields.io/badge/OS-Ubuntu%2C%20Mac%2C%20Windows-purple)]()
![python](https://img.shields.io/badge/python-3.8%2C%203.9%2C%203.10%2C%203.11%2C%203.12-blue)
![os](https://img.shields.io/badge/OS-Ubuntu%2C%20Mac%2C%20Windows-purple)

<p align="center">
<img src="docs/source/_static/logo.png" width="220" alt="pyio-cookiecutter logo">
Expand Down
16 changes: 8 additions & 8 deletions hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import sys

from pkg_resources import (
get_distribution,
packaging,
)

MIN_CC_VERSION = "2.0.0"

try:
import cookiecutter # type: ignore
except ImportError:
print(f"ERROR: please install cookiecutter >= {MIN_CC_VERSION}")
sys.exit(1)

cc_version = cookiecutter.__version__
# assert cookiecutter >= 2.0.0
cc_version = packaging.version.parse(get_distribution("cookiecutter").version)
min_version = packaging.version.parse(MIN_CC_VERSION)
if cc_version < min_version:
if cc_version < MIN_CC_VERSION:
print(
f"ERROR: please install cookiecutter >= {MIN_CC_VERSION} (current "
f"version is {cc_version}):\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout code
Expand Down
6 changes: 6 additions & 0 deletions {{ cookiecutter.__package_slug }}/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# {{ cookiecutter.__package_slug }}

![doc](https://github.com/beam-pyio/{{ cookiecutter.__package_slug }}/workflows/doc/badge.svg)
![test](https://github.com/beam-pyio/{{ cookiecutter.__package_slug }}/workflows/test/badge.svg)
[![release](https://img.shields.io/github/release/beam-pyio/{{ cookiecutter.__package_slug }}.svg)](https://github.com/beam-pyio/{{ cookiecutter.__package_slug }}/releases)
![python](https://img.shields.io/badge/python-3.8%2C%203.9%2C%203.10%2C%203.11%2C%203.12-blue)
![os](https://img.shields.io/badge/OS-Ubuntu%2C%20Mac%2C%20Windows-purple)

{{ cookiecutter.package_short_description }}

## Installation
Expand Down
3 changes: 2 additions & 1 deletion {{ cookiecutter.__package_slug }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8, <3.12"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]

[tool.semantic_release]
version_toml = [
"pyproject.toml:tool.poetry.version",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from {{ cookiecutter.__package_slug }} import {{ cookiecutter.__package_slug }}
from {{ cookiecutter.__package_slug }}.io import my_fn

def test_my_fn():
assert {{ cookiecutter.__package_slug }}.my_fn() == 1
assert my_fn() == 1

0 comments on commit 8758bb3

Please sign in to comment.