update poetry to 1.1.11

This commit is contained in:
Dmitry Afanasyev 2021-10-09 21:11:57 +03:00
parent f23f2beb65
commit 67c78c0632
2 changed files with 9 additions and 10 deletions

View File

@ -1,6 +1,5 @@
import datetime
from functools import wraps from functools import wraps
from datetime import datetime import time
def func_exec_count(func): def func_exec_count(func):
@ -19,10 +18,10 @@ def execution_time(time_form='sec'):
def wrapper(func): def wrapper(func):
@wraps(func) @wraps(func)
def new_func(*args, **kwargs): def new_func(*args, **kwargs):
begin = datetime.now() begin = time.time()
result = func(*args, **kwargs) result = func(*args, **kwargs)
end = datetime.now() end = time.time()
exec_time = (end - begin).seconds / multiply[time_form] exec_time = (end - begin) / multiply[time_form]
print(f'Duration, {time_form}: {exec_time}') print(f'Duration, {time_form}: {exec_time}')
return result return result
return new_func return new_func
@ -30,16 +29,16 @@ def execution_time(time_form='sec'):
@func_exec_count @func_exec_count
@execution_time() # @execution_time()
def summary(x: int, y: int) -> int: def summary(x: int, y: int) -> int:
z = x + y z = x + y
return z return z
@execution_time(time_form='min') @execution_time(time_form='sec')
def main(): def main():
result = 0 result = 0
for i in range(1, 11): for i in range(1, 10**7):
result += summary(i, 100) result += summary(i, 100)
print(result) print(result)
print(summary.count, summary.__name__) print(summary.count, summary.__name__)

View File

@ -1,4 +1,4 @@
FROM python:3.8.5 FROM python:3.9.7
# python: # python:
ENV PYTHONFAULTHANDLER=1 \ ENV PYTHONFAULTHANDLER=1 \
@ -10,7 +10,7 @@ ENV PYTHONFAULTHANDLER=1 \
PIP_DISABLE_PIP_VERSION_CHECK=on \ PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \ PIP_DEFAULT_TIMEOUT=100 \
# poetry: # poetry:
POETRY_VERSION=1.1.4 \ POETRY_VERSION=1.1.11 \
POETRY_NO_INTERACTION=1 \ POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \ POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry' \ POETRY_CACHE_DIR='/var/cache/pypoetry' \