Skip to content

Commit 39fc8d0

Browse files
committed
refactor: Remove cached_property dep and use functools
Python 3.8 added functools.cached_property and we only support python3.9+. So this dependency is no longer required
1 parent 2487d39 commit 39fc8d0

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ version = "0"
99
authors = ["Corridor Platforms <postmaster@corridorplatforms.com>"]
1010
license = "Apache-2.0, BSD-3-Clause"
1111
readme = "docs/README.md"
12-
packages = [{include = "sqlalchemy_history"}]
12+
packages = [{ include = "sqlalchemy_history" }]
1313
repository = "https://github.com/corridor/sqlalchemy-history"
14-
classifiers=[
14+
classifiers = [
1515
"Intended Audience :: Developers",
1616
"Operating System :: OS Independent",
1717
"Programming Language :: Python",
@@ -24,7 +24,6 @@ python = "^3.9"
2424

2525
SQLAlchemy = ">=2"
2626
SQLAlchemy-Utils = ">=0.30.12"
27-
cached-property = "*"
2827

2928
[tool.poetry.group.dev.dependencies]
3029
ruff = "*"

sqlalchemy_history/version.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import sqlalchemy as sa
2-
from cached_property import cached_property
3-
2+
import functools
43
from sqlalchemy_history.reverter import Reverter
54
from sqlalchemy_history.utils import (
65
get_versioning_manager,
@@ -10,7 +9,7 @@
109

1110

1211
class VersionClassBase(object):
13-
@cached_property
12+
@functools.cached_property
1413
def previous(self):
1514
"""Returns the previous version relative to this version in the version
1615
history. If current version is the first version this method returns
@@ -20,7 +19,7 @@ def previous(self):
2019
"""
2120
return get_versioning_manager(self).fetcher(parent_class(self.__class__)).previous(self)
2221

23-
@cached_property
22+
@functools.cached_property
2423
def next(self):
2524
"""Returns the next version relative to this version in the version
2625
history. If current version is the last version this method returns
@@ -30,7 +29,7 @@ def next(self):
3029
"""
3130
return get_versioning_manager(self).fetcher(parent_class(self.__class__)).next(self)
3231

33-
@cached_property
32+
@functools.cached_property
3433
def index(self):
3534
""" """
3635
return get_versioning_manager(self).fetcher(parent_class(self.__class__)).index(self)

0 commit comments

Comments
 (0)