Skip to content

Commit

Permalink
Chore: Restore compatibility with Python 3.8 and 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Sep 19, 2024
1 parent f640524 commit 3a1c82b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ dependencies = [
"attrs<25",
"backports-strenum<1.3; python_version<'3.11'",
"cattrs<25",
"importlib-resources<6.5; python_version<'3.10'",
"python-dateutil<3",
"simplejson<4",
"sqlalchemy-cratedb>=0.39.0",
Expand Down
11 changes: 8 additions & 3 deletions src/zyp/util/expression.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import importlib
import importlib.resources
import sys

if sys.version_info >= (3, 10):
from importlib.resources import files as resource_files
else: # pragma: no cover
from importlib_resources import files as resource_files

import typing as t

import jmespath
Expand All @@ -10,7 +15,7 @@

# TODO: Is there a better way to configure jq using a custom search path
# instead of injecting the `include` statement each time again?
jq_functions_path = importlib.resources.files("zyp")
jq_functions_path = resource_files("zyp")
jq_functions_import = f'include "function" {{"search": "{jq_functions_path}"}};'


Expand Down

0 comments on commit 3a1c82b

Please sign in to comment.