Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade jsonnet and gojsonnet to 0.20.0 #1006

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions kapitan/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,14 @@ def search_imports(cwd, import_str, search_paths):
- search_paths is the location where to look for import_str if not in cwd
The only supported parameters are cwd and import_str, so search_paths
needs to be closured.
This function returns a tuple[str, bytes] since jsonnet 0.19.0 require the
content of the file to be provided as a bytes type instead of a str.
"""
basename = os.path.basename(import_str)
full_import_path = os.path.normpath(os.path.join(cwd, import_str))

if full_import_path in JSONNET_CACHE:
return full_import_path, JSONNET_CACHE[full_import_path]
return full_import_path, JSONNET_CACHE[full_import_path].encode()

if not os.path.exists(full_import_path):
# if import_str not found, search in install_path
Expand Down Expand Up @@ -246,7 +248,7 @@ def search_imports(cwd, import_str, search_paths):
normalised_path_content = f.read()
JSONNET_CACHE[normalised_path] = normalised_path_content

return normalised_path, normalised_path_content
return normalised_path, normalised_path_content.encode()


def inventory(search_paths, target, inventory_path=None):
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ gitpython = "^3.1.30"
google-api-python-client = "^2.15.0"
hvac = "^0.11.0"
jinja2 = "^3.0.1"
jsonnet = "^0.18.0"
jsonnet = "^0.20.0"
jsonschema = "^4.17.3"
kadet = "^0.2.2"
python-gnupg = "^0.4.7"
Expand All @@ -61,7 +61,7 @@ certifi = "*"
gitdb = "^4.0.10"
packaging = "^23.0"
typing-extensions = "^4.0.0"
gojsonnet = { version = "^0.17.0", optional = true }
gojsonnet = { version = "^0.20.0", optional = true }
docker = { version = "^5.0.0", optional = true }

[tool.poetry.extras]
Expand Down
Loading