executiontime 0.3.6__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: executiontime
3
- Version: 0.3.6
3
+ Version: 0.4.0
4
4
  Summary: A simple function decorator to display its execution time on the console or in the logs.
5
5
  License: MIT
6
6
  Keywords: testing,logging,time,performance,execution
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
21
22
  Classifier: Topic :: Software Development :: Testing
22
23
  Requires-Dist: colorama (>=0.4.6,<0.5.0)
23
24
  Description-Content-Type: text/markdown
@@ -2,7 +2,7 @@
2
2
  Defines the printexecutiontime decorator
3
3
  """
4
4
 
5
- from datetime import datetime
5
+ from datetime import datetime, UTC
6
6
  from functools import wraps
7
7
  from typing import Callable, ParamSpec, Optional, TypeVar
8
8
 
@@ -45,9 +45,9 @@ def printexecutiontime(message: str, output: Callable[..., None] = print, color:
45
45
  """
46
46
  This wrapper calculates and displays the execution time of the function.
47
47
  """
48
- start = datetime.utcnow()
48
+ start = datetime.now(tz=UTC)
49
49
  value = function(*args, **kwargs)
50
- elapsed = datetime.utcnow() - start
50
+ elapsed = datetime.now(tz=UTC) - start
51
51
  msg = message.format(elapsed)
52
52
  if color:
53
53
  msg = color + msg + Fore.RESET
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "executiontime"
3
- version = "0.3.6"
3
+ version = "0.4.0"
4
4
  description = "A simple function decorator to display its execution time on the console or in the logs."
5
5
  authors = ["Timokasse <Timokasse@users.noreply.github.com>"]
6
6
  license = "MIT"
@@ -25,7 +25,7 @@ colorama = "^0.4.6"
25
25
 
26
26
  [tool.poetry.group.dev.dependencies]
27
27
  pylint = "^3.0.3"
28
- black = "^24.2.0"
28
+ black = "^25.1.0"
29
29
  mypy = "^1.8.0"
30
30
  types-colorama = "^0.4.15.20240205"
31
31
  pytest = "^8.0.1"
File without changes
File without changes