Skip to content

Commit 679eaad

Browse files
authored
Add support for python 3.13 (#37)
* Add support for python 3.13 Drop support for python 3.8 * Trigger tests
1 parent 0af11cf commit 679eaad

11 files changed

+22
-107
lines changed

.github/workflows/python-code-style.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip

.github/workflows/python-lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip

.github/workflows/python-quality.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip

.github/workflows/python-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
22+
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2323
os: [ubuntu-latest]
2424
runs-on: ${{ matrix.os }}
2525
steps:

.github/workflows/python-typing.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919

20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424

2525
- name: Install dependencies
2626
run: |

.github/workflows/reusable-github-pages.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
- name: Checkout
4040
uses: actions/checkout@v4
4141

42-
- name: Set up Python 3.12
42+
- name: Set up Python 3.13
4343
uses: actions/setup-python@v5
4444
with:
45-
python-version: "3.12"
45+
python-version: "3.13"
4646

4747
# Here we want to install the current package in editable mode,
4848
# in case mkdocs needs the package (i.e. we are building a mkdocs plugin).

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# bootstrap-python-package
2-
![Static Badge](https://img.shields.io/badge/Python-3.8_%7C_3.9_%7C_3.10_%7C_3.11_%7C_3.12-blue?logo=python&logoColor=white)
2+
![Static Badge](https://img.shields.io/badge/Python-3.9_%7C_3.10_%7C_3.11_%7C_3.12_%7C_3.13-blue?logo=python&logoColor=white)
33
[![Stable Version](https://img.shields.io/pypi/v/bootstrap-python-package?color=blue)](https://pypi.org/project/bootstrap-python-package/)
44
[![stability-beta](https://img.shields.io/badge/stability-beta-33bbff.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#beta)
55

docs/index.md

+1-87
Original file line numberDiff line numberDiff line change
@@ -1,87 +1 @@
1-
# bootstrap-python-package
2-
![Static Badge](https://img.shields.io/badge/Python-3.8_%7C_3.9_%7C_3.10_%7C_3.11_%7C_3.12-blue?logo=python&logoColor=white)
3-
[![Stable Version](https://img.shields.io/pypi/v/bootstrap-python-package?color=blue)](https://pypi.org/project/bootstrap-python-package/)
4-
[![stability-beta](https://img.shields.io/badge/stability-beta-33bbff.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#beta)
5-
6-
[![Python tests](https://github.com/febus982/bootstrap-python-package/actions/workflows/python-tests.yml/badge.svg?branch=main)](https://github.com/febus982/bootstrap-python-package/actions/workflows/python-tests.yml)
7-
[![Maintainability](https://api.codeclimate.com/v1/badges/593e78ec96ed5ebb0dd3/maintainability)](https://codeclimate.com/github/febus982/bootstrap-python-package/maintainability)
8-
[![Test Coverage](https://api.codeclimate.com/v1/badges/593e78ec96ed5ebb0dd3/test_coverage)](https://codeclimate.com/github/febus982/bootstrap-python-package/test_coverage)
9-
10-
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
11-
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
12-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
13-
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
14-
15-
This template repository provides the boilerplate to create a python package.
16-
It is configured with all the following features:
17-
18-
* Test suite using [tox](https://tox.wiki/en/latest/index.html) and [pytest](https://docs.pytest.org/en/7.4.x/)
19-
* Typing using [mypy](https://mypy.readthedocs.io/en/stable/)
20-
* Linting, security and code format using [ruff](https://github.com/astral-sh/ruff) (using [black](https://pypi.org/project/black/)
21-
code style and [bandit](https://github.com/PyCQA/bandit) security rules)
22-
* Integration with CodeClimate for code quality and coverage checks
23-
* CI pipeline supporting:
24-
* testing against multiple python versions
25-
* releases on [PyPI](https://pypi.org)
26-
* GitHub pages documentation using [mkdocs](https://www.mkdocs.org)
27-
* PyCharm profile basic configuration
28-
29-
## How to use this repository template to create a new package
30-
31-
* Create your github repository using this template. (The big green `Use this template` button)
32-
* Rename the `bootstrap_python_package` directory
33-
* Search and replace all the occurrences of `bootstrap-python-package` and `bootstrap_python_package`
34-
* Configure a pending trusted publisher on [pypi](https://pypi.org/manage/account/publishing) using the following values:
35-
* PyPI Project Name: The github repository name (in this case `bootstrap-python-package`)
36-
* Owner: The github repository owner (in this case `febus982`)
37-
* Repository name: The github repository name (in this case `bootstrap-python-package`)
38-
* Workflow name: `release.yml`
39-
* Create a GitHub Actions secret named `CODECLIMATE_REPORTER_ID` (at URL `https://github.com/GITHUB_NAME_OR_ORGANIZATION/GITHUB_REPOSITORY/settings/secrets/actions`)
40-
containing the codeclimate reporter id (you can find it at `https://codeclimate.com/repos/YOUR_REPO_ID/settings/test_reporter`).
41-
If you don't want to use CodeClimate just delete `workflows/python-quality.yml`.
42-
* Update the badges in `README.md`! (check [shields.io](https://shields.io/) for extra badges)
43-
* Update the PyCharm Copyright profile in the IDE settings: Editor | Copyright | Copyright Profiles (if you want to use it)
44-
* Setup local development:
45-
* Clone the repository
46-
* Install poetry `pip install poetry`
47-
* Install dev dependencies with `make dev-dependencies`
48-
* (optional) It is strongly recommended to install [pre-commit](https://pre-commit.com/#installation)
49-
and run `pre-commit install` so that formatting and linting are automatically executed during `git commit`.
50-
* Setup GitHub pages (this need local development setup):
51-
* Initialise documentation branch `poetry run mike deploy dev latest --update-aliases --push`
52-
* Configure GitHub Pages to deploy from the `gh-pages` branch (at URL `https://github.com/GITHUB_NAME_OR_ORGANIZATION/GITHUB_REPOSITORY/settings/pages`)
53-
* Add the `main` branch and the `v*.*.*` tag rules to the "deployment branches and tags" list in the `gh-pages` environment (at URL `https://github.com/GITHUB_NAME_OR_ORGANIZATION/GITHUB_REPOSITORY/settings/environments`)
54-
55-
**IMPORTANT:** The repository is configured to deploy on the [test PyPI repository](https://test.pypi.org/).
56-
It's strongly recommended to create the project in the [test PyPI repository](https://test.pypi.org/) and test
57-
the deployment pipeline. When you're happy with the result, create the project on the official [PyPI repository](https://pypi.org/)
58-
and remove the marked lines in `workflows/release.yml`.
59-
60-
## Package release
61-
62-
This setup uses [poetry-dynamic-versioning](https://github.com/mtkennerly/poetry-dynamic-versioning).
63-
This means it's not necessary to commit the version in the code but the CI pipeline
64-
will infer it from the git tag.
65-
66-
To release a new version, just create a new release and tag in the GitHub repository, to:
67-
68-
* Build and deploy the python package to PyPI
69-
* Build and deploy a new version of the documentation to GitHub pages
70-
71-
**IMPORTANT:** The default configuration requires the release name and the tag to follow
72-
the convention `vX.X.X` (semantic versioning preceded by lowercase `v`). It will publish
73-
the correct version on Pypi, omitting the `v` (ie. `v1.0.0` will publish `1.0.0`).
74-
75-
This format can be customized, refer to [poetry-dynamic-versioning docs](https://github.com/mtkennerly/poetry-dynamic-versioning)
76-
77-
## Commands for development
78-
79-
All the common commands used during development can be run using make targets:
80-
81-
* `make dev-dependencies`: Install dev requirements
82-
* `make update-dependencies`: Update dev requirements
83-
* `make fix`: Run code style and lint automatic fixes (where possible)
84-
* `make test`: Run test suite against system python version
85-
* `make check`: Run tests against all available python versions, code style and lint checks
86-
* `make type`, `make format`, `make lint`, `make bandit`: Run the relevant check
87-
* `make docs`: Render the mkdocs website locally
1+
--8<-- "./README.md"

pyproject.toml

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ classifiers = [
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
2121
"Programming Language :: Python :: 3 :: Only",
22-
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",
2524
"Programming Language :: Python :: 3.11",
2625
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
2727
"Typing :: Typed"
2828
]
2929

@@ -39,7 +39,7 @@ build-backend = "poetry_dynamic_versioning.backend"
3939
############################
4040

4141
[tool.poetry.dependencies]
42-
python = ">=3.8,<3.13"
42+
python = ">=3.9,<3.14"
4343

4444
[tool.poetry.group.dev]
4545
optional = true
@@ -83,10 +83,11 @@ exclude_also = [
8383

8484
[tool.mypy]
8585
files = "bootstrap_python_package"
86-
python_version = "3.8"
86+
python_version = "3.9"
8787

8888
[tool.pytest.ini_options]
8989
asyncio_mode = "auto"
90+
asyncio_default_fixture_loop_scope = "function"
9091
minversion = "6.0"
9192
addopts = "-n auto --cov-report=term-missing"
9293
testpaths = [
@@ -95,7 +96,7 @@ testpaths = [
9596

9697
[tool.ruff]
9798
extend-exclude = ["docs", ".tox"]
98-
target-version = "py38"
99+
target-version = "py39"
99100

100101
[tool.ruff.lint]
101102
select = [

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[tox]
22
min_version = 4.0
33
env_list =
4+
py313
45
py312
56
py311
67
py310
78
py39
8-
py38
99
typing
1010
lint
1111
format
@@ -22,7 +22,7 @@ deps =
2222
commands =
2323
pytest
2424

25-
[testenv:py312]
25+
[testenv:py313]
2626
; Run with coverage in one python version to check coverage percentage
2727
commands =
2828
pytest --cov

0 commit comments

Comments
 (0)