Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Copier will prompt for:
| `author_name` | Author full name | `Alex Shalaev` |
| `author_email` | Author email | `you@example.com` |
| `github_org` | GitHub org or username | `bedrock-python` |
| `python_min_version` | Minimum Python version | `3.11` |
| `python_min_version` | Minimum Python version, 3.10 to 3.14. The unit-test matrix and the classifiers run from it to the newest version (`python_max_version` in `copier.yml`) | `3.11` |
| `initial_version` | Initial version | `0.0.0` |

## After generation
Expand Down
15 changes: 14 additions & 1 deletion copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,23 @@ github_org:
help: "GitHub organization or username"
default: "bedrock-python"

# The newest Python a render declares and runs its unit tests on. Not asked:
# raise it here once the libraries move to a new release.
python_max_version:
type: str
default: "3.14"
when: false

python_min_version:
type: str
help: "Minimum Python version"
help: "Minimum Python version (3.10 to {{ python_max_version }})"
default: "3.11"
validator: >-
{%- set minor = python_min_version.split(".")[-1] -%}
{%- if not python_min_version.startswith("3.") or not minor.isdigit()
or minor | int < 10 or minor | int > python_max_version.split(".")[-1] | int -%}
Use a 3.x version from 3.10 to {{ python_max_version }}
{%- endif -%}

initial_version:
type: str
Expand Down
4 changes: 2 additions & 2 deletions template/.github/workflows/ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["{{ python_min_version }}", "3.12", "3.13"]
python-version: [{% for minor in range(python_min_version.split(".")[1] | int, python_max_version.split(".")[1] | int + 1) %}"3.{{ minor }}"{{ ", " if not loop.last }}{% endfor %}]
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v7
Expand All @@ -34,7 +34,7 @@ jobs:
- run: uv sync --group dev --all-extras
- run: uv run pytest -m unit --cov={{ package_name }} --cov-report=xml --cov-fail-under=90
- uses: codecov/codecov-action@v6
if: matrix.python-version == '3.12'
if: matrix.python-version == '{{ python_max_version }}'
with:
token: ${% raw %}{{ secrets.CODECOV_TOKEN }}{% endraw %}
files: coverage.xml
Expand Down
4 changes: 3 additions & 1 deletion template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: {{ python_min_version }}",
{%- for minor in range(python_min_version.split(".")[1] | int, python_max_version.split(".")[1] | int + 1) %}
"Programming Language :: Python :: 3.{{ minor }}",
{%- endfor %}
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
Expand Down
Loading