diff --git a/CHANGES.md b/CHANGES.md index 9983f2e4..ba80684a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ ## Changes in version 0.1.0 (in development) +### Fixes + +- Fixed Windows encoding errors in `appligator` Dockerfile generation, replaced + non-ASCII characters with plain ASCII equivalents, and added `encoding="utf-8"` + to `write_text`/`read_text` calls in `gen_dockerfile.py`. + ### Enhancements - Enhanced `appligator` with Dockerfile generation and improved Airflow integration: diff --git a/appligator/src/appligator/airflow/gen_dockerfile.py b/appligator/src/appligator/airflow/gen_dockerfile.py index 70d1c5bd..5b776e20 100644 --- a/appligator/src/appligator/airflow/gen_dockerfile.py +++ b/appligator/src/appligator/airflow/gen_dockerfile.py @@ -186,7 +186,7 @@ def generate( ) dockerfile = output_dir / "Dockerfile" - dockerfile.write_text(content) + dockerfile.write_text(content, encoding="utf-8") return dockerfile diff --git a/appligator/src/appligator/airflow/templates/Dockerfile.pixi.j2 b/appligator/src/appligator/airflow/templates/Dockerfile.pixi.j2 index 4e85017a..156a4435 100644 --- a/appligator/src/appligator/airflow/templates/Dockerfile.pixi.j2 +++ b/appligator/src/appligator/airflow/templates/Dockerfile.pixi.j2 @@ -1,6 +1,6 @@ -# Generated by appligator — do not edit by hand. +# Generated by appligator - do not edit by hand. -# ── Stage 1: build ──────────────────────────────────────────── +# -- Stage 1: build --------------------------------------------------- FROM ghcr.io/prefix-dev/pixi:{{ pixi_version }}-bookworm-slim AS build RUN apt-get update \ @@ -23,7 +23,7 @@ RUN pixi install --locked -e {{ pixi_env }} {{ cmd }} {% endfor %} -# ── Stage 2: runtime ────────────────────────────────────────── +# -- Stage 2: runtime ------------------------------------------------- FROM {{ base_image }} WORKDIR {{ workdir }} diff --git a/appligator/tests/airflow/test_gen_dockerfile.py b/appligator/tests/airflow/test_gen_dockerfile.py index 4991c5d7..8f4d4640 100644 --- a/appligator/tests/airflow/test_gen_dockerfile.py +++ b/appligator/tests/airflow/test_gen_dockerfile.py @@ -37,7 +37,7 @@ def _gen(tmp_path: Path, **kwargs) -> tuple[Path, str]: df = generate(output_dir=out, **kwargs) finally: os.chdir(old) - return df, df.read_text() + return df, df.read_text(encoding="utf-8") class TestValidation: