Skip to content

Commit

Permalink
Version 1.0.2 - fix Python 3.12 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ratherlargerobot committed Nov 20, 2024
1 parent 794273e commit b729f4a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Uriel changelog
https://nathanrosenquist.com/uriel/
------------------------------------------------------------------------------

VERSION 1.0.2 (Nov 20 17:07 2024)
------------------------------------------------------------------------------
- Fix SyntaxWarning in tag validation regex on Python 3.12
- Fix DeprecationWarning for UTC date handling on Python 3.12

VERSION 1.0.1 (Apr 02 22:01 2024)
------------------------------------------------------------------------------
- Fix typo in README file
Expand Down
13 changes: 7 additions & 6 deletions uriel
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ class Node:
tag = tag.strip()

# validate tag
if not re.match("^[a-z0-9\-]*$", tag):
if not re.match(r"^[a-z0-9\-]*$", tag):
raise UrielError(
"invalid tag '%s' in node '%s'" % \
(tag, self.get_path()))
Expand Down Expand Up @@ -1931,7 +1931,7 @@ class FileNode(Node):
node_modified = os.path.getmtime(node_path)
self.modified = \
datetime.datetime.fromtimestamp(node_modified,
datetime.datetime.utcnow().astimezone().tzinfo)
datetime.datetime.now(datetime.UTC).astimezone().tzinfo)

# read dynamic node file, and parse out headers and body
body_lines = []
Expand Down Expand Up @@ -2032,8 +2032,9 @@ class FileNode(Node):
# create a new datetime with the date/time we read from
# the date string, augmented with the local time zone
if dt.tzinfo is None:
tmp_dt = datetime.datetime.fromtimestamp(dt.timestamp(),
datetime.datetime.utcnow().astimezone().tzinfo)
tmp_dt = datetime.datetime.fromtimestamp(
dt.timestamp(),
datetime.datetime.now(datetime.UTC).astimezone().tzinfo)

dt = tmp_dt

Expand Down Expand Up @@ -2082,7 +2083,7 @@ class VirtualNode(Node):
# use the current date/time/timezone
now = datetime.datetime.fromtimestamp(
datetime.datetime.now().timestamp(),
datetime.datetime.utcnow().astimezone().tzinfo)
datetime.datetime.now(datetime.UTC).astimezone().tzinfo)

self.created = now
self.modified = now
Expand Down Expand Up @@ -2514,7 +2515,7 @@ def augment_node_tree(project_root, root_node):
if not tag_node.has_header("modified"):
now = datetime.datetime.fromtimestamp(
datetime.datetime.now().timestamp(),
datetime.datetime.utcnow().astimezone().tzinfo)
datetime.datetime.now(datetime.UTC).astimezone().tzinfo)

tag_node.created = now
tag_node.modified = now
Expand Down

0 comments on commit b729f4a

Please sign in to comment.