Skip to content

Commit

Permalink
feat: drop Python <3.9 (#507)
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Oct 7, 2024
1 parent 8bab80a commit 435d5d8
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 41 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/reusable-cookie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.13"]
runs-on: [ubuntu-latest, windows-latest, macos-14]
python-version: ["3.9", "3.13"]
runs-on: [ubuntu-latest, windows-latest, macos-latest]

include:
- python-version: pypy-3.9
- python-version: pypy-3.10
runs-on: ubuntu-latest
- python-version: "3.12"
runs-on: windows-latest
exclude:
# Copier doesn't work on 3.13 Windows
- python-version: "3.13"
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -48,11 +42,6 @@ jobs:
- name: Setup uv
uses: astral-sh/setup-uv@v3

- name: Add .local/bin to Windows PATH
if: runner.os == 'Windows'
shell: bash
run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH

- name: Install nox
run: uv tool install nox

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Check the key setup files, `pyproject.toml`, and possibly `setup.cfg` and
`setup.py` (pybind11 example). Update `README.md`. Also update and add docs to
`docs/`.

There are a few example dependencies and a minimum Python version of 3.8, feel
There are a few example dependencies and a minimum Python version of 3.9, feel
free to change it to whatever you actually need/want. There is also a basic
backports structure with a small typing example.

Expand Down
3 changes: 1 addition & 2 deletions docs/_includes/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors = [
maintainers = [
{ name = "My Organization", email = "[email protected]" },
]
requires-python = ">=3.8"
requires-python = ">=3.9"

dependencies = [
"typing_extensions",
Expand All @@ -24,7 +24,6 @@ classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/guides/gha_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ tests:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.11"
- "3.12"
- "3.13"
name: Check Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 2 additions & 3 deletions docs/pages/guides/packaging_classic.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ classifiers =
Programming Language :: C++
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Expand All @@ -312,8 +311,8 @@ project_urls =
[options]
packages = find:
install_requires =
numpy>=1.13.3
python_requires = >=3.8
numpy>=1.19.3
python_requires = >=3.9
include_package_data = True
package_dir =
=src
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/guides/packaging_compiled.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ rand = "0.8.3"
[dependencies.pyo3]
version = "0.19.1"
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
# "abi3-py38" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.8
features = ["extension-module", "abi3-py38"]
# "abi3-py39" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.9
features = ["extension-module", "abi3-py39"]
```
<!-- prettier-ignore-end -->
<!-- [[[end]]] -->
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/guides/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ this:
```ini
[tool.mypy]
files = "src"
python_version = "3.8"
python_version = "3.9"
strict = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true
Expand Down Expand Up @@ -841,7 +841,7 @@ started:

```toml
[tool.pylint]
py-version = "3.8"
py-version = "3.9"
jobs = "0"
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/guides/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ customize the versions of Python prepared for you, then use input like this:
```yaml
- uses: wntrblm/[email protected]
with:
python-versions: "3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy-3.9, pypy-3.10"
python-versions: "3.9, 3.10, 3.11, 3.12, 3.13, pypy-3.10"
```

### Introduction
Expand Down Expand Up @@ -144,7 +144,7 @@ You can parametrize sessions. either on Python or on any other item.

```python
# Shortcut to parametrize Python
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
def my_session(session: nox.Session) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion tests/packages/ruff_extend/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
extend = "pyproject.toml"
target-version = "3.8"
target-version = "3.9"
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.13"]
python-version: ["3.9", "3.13"]
runs-on: [ubuntu-latest, windows-latest, macos-14]

include:
Expand Down
9 changes: 4 additions & 5 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ classifiers = [
]

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.9"

furo = { version = ">=2023.08.17", optional = true }
myst_parser = { version = ">=0.13", optional = true }
Expand Down Expand Up @@ -162,7 +162,7 @@ maintainers = [
description = "{{ cookiecutter.project_short_description }}"
readme = "README.md"
license.file = "LICENSE"
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Science/Research",
Expand All @@ -178,7 +178,6 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -328,7 +327,7 @@ report.exclude_also = [

[tool.mypy]
files = ["src", "tests"]
python_version = "3.8"
python_version = "3.9"
warn_unused_configs = true
strict = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
Expand Down Expand Up @@ -386,7 +385,7 @@ isort.required-imports = ["from __future__ import annotations"]


[tool.pylint]
py-version = "3.8"
py-version = "3.9"
ignore-paths = [".*/_version.py"]
{%- if cookiecutter.__type == "compiled" %}
extension-pkg-allow-list = ["{{ cookiecutter.__project_slug }}._core"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cache:
- .cache/pip
- .venv/

image: python:3.8-buster
image: python:3.9-buster
before_script:
# want to set up a virtualenv to cache
- apt-get install -y --no-install-recommends git
Expand Down Expand Up @@ -79,7 +79,7 @@ tests:
- python -m pytest -ra --cov={{ cookiecutter.project_name }}
parallel:
matrix:
- IMAGE: ['python:3.8-buster', 'python:3.11-buster']
- IMAGE: ['python:3.9-buster', 'python:3.11-buster']

{%- if cookiecutter.__type == "pure" %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ rand = "0.8.3"
[dependencies.pyo3]
version = "0.19.1"
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
# "abi3-py38" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.8
features = ["extension-module", "abi3-py38"]
# "abi3-py39" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.9
features = ["extension-module", "abi3-py39"]
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Expand All @@ -56,7 +55,7 @@ project_urls =
packages = find:
install_requires =
typing-extensions>=4.6;python_version<'3.11'
python_requires = >=3.8
python_requires = >=3.9
include_package_data = True
package_dir =
=src
Expand Down

0 comments on commit 435d5d8

Please sign in to comment.