Skip to content

Commit fbbefbb

Browse files
committed
drop support for Python 3.9, update dependencies and docs
1 parent f39147d commit fbbefbb

File tree

9 files changed

+27
-94
lines changed

9 files changed

+27
-94
lines changed

.github/workflows/cicd.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
python-version:
15-
- "3.9"
1615
- "3.10"
1716
- "3.11"
1817
- "3.12"
1918
- "3.13"
20-
- "pypy-3.9"
2119
- "pypy-3.10"
2220
steps:
2321
- uses: actions/checkout@v3

cookiecutter.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"author_name": "Joe Doe",
33
"author_email": "joe@example.com",
4-
"github_username": "joesgithub",
5-
"project_name": "Python Boilerplate",
6-
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
7-
"project_short_description": "Python Boilerplate contains all the boilerplate you need to create a Python package.",
4+
"github_username": "{{ cookiecutter.author_name.lower().replace(' ', '') }}",
5+
"project_name": "{{ cookiecutter.author_name }}'s new project",
6+
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_').replace('.', '_').replace('\\'', '') }}",
7+
"project_short_description": "{{ cookiecutter.project_name }} is a Python project.",
88
"version": "0.1.0",
99
"license": [
1010
"MIT",

{{ cookiecutter.project_slug }}/.github/workflows/cicd.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
python-version:
16-
- "3.9"
1716
- "3.10"
1817
- "3.11"
1918
- "3.12"
@@ -36,12 +35,10 @@ jobs:
3635
fail-fast: false
3736
matrix:
3837
python-version:
39-
- "3.9"
4038
- "3.10"
4139
- "3.11"
4240
- "3.12"
4341
- "3.13"
44-
- "pypy-3.9"
4542
- "pypy-3.10"
4643
steps:
4744
- uses: actions/checkout@v3

{{ cookiecutter.project_slug }}/.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ minimum_pre_commit_version: "3.0"
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
44
# Ruff version.
5-
rev: 'v0.8.2'
5+
rev: 'v0.9.10'
66
hooks:
77
- id: ruff
88
args: [--fix, --exit-non-zero-on-fix]
99
- id: ruff-format
1010
- repo: https://github.com/python-jsonschema/check-jsonschema
11-
rev: 0.22.0
11+
rev: 0.31.3
1212
hooks:
1313
- id: check-gitlab-ci
1414
files: .gitlab-ci.yml
1515
- repo: https://github.com/adrienverge/yamllint.git
16-
rev: v1.29.0
16+
rev: v1.35.1
1717
hooks:
1818
- id: yamllint
1919
args: [-d relaxed]
2020
verbose: true
2121
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: v1.13.0
22+
rev: v1.15.0
2323
hooks:
2424
- id: mypy
2525
# for args see https://mypy.readthedocs.io/en/stable/command_line.html

{{ cookiecutter.project_slug }}/.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: "ubuntu-22.04"
55
tools:
6-
python: "3.9"
6+
python: "3.10"
77
jobs:
88
post_create_environment:
99
# Install poetry

{{ cookiecutter.project_slug }}/README.md

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -120,43 +120,6 @@ E.g., for version `1.2.3` the tag must be `1.2.3`.
120120
publishes the package to
121121
[PyPI](https://pypi.org/project/{{ cookiecutter.project_slug }}/).
122122

123-
## Upload from the local machine (not recommended)
124-
125-
[twine](https://twine.readthedocs.io/en/stable/) allows to upload a package
126-
from your local machine to PyPI.
127-
128-
### Prerequisites
129-
130-
You need a PyPI API token. See prerequisites for the Github actions above
131-
(you don't need to perform any actions on Github when using twine, so you
132-
only need to perform step 1).
133-
134-
### Configuration
135-
136-
The PyPI credentials must be configured either via a configuration file
137-
or via environment variables.
138-
See the [twine documentation](https://twine.readthedocs.io/en/stable/#configuration)
139-
for details.
140-
141-
Since we are using an api token to authenticate with PyPI, the username
142-
must be set to `__token__`, and the password is the actual token.
143-
144-
When using the PyPI test server, the repository url must be set to
145-
`https://test.pypi.org/legacy/`.
146-
147-
### Usage
148-
149-
The `publish` target in the [Makefile](Makefile) calls twine to upload
150-
a package to PyPI.
151-
152-
**Note:** the upload command is deactivated by default to prevent accidental
153-
uploads. You need to manually uncomment it before the first release.
154-
155-
Here are the necessary steps:
156-
157-
1. update the version number in the [pyproject.toml](pyproject.toml)
158-
2. run `make publish`.
159-
160123

161124
# Using a custom package repository
162125

@@ -172,27 +135,6 @@ To release to a server other than the standard PyPI, you need to specify the res
172135
repository URL when uploading.
173136

174137

175-
### Releasing to a custom repo with twine
176-
177-
With twine, you can specify the repository URL via the `--repository-url` parameter.
178-
179-
In the special case of the PyPI Test server, you can also specify
180-
`--repository testpypi`.
181-
182-
```bash
183-
# for Test PyPI
184-
twine upload --repository testpypi dist/*
185-
186-
# for any custom repository
187-
twine upload --repository-url <URL> dist/*
188-
```
189-
190-
In the context of this project, you can modify the `publish` target in the
191-
[Makefile](Makefile).
192-
193-
See also [Using TestPyPI](https://packaging.python.org/en/latest/guides/using-testpypi/).
194-
195-
196138
### Releasing to a custom repo with Github actions
197139

198140
To release to a custom repo with Github actions, you can follow the same process
@@ -210,7 +152,8 @@ as described above for the default PyPI. The only necessary change is adding a
210152
repository_url: https://test.pypi.org/legacy/
211153
```
212154
213-
For use with Test PyPI you need an account and an API token from [test.pypi.org](https://test.pypi.org). Note that in the example above, that token is assumed to
155+
For use with Test PyPI you need an account and an API token from [test.pypi.org](https://test.pypi.org).
156+
Note that in the example above, that token is assumed to
214157
be stored in the `TEST_PYPI_API_TOKEN` secret in Github.
215158

216159
See also [Advanced release management](https://github.com/marketplace/actions/pypi-publish#advanced-release-management)

{{ cookiecutter.project_slug }}/pyproject.toml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ repository = "https://github.com/{{cookiecutter.github_username}}/{{cookiecutter
1010
documentation = "https://{{ cookiecutter.project_slug }}.readthedocs.io"
1111
classifiers = [
1212
"Development Status :: 4 - Beta",
13-
"Programming Language :: Python :: 3.9",
1413
"Programming Language :: Python :: 3.10",
1514
"Programming Language :: Python :: 3.11",
1615
"Programming Language :: Python :: 3.12",
@@ -20,7 +19,7 @@ classifiers = [
2019

2120
# Only packages in this group will be installed in the release image
2221
[tool.poetry.dependencies]
23-
python = "^3.9"
22+
python = "^3.10"
2423
pydantic = "^2.0.0"
2524
pydantic-settings = "^2.0.0"
2625

@@ -30,22 +29,18 @@ pydantic-settings = "^2.0.0"
3029
# but are installed by poetry by default.
3130
# So they are available in your dev environment,
3231
# but not in a production environment.
33-
# myst-nb = "^0.16.0" # useful, but depends on really old version of sphinx
34-
myst-parser = "^1.0.0"
35-
Sphinx = "^6.1.3"
36-
sphinx-autobuild = "^2021.3.14"
37-
sphinx-rtd-theme = "^1.2.0"
38-
sphinxcontrib-mermaid = "^0.7.1"
32+
myst-parser = "^4.0.0"
33+
Sphinx = "^7.0.0|^8.0.0"
34+
sphinx-autobuild = "^2024.10.3"
35+
sphinx-rtd-theme = "^3.0.0"
36+
sphinxcontrib-mermaid = "^1.0.0"
3937

4038
[tool.poetry.group.dev.dependencies]
41-
pre-commit = "^3.0"
42-
pytest = "^7.2.2"
43-
pytest-cov = "^4.0.0"
39+
pre-commit = "^4.0.0"
40+
pytest = "^8.0.0"
41+
pytest-cov = "^6.0.0"
4442
tox = "^4.0.0"
4543

46-
# deployment
47-
twine = "^4.0.2"
48-
4944
[tool.ruff.lint]
5045
select = [
5146
"ANN", # flake8-annotations

{{ cookiecutter.project_slug }}/tests/test_{{ cookiecutter.project_slug }}.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77

88
def test_reminder():
99
"""Reminder to write tests."""
10-
assert False, "If this test runs it probably means that you have not written your own tests yet 😱 Do it now!"
10+
assert False, (
11+
"If this test runs it probably means that you have not written your own tests yet 😱 Do it now!"
12+
)
1113

1214

1315
def test_version_is_semver_string():
1416
"""Test that the version in pyproject.toml is a proper semantic version."""
1517
semver_pattern = r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
1618
version = {{ cookiecutter.project_slug }}.__version__
17-
assert re.match(
18-
semver_pattern, version
19-
), f'"{version}" is not a valid semver version'
19+
assert re.match(semver_pattern, version), (
20+
f'"{version}" is not a valid semver version'
21+
)

{{ cookiecutter.project_slug }}/tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py39,py310,py311,py312,py313,pypy39,pypy310
2+
envlist = py310,py311,py312,py313,pypy310
33
isolated_build = True
44
parallel = True
55

@@ -13,10 +13,8 @@ commands =
1313

1414
[gh-actions]
1515
python =
16-
3.9: py39
1716
3.10: py310
1817
3.11: py311
1918
3.12: py312
2019
3.13: py313
21-
pypy-3.9: pypy39
2220
pypy-3.10: pypy310

0 commit comments

Comments
 (0)