Skip to content

Commit

Permalink
Drop support for python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
youtux committed Jan 11, 2025
1 parent 67c9336 commit 48e84aa
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 43 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ jobs:
strategy:
matrix:
include:
- python-version: "3.8"
toxfactor: py3.8
ignore-typecheck-outcome: true
ignore-test-outcome: false
- python-version: "3.9"
toxfactor: py3.9
ignore-typecheck-outcome: true
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
rev: ce40a160603ab0e7d9c627ae33d7ef3906e2d2b2 # frozen: v3.19.1
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py39-plus]
- repo: https://github.com/python-poetry/poetry
rev: "f03d8f98781934df7910be5b6c14756e047ef432" # frozen: 2.0.0
hooks:
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
Unreleased
----------
- Declare compatibility with python 3.13
- Drop support for python 3.8. Supported versions are now: 3.9, 3.10, 3.11, 3.12, 3.13.
- Drop support for pytest < 7.0.0.

2.7.0
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ classifiers = [
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
"inflection",
"factory_boy>=2.10.0",
Expand Down Expand Up @@ -53,7 +52,7 @@ build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 120
target-version = ["py38", "py39", "py310", "py311", "py312", "py313"]
target-version = ["py39", "py310", "py311", "py312", "py313"]

[tool.isort]
profile = "black"
Expand Down
15 changes: 1 addition & 14 deletions pytest_factoryboy/compat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

import pathlib
import sys
from collections.abc import Sequence
from importlib.metadata import version

Expand All @@ -11,24 +9,13 @@

pytest_version = parse_version(version("pytest"))

__all__ = ("PostGenerationContext", "path_with_stem", "getfixturedefs")
__all__ = ("PostGenerationContext", "getfixturedefs")

try:
from factory.declarations import PostGenerationContext
except ImportError: # factory_boy < 3.2.0
from factory.builder import PostGenerationContext

if sys.version_info >= (3, 9):

def path_with_stem(path: pathlib.Path, stem: str) -> pathlib.Path:
return path.with_stem(stem)

else:

def path_with_stem(path: pathlib.Path, stem: str) -> pathlib.Path:
return path.with_name(stem + path.suffix)


if pytest_version.release >= (8, 1):

def getfixturedefs(fixturemanager: FixtureManager, fixturename: str, node: Node) -> Sequence[FixtureDef] | None:
Expand Down
18 changes: 3 additions & 15 deletions pytest_factoryboy/fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,11 @@
import functools
import sys
import warnings
from collections.abc import Collection, Iterable, Iterator, Mapping
from dataclasses import dataclass
from inspect import signature
from types import MethodType
from typing import (
TYPE_CHECKING,
Any,
Callable,
Collection,
Generic,
Iterable,
Iterator,
Mapping,
Type,
TypeVar,
cast,
overload,
)
from typing import TYPE_CHECKING, Any, Callable, Generic, TypeVar, cast, overload

import factory
import factory.builder
Expand All @@ -39,7 +27,7 @@

from .plugin import Request as FactoryboyRequest

FactoryType: TypeAlias = Type[factory.Factory]
FactoryType: TypeAlias = type[factory.Factory]
F = TypeVar("F", bound=FactoryType)
T = TypeVar("T")
T_co = TypeVar("T_co", covariant=True)
Expand Down
3 changes: 2 additions & 1 deletion pytest_factoryboy/fixturegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import functools
import inspect
from typing import Callable, Collection, TypeVar
from collections.abc import Collection
from typing import Callable, TypeVar

import pytest
from typing_extensions import ParamSpec
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[tox]
distshare = {homedir}/.tox/distshare
envlist = py{3.8,3.9,3.10,3.11,3.12,3.13}-pytest{7.3,7.4,8.0,8.1,8.2,8.3,latest,main}
py{3.8,3.9,3.10,3.11}-pytest{7.0,7.1,7.2}
envlist = py{3.9,3.10,3.11,3.12,3.13}-pytest{7.3,7.4,8.0,8.1,8.2,8.3,latest,main}
py{3.9,3.10,3.11}-pytest{7.0,7.1,7.2}
mypy


[testenv]
parallel_show_output = true
commands = coverage run -m pytest {posargs:tests}
Expand Down

0 comments on commit 48e84aa

Please sign in to comment.