Skip to content

Commit

Permalink
feat: upgrade repository to python3.13
Browse files Browse the repository at this point in the history
also update precommit hooks
  • Loading branch information
oedokumaci committed Jan 19, 2025
1 parent 1332528 commit 87c8ecf
Show file tree
Hide file tree
Showing 14 changed files with 751 additions and 439 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
uses: oedokumaci/oedokumaci/.github/workflows/quality.yml@main
with:
os_version: "ubuntu-latest"
python_version: "3.10"
python_version: "3.13"
9 changes: 4 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ jobs:
strategy:
matrix:
os_version:
- macos-latest
- windows-latest
- ubuntu-latest
- ubuntu-latest
- macos-latest
- windows-latest
python_version:
- "3.10"
- "3.11"
- "3.13"
uses: oedokumaci/oedokumaci/.github/workflows/tests.yml@main
with:
os_version: ${{ matrix.os_version }}
Expand Down
45 changes: 33 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
args:
- --max-line-length=88
- --select=C,E,F,W,B
- --extend-ignore=E203,E501,W503 # no select B950 for now and added W503 since it is incompatible with PEP8, rest is to be compatible with black, see https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length
- --extend-ignore=E203,E501,W503
# no select B950 for now and added W503 since it is incompatible with PEP8
# rest is to be compatible with black, see:
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length
additional_dependencies:
- flake8-bugbear

Expand All @@ -24,7 +27,7 @@ repos:
- --profile=black # to be compatible with black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: check-yaml
Expand All @@ -33,19 +36,19 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
exclude: ^config/

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py310-plus]
args: [--py313-plus]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.14.1
hooks:
- id: mypy
args:
Expand All @@ -60,17 +63,35 @@ repos:
- types-PyYAML

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
rev: 1.9.1
hooks:
- id: nbqa-black
# additional_dependencies: [jupytext] # optional, only if you're using Jupytext
- id: nbqa-pyupgrade
args: [--py310-plus]
args: [--py313-plus]
- id: nbqa-isort
args: [--float-to-top, --profile=black]
- id: nbqa-flake8
args:
- --max-line-length=88
- --select=C,E,F,W,B
- --extend-ignore=E203,E501,W503
additional_dependencies:
- flake8-bugbear
- id: nbqa-mypy
types_or: [jupyter]
args:
- --ignore-missing-imports
additional_dependencies:
- mypy
- pydantic
- pytest
- rich
- typer
- types-PyYAML

- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.8.1
hooks:
- id: nbstripout

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use an official Python runtime as a parent image
FROM python:3.10
FROM python:3.13

# Set the working directory in the container
WORKDIR /usr/src/app
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ ifeq ($(OS),Windows_NT)
else
@echo '{' > .vscode/settings.json
@echo ' "flake8.args": ["--max-line-length=88", "--select=C,E,F,W,B", "--extend-ignore=B009,E203,E501,W503"],' >> .vscode/settings.json
@echo ' "python.autoComplete.extraPaths": [".venv/lib/python3.10/site-packages"],' >> .vscode/settings.json
@echo ' "python.analysis.extraPaths": [".venv/lib/python3.10/site-packages"],' >> .vscode/settings.json
@echo ' "python.autoComplete.extraPaths": [".venv/lib/python3.13/site-packages"],' >> .vscode/settings.json
@echo ' "python.analysis.extraPaths": [".venv/lib/python3.13/site-packages"],' >> .vscode/settings.json
@echo ' "python.testing.pytestPath": ".venv/bin/pytest"' >> .vscode/settings.json
@echo '}' >> .vscode/settings.json
endif
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This is a template Python repository to start a fresh project with a default set

The project setup includes:

- Python >= 3.10
- Python >= 3.13
- Ubuntu, MacOS, Windows latest OS versions
- [PDM](https://pdm.fming.dev/latest/) for dependency management
- [GitHub Actions](https://github.com/features/actions) and [pre-commit](https://pre-commit.com/) for linting, formatting, CI/CD
Expand All @@ -26,9 +26,9 @@ The project setup includes:

# Getting Started

1. Install [Python](https://www.python.org/downloads/) 3.10 in your local machine. For MacOS use
1. Install [Python](https://www.python.org/downloads/) 3.13 in your local machine. For MacOS use
```zsh
brew install python@3.10
brew install python@3.13
```
2. Click on the `Use this template` button [at this page](https://github.com/oedokumaci/template-python) to create a new repository from this template (you must be logged in to GitHub to see the button).
3. Name your repository and click `Create repository from template`. If the repository name is more than one word, make sure to use -hyphens- instead of spaces or underscores.
Expand All @@ -49,7 +49,7 @@ python3 template_setup.py [--user-name YOUR_GIT_USER_NAME] [--user-email YOUR_GI
- Remove `README.md` and rename `README_main.md` to `README.md`
- If not installed pip install [PDM](https://pdm.fming.dev/latest/) in your local machine
- Update PDM to the latest version
- [PDM](https://pdm.fming.dev/latest/) init with Python 3.10
- [PDM](https://pdm.fming.dev/latest/) init with Python 3.13
- Install dependencies with [PDM](https://pdm.fming.dev/latest/)
- Install [pre-commit](https://pre-commit.com/) hooks to local `.git` folder
<!-- - Prompt user an option include `.vscode/settings.json` -->
Expand Down
2 changes: 1 addition & 1 deletion README_main.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ template-python

## Requirements

- Python >= 3.10
- Python >= 3.13
- OS: Ubuntu, MacOS, Windows

## Installation
Expand Down
Loading

0 comments on commit 87c8ecf

Please sign in to comment.