From c05f5141a58cf9e04b1f6b2847b906b5c7d56fe0 Mon Sep 17 00:00:00 2001 From: Changaco Date: Sat, 14 Dec 2024 17:26:38 +0100 Subject: [PATCH] switch to the stdlib's `cached_property` --- liberapay/elsewhere/_base.py | 2 +- liberapay/i18n/base.py | 2 +- liberapay/models/exchange_route.py | 2 +- liberapay/models/participant.py | 2 +- liberapay/models/tip.py | 2 +- liberapay/website.py | 2 +- requirements_base.txt | 4 ---- 7 files changed, 6 insertions(+), 10 deletions(-) diff --git a/liberapay/elsewhere/_base.py b/liberapay/elsewhere/_base.py index 9a3b2fe4c..93dfd5f18 100644 --- a/liberapay/elsewhere/_base.py +++ b/liberapay/elsewhere/_base.py @@ -1,5 +1,6 @@ from dataclasses import dataclass from datetime import datetime, timezone +from functools import cached_property import hashlib import json import logging @@ -9,7 +10,6 @@ import xml.etree.ElementTree as ET from babel.dates import format_timedelta -from cached_property import cached_property from dateutil.parser import parse as parse_date from pando.utils import utc from oauthlib.oauth2 import BackendApplicationClient, InvalidGrantError, TokenExpiredError diff --git a/liberapay/i18n/base.py b/liberapay/i18n/base.py index 7aa2e6ca9..8770df1c1 100644 --- a/liberapay/i18n/base.py +++ b/liberapay/i18n/base.py @@ -1,6 +1,7 @@ from collections import namedtuple from datetime import date, datetime, timedelta from decimal import Decimal, InvalidOperation +from functools import cached_property from sys import intern from unicodedata import combining, normalize import warnings @@ -9,7 +10,6 @@ from babel.dates import format_date, format_datetime, format_time, format_timedelta from babel.messages.pofile import Catalog from babel.numbers import parse_pattern -from cached_property import cached_property from markupsafe import Markup import opencc from pando.utils import utcnow diff --git a/liberapay/models/exchange_route.py b/liberapay/models/exchange_route.py index d1df9bf7d..43f14e777 100644 --- a/liberapay/models/exchange_route.py +++ b/liberapay/models/exchange_route.py @@ -1,7 +1,7 @@ from calendar import monthrange from datetime import date +from functools import cached_property -from cached_property import cached_property from postgres.orm import Model import stripe diff --git a/liberapay/models/participant.py b/liberapay/models/participant.py index e28d7f561..5d99bfb76 100644 --- a/liberapay/models/participant.py +++ b/liberapay/models/participant.py @@ -3,6 +3,7 @@ from datetime import date, timedelta from decimal import Decimal from email.utils import formataddr +from functools import cached_property from hashlib import pbkdf2_hmac, md5, sha1 from operator import attrgetter, itemgetter from os import urandom @@ -15,7 +16,6 @@ import uuid import aspen_jinja2_renderer -from cached_property import cached_property from dateutil.parser import parse as parse_date from dns.exception import DNSException from dns.resolver import Cache as DNSCache, Resolver as DNSResolver diff --git a/liberapay/models/tip.py b/liberapay/models/tip.py index 75dabc480..0c62ebf08 100644 --- a/liberapay/models/tip.py +++ b/liberapay/models/tip.py @@ -1,6 +1,6 @@ from datetime import timedelta +from functools import cached_property -from cached_property import cached_property from postgres.orm import Model diff --git a/liberapay/website.py b/liberapay/website.py index a97a699bc..9b16b44b8 100644 --- a/liberapay/website.py +++ b/liberapay/website.py @@ -5,10 +5,10 @@ from contextvars import ContextVar, copy_context from datetime import timedelta +from functools import cached_property import logging import os -from cached_property import cached_property from environment import Environment, is_yesish from markupsafe import Markup from pando.utils import utcnow diff --git a/requirements_base.txt b/requirements_base.txt index cbd7fb3e7..5e28ab574 100644 --- a/requirements_base.txt +++ b/requirements_base.txt @@ -541,10 +541,6 @@ boto3==1.35.13 \ --hash=sha256:244a76a24355363a68164241438de1b72f8781664920260c48465896b712a41e \ --hash=sha256:29edc09801743c21eb5ecbc617a152df41d3c287f67b615f73e5f750583666a7 -cached-property==1.5.2 \ - --hash=sha256:9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130 \ - --hash=sha256:df4f613cf7ad9a588cc381aaf4a512d26265ecebd5eb9e1ba12f1319eb85a6a0 - stripe==11.3.0 \ --hash=sha256:98e625d9ddbabcecf02666867169696e113d9eaba27979fb310a7a8dfd44097c \ --hash=sha256:9d2e86943e1e4f325835d3860c4f58aa98d49229c9caf67588f9f9b2451e8e56