Use stdlib functools.cached_property in Python 3.8+

Python 3.8+ has a functools.cached_property decorator in stdlib.  Use it
in place of third-party cached_property when available.
pull/123/head
Michał Górny 2021-11-11 09:17:39 +01:00
parent 641060d635
commit 28627198ba
5 changed files with 17 additions and 6 deletions

View File

@ -3,6 +3,10 @@ import logging
import re
import random
import itertools
try:
from functools import cached_property
except ImportError:
from cached_property import cached_property
import gixy.core.sre_parse.sre_parse as sre_parse

View File

@ -1,3 +1,6 @@
try:
from functools import cached_property
except ImportError:
from cached_property import cached_property
from gixy.directives.directive import Directive

View File

@ -1,6 +1,10 @@
import logging
import codecs
import six
try:
from functools import cached_property
except ImportError:
from cached_property import cached_property
from pyparsing import (

View File

@ -1,5 +1,5 @@
pyparsing>=1.5.5
cached-property>=1.2.0
cached-property>=1.2.0;python_version<"3.8"
argparse>=1.4.0
six>=1.1.0
Jinja2>=2.8

View File

@ -18,7 +18,7 @@ setup(
url='https://github.com/yandex/gixy',
install_requires=[
'pyparsing>=1.5.5',
'cached-property>=1.2.0',
'cached-property>=1.2.0;python_version<"3.8"',
'argparse>=1.4.0;python_version<"3.2"',
'six>=1.1.0',
'Jinja2>=2.8',