diff --git a/.gitignore b/.gitignore index bce69ac0b..f84adbc6c 100644 --- a/.gitignore +++ b/.gitignore @@ -295,3 +295,6 @@ build.* cognite_toolkit/.env.* module_upgrade/project_inits function_local_venvs/ +# For newer versions of the toolkit +tests/data/run_data/build_info.dev.yaml +cdf.toml diff --git a/CHANGELOG.cdf-tk.md b/CHANGELOG.cdf-tk.md index 3b621fc5f..878faa732 100644 --- a/CHANGELOG.cdf-tk.md +++ b/CHANGELOG.cdf-tk.md @@ -15,6 +15,13 @@ Changes are grouped as follows: - `Fixed` for any bug fixes. - `Security` in case of vulnerabilities. +## [0.2.22] - 2024-10-03 + +### Fixed + +- On `Windows` if you use a no `utf-8` encoded files, the `cdf-tk` deploy no longer raises + `ERROR [ERROR]: SourceFileModifiedWarning: The source file...` + ## [0.2.21] - 2024-09-13 ### Fixed diff --git a/CHANGELOG.templates.md b/CHANGELOG.templates.md index 071987537..8970ca4ad 100644 --- a/CHANGELOG.templates.md +++ b/CHANGELOG.templates.md @@ -15,6 +15,10 @@ Changes are grouped as follows: - `Fixed` for any bug fixes. - `Security` in case of vulnerabilities. +## [0.2.22] - 2024-10-03 + +No changes to templates. + ## [0.2.21] - 2024-09-13 No changes to templates. diff --git a/cognite_toolkit/_cdf_tk/_migration.yaml b/cognite_toolkit/_cdf_tk/_migration.yaml index bf7359778..43264f123 100644 --- a/cognite_toolkit/_cdf_tk/_migration.yaml +++ b/cognite_toolkit/_cdf_tk/_migration.yaml @@ -1,8 +1,13 @@ -- version: 0.2.21 +- version: 0.2.22 cognite_modules: {} resources: {} tool: {} cognite_modules_hash: "" +- version: 0.2.21 + cognite_modules: {} + resources: {} + tool: {} + cognite_modules_hash: "7c4a533b6c06cf9399b4e1aa8a784c0da54a5b5c6bedf96ed52848aa85fcb6da" - version: 0.2.20 cognite_modules: {} resources: {} diff --git a/cognite_toolkit/_cdf_tk/utils.py b/cognite_toolkit/_cdf_tk/utils.py index dd1f13fe5..7a07e4103 100644 --- a/cognite_toolkit/_cdf_tk/utils.py +++ b/cognite_toolkit/_cdf_tk/utils.py @@ -978,7 +978,7 @@ def calculate_secure_hash(item: dict[str, Any]) -> str: def calculate_str_or_file_hash(content: str | Path) -> str: sha256_hash = hashlib.sha256() if isinstance(content, Path): - content = content.read_text(encoding="utf-8") + content = safe_read(content) # Get rid of Windows line endings to make the hash consistent across platforms. sha256_hash.update(content.encode("utf-8").replace(b"\r\n", b"\n")) return sha256_hash.hexdigest() diff --git a/cognite_toolkit/_system.yaml b/cognite_toolkit/_system.yaml index 1c220b6a5..6e80a249f 100644 --- a/cognite_toolkit/_system.yaml +++ b/cognite_toolkit/_system.yaml @@ -25,4 +25,4 @@ packages: - example_pump_data_model # This part is used by cdf-toolkit to keep track of the version and help you upgrade. -cdf_toolkit_version: 0.2.21 \ No newline at end of file +cdf_toolkit_version: 0.2.22 \ No newline at end of file diff --git a/cognite_toolkit/_version.py b/cognite_toolkit/_version.py index 4c38b9247..1f5a8f345 100644 --- a/cognite_toolkit/_version.py +++ b/cognite_toolkit/_version.py @@ -1 +1 @@ -__version__ = "0.2.21" +__version__ = "0.2.22" diff --git a/pyproject.toml b/pyproject.toml index 033f0ed5c..d53745024 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cognite_toolkit" -version = "0.2.21" +version = "0.2.22" description = "Official Cognite Data Fusion tool for project templates and configuration deployment" authors = ["Cognite AS "] license = "Apache-2" diff --git a/tests/data/build_core_model/_build_environment.yaml b/tests/data/build_core_model/_build_environment.yaml index 45e0b8371..7d22630e7 100644 --- a/tests/data/build_core_model/_build_environment.yaml +++ b/tests/data/build_core_model/_build_environment.yaml @@ -4,4 +4,4 @@ project: project-loader-dev type: dev selected: - modules -cdf_toolkit_version: 0.2.21 +cdf_toolkit_version: 0.2.22 diff --git a/tests/data/build_group_with_unknown_acl/_build_environment.yaml b/tests/data/build_group_with_unknown_acl/_build_environment.yaml index 82e0a85a1..401d1454f 100644 --- a/tests/data/build_group_with_unknown_acl/_build_environment.yaml +++ b/tests/data/build_group_with_unknown_acl/_build_environment.yaml @@ -4,4 +4,4 @@ project: pytest-project type: dev selected: - modules -cdf_toolkit_version: 0.2.21 +cdf_toolkit_version: 0.2.22 diff --git a/tests/data/project_for_test/_system.yaml b/tests/data/project_for_test/_system.yaml index b74721894..76791d61e 100644 --- a/tests/data/project_for_test/_system.yaml +++ b/tests/data/project_for_test/_system.yaml @@ -4,4 +4,4 @@ packages: - child_module # This part is used by cdf-toolkit to keep track of the version and help you upgrade. -cdf_toolkit_version: 0.2.21 +cdf_toolkit_version: 0.2.22 diff --git a/tests/data/project_no_cognite_modules/_system.yaml b/tests/data/project_no_cognite_modules/_system.yaml index ca3fb4722..8b84a79ce 100644 --- a/tests/data/project_no_cognite_modules/_system.yaml +++ b/tests/data/project_no_cognite_modules/_system.yaml @@ -3,4 +3,4 @@ packages: {} # This part is used by cdf-toolkit to keep track of the version and help you upgrade. -cdf_toolkit_version: 0.2.21 +cdf_toolkit_version: 0.2.22 diff --git a/tests/data/project_with_bad_modules/_system.yaml b/tests/data/project_with_bad_modules/_system.yaml index ca3fb4722..8b84a79ce 100644 --- a/tests/data/project_with_bad_modules/_system.yaml +++ b/tests/data/project_with_bad_modules/_system.yaml @@ -3,4 +3,4 @@ packages: {} # This part is used by cdf-toolkit to keep track of the version and help you upgrade. -cdf_toolkit_version: 0.2.21 +cdf_toolkit_version: 0.2.22 diff --git a/tests/data/run_data/_system.yaml b/tests/data/run_data/_system.yaml index 9fca0f60f..14e3090e9 100644 --- a/tests/data/run_data/_system.yaml +++ b/tests/data/run_data/_system.yaml @@ -25,4 +25,4 @@ packages: - example_pump_data_model # This part is used by cdf-toolkit to keep track of the version and help you upgrade. -cdf_toolkit_version: 0.2.21 +cdf_toolkit_version: 0.2.22