-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #353 from mrbean-bremen/current-python
Add official support for current Python versions
- Loading branch information
Showing
15 changed files
with
90 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
include AUTHORS.rst | ||
include CONTRIBUTING.rst | ||
include HISTORY.rst | ||
include AUTHORS.md | ||
include CONTRIBUTING.md | ||
include HISTORY.md | ||
include LICENSE | ||
include README.rst | ||
include README.md | ||
|
||
recursive-include tests * | ||
include conftest.py | ||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
|
||
recursive-include docs *.rst conftest.py Makefile make.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
__author__ = "Daniel Greenfeld" | ||
__email__ = "[email protected]" | ||
__version__ = "1.5.2" | ||
__version__ = "2.0.0" | ||
__license__ = "BSD" | ||
|
||
from functools import wraps | ||
from time import time | ||
import threading | ||
|
||
try: | ||
import asyncio | ||
except (ImportError, SyntaxError): | ||
asyncio = None | ||
import asyncio | ||
|
||
|
||
class cached_property(object): | ||
class cached_property: | ||
""" | ||
A property that is only computed once per instance and then replaces itself | ||
with an ordinary attribute. Deleting the attribute resets the property. | ||
|
@@ -30,15 +24,14 @@ def __get__(self, obj, cls): | |
if obj is None: | ||
return self | ||
|
||
if asyncio and asyncio.iscoroutinefunction(self.func): | ||
if asyncio.iscoroutinefunction(self.func): | ||
return self._wrap_in_coroutine(obj) | ||
|
||
value = obj.__dict__[self.func.__name__] = self.func(obj) | ||
return value | ||
|
||
def _wrap_in_coroutine(self, obj): | ||
@wraps(obj) | ||
@asyncio.coroutine | ||
def wrapper(): | ||
future = asyncio.ensure_future(self.func(obj)) | ||
obj.__dict__[self.func.__name__] = future | ||
|
@@ -47,7 +40,7 @@ def wrapper(): | |
return wrapper() | ||
|
||
|
||
class threaded_cached_property(object): | ||
class threaded_cached_property: | ||
""" | ||
A cached_property version for use in environments where multiple threads | ||
might concurrently try to access the property. | ||
|
@@ -74,7 +67,7 @@ def __get__(self, obj, cls): | |
return obj_dict.setdefault(name, self.func(obj)) | ||
|
||
|
||
class cached_property_with_ttl(object): | ||
class cached_property_with_ttl: | ||
""" | ||
A property that is only computed once per instance and then replaces itself | ||
with an ordinary attribute. Setting the ttl to a number expresses how long | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Testing and deployment packages. | ||
coverage==4.4.2 | ||
pytest==3.8.2 | ||
pytest-cov==2.6.0 | ||
freezegun==0.3.10 | ||
coverage==7.6.1 | ||
pytest==8.3.3 | ||
pytest-cov==5.0.0 | ||
freezegun==1.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[wheel] | ||
universal = 1 | ||
universal = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
# -*- coding: utf-8 -*- | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.