diff --git a/.github/containers/test-installation/Dockerfile b/.github/containers/test-installation/Dockerfile index ac3de243..f053472d 100644 --- a/.github/containers/test-installation/Dockerfile +++ b/.github/containers/test-installation/Dockerfile @@ -4,7 +4,7 @@ # This Dockerfile is used to test the installation of the python package in # multiple platforms in the CI. It is not used to build the package itself. -FROM --platform=${TARGETPLATFORM} python:3.11-slim +FROM python:3.11-slim RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 043765dc..db41c642 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -28,6 +28,7 @@ * Added a new default option `asyncio_default_fixture_loop_scope = "function"` for `pytest-asyncio` as not providing a value is deprecated. * The migration script is now written in Python, so it should be (hopefully) more compatible with different OSes. * Disable more `pylint` checks that are also checked by `mypy` to avoid false positives. +* Remove the redundant `--platform` from the testing dockerfile. ## Bug Fixes diff --git a/cookiecutter/migrate.py b/cookiecutter/migrate.py index 1fdae3e5..de6f69aa 100644 --- a/cookiecutter/migrate.py +++ b/cookiecutter/migrate.py @@ -166,6 +166,17 @@ def main() -> None: # Add new pylint checks add_pylint_checks() + print("=" * 72) + + # Remove redundant --platform from the dockerfile + dockerfile = Path(".github/containers/test-installation/Dockerfile") + print(f"{dockerfile}: Removing redundant --platform.") + if dockerfile.is_file(): + replace_file_contents_atomically( + dockerfile, "--platform=${TARGETPLATFORM} ", "" + ) + else: + print(f"{dockerfile}: Not found.") # Add a separation line like this one after each migration step. print("=" * 72) diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation/Dockerfile b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation/Dockerfile index 6c408565..9357144d 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation/Dockerfile +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation/Dockerfile @@ -5,7 +5,7 @@ # This Dockerfile is used to test the installation of the python package in # multiple platforms in the CI. It is not used to build the package itself. -FROM --platform=${TARGETPLATFORM} python:3.11-slim +FROM python:3.11-slim RUN apt-get update -y && \ apt-get install --no-install-recommends -y \