Skip to content
Open
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
3 changes: 1 addition & 2 deletions python-minimal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ This template is designed for simple data science project in Python.
It suggests a combination of notebooks and a module for shared utilities.
Development tools are kept to a minimum.

Python 3.10 is chosen as a minimum, as 3.9 will reach end-of-life in 2025 (cf. [Python Release Cycle](https://devguide.python.org/versions/#python-release-cycle)).
We recommend 3.11, as some packages may not fully support 3.12 yet.
Python 3.12 is chosen as a minimum, as 3.11 will reach end-of-life in 2027 (cf. [Python Release Cycle](https://devguide.python.org/versions/#python-release-cycle)).


## Dependencies and reproducibility
Expand Down
6 changes: 6 additions & 0 deletions python-minimal/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"__python_version": "3.12",
"__uv_version": "0.10.2",
"__pre_commit_version": "4.5",
"__ruff_version": "0.15.0",
"__pytest_version": "9.0",
"__notebook_version": "7.5",
"project_name": "Project",
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '-') }}",
"module_name": "{{ cookiecutter.project_slug.replace('-', '_') }}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["{{ cookiecutter.__python_version }}"]

steps:

Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt . pytest
pip install -r requirements.txt .
{%- if cookiecutter.use_ruff_format %}

- name: Check format with ruff
Expand Down
4 changes: 2 additions & 2 deletions python-minimal/{{cookiecutter.project_slug}}/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ stages:

run-tests:
stage: test
image: python:3.10
image: python:{{ cookiecutter.__python_version }}
before_script:
- pip install -r requirements.txt . pytest
- pip install -r requirements.txt .
script:
{%- if cookiecutter.use_ruff_format %}
- ruff format --check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: trailing-whitespace
{%- if cookiecutter.use_ruff_format or cookiecutter.use_ruff_lint %}
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.3
rev: v{{ cookiecutter.__ruff_version }}
hooks:
{%- if cookiecutter.use_ruff_lint %}
- id: ruff-check
Expand All @@ -29,7 +29,7 @@ repos:
{%- endif %}
{%- if cookiecutter.use_uv %}
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.26
rev: {{ cookiecutter.__uv_version }}
hooks:
- id: uv-lock
- id: uv-export
Expand All @@ -41,7 +41,7 @@ repos:
entry: uv pip compile pyproject.toml --group dev --universal --output-file requirements.txt --quiet --no-progress
language: python
additional_dependencies:
- uv==0.9.26
- uv=={{ cookiecutter.__uv_version }}
pass_filenames: false
files: ^pyproject\.toml$
{%- endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ cookiecutter.__python_version }}
12 changes: 6 additions & 6 deletions python-minimal/{{cookiecutter.project_slug}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ authors = [
]
description = ""
readme = "README.md"
requires-python = ">=3.10"
requires-python = "~={{ cookiecutter.__python_version }}"
dependencies = [
# TODO configure install dependencies
]
dynamic = ["version"]

[dependency-groups]
dev = [
"notebook~=7.4",
"pre-commit~=4.2",
"notebook~={{ cookiecutter.__notebook_version }}",
"pre-commit~={{ cookiecutter.__pre_commit_version }}",
{%- if cookiecutter.use_pytest %}
"pytest~=8.4",
"pytest~={{ cookiecutter.__pytest_version }}",
{%- endif %}
{%- if cookiecutter.use_ruff_format or cookiecutter.use_ruff_lint %}
"ruff==0.12.3",
"ruff=={{ cookiecutter.__ruff_version }}",
{%- endif %}
]

Expand All @@ -34,7 +34,7 @@ version = {attr = "{{ cookiecutter.module_name }}.__version__"}
{%- if cookiecutter.use_ruff_format or cookiecutter.use_ruff_lint %}

[tool.ruff]
target-version = "py310"
target-version = "py{{ cookiecutter.__python_version.replace(".", "") }}"
line-length = 88
{%- if cookiecutter.use_ruff_lint %}

Expand Down