Fix tests that are "hard coded" to expect x86_64 output by mocking the platform interface. Submitted upstream: https://github.com/pypa/packaging/pull/176 diff --git a/tests/test_tags.py b/tests/test_tags.py index 1eacf68..0a3f1b4 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -435,37 +435,43 @@ class TestManylinuxPlatform: linux_platform = list(tags._linux_platforms(is_32bit=False)) assert linux_platform == ["linux_x86_64"] - def test_linux_platforms_manylinux1(self, monkeypatch): + def test_linux_platforms_manylinux1(self, is_x86, monkeypatch): monkeypatch.setattr( tags, "_is_manylinux_compatible", lambda name, _: name == "manylinux1" ) - if platform.system() != "Linux": + if platform.system() != "Linux" or not is_x86: monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + monkeypatch.setattr(platform, "machine", lambda: "x86_64") platforms = list(tags._linux_platforms(is_32bit=False)) - assert platforms == ["manylinux1_x86_64", "linux_x86_64"] + arch = platform.machine() + assert platforms == ["manylinux1_" + arch, "linux_" + arch] - def test_linux_platforms_manylinux2010(self, monkeypatch): + def test_linux_platforms_manylinux2010(self, is_x86, monkeypatch): monkeypatch.setattr( tags, "_is_manylinux_compatible", lambda name, _: name == "manylinux2010" ) - if platform.system() != "Linux": + if platform.system() != "Linux" or not is_x86: monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + monkeypatch.setattr(platform, "machine", lambda: "x86_64") platforms = list(tags._linux_platforms(is_32bit=False)) - expected = ["manylinux2010_x86_64", "manylinux1_x86_64", "linux_x86_64"] + arch = platform.machine() + expected = ["manylinux2010_" + arch, "manylinux1_" + arch, "linux_" + arch] assert platforms == expected - def test_linux_platforms_manylinux2014(self, monkeypatch): + def test_linux_platforms_manylinux2014(self, is_x86, monkeypatch): monkeypatch.setattr( tags, "_is_manylinux_compatible", lambda name, _: name == "manylinux2014" ) - if platform.system() != "Linux": + if platform.system() != "Linux" or not is_x86: monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + monkeypatch.setattr(platform, "machine", lambda: "x86_64") platforms = list(tags._linux_platforms(is_32bit=False)) + arch = platform.machine() expected = [ - "manylinux2014_x86_64", - "manylinux2010_x86_64", - "manylinux1_x86_64", - "linux_x86_64", + "manylinux2014_" + arch, + "manylinux2010_" + arch, + "manylinux1_" + arch, + "linux_" + arch, ] assert platforms == expected td> 2020-11-16gnu: bootloader: Support chain loading to an EFI bootloader....* gnu/bootloader.scm (efi-bootloader-profile): New function. (efi-bootloader-chain): New function. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Stefan 2020-06-08bootloader: Extend `<menu-entry>' for multiboot....* gnu/bootloader.scm (<menu-entry>)[multiboot-kernel,multiboot-arguments, multiboot-modules]: New fields. [linux,initrd]: Add default value '#f'. (menu-entry->sexp, sexp->menu-entry): Support multiboot entry. * doc/guix.texi (Bootloader Configuration): Document them. Jan (janneke) Nieuwenhuizen 2020-05-29bootloader: Add 'disk-image-installer'....* gnu/bootloader.scm (<bootloader>)[disk-image-installer]: New field, (bootloader-disk-image-installer): export it. * gnu/bootloader/grub.scm (install-grub-disk-image): New procedure ... (grub-bootloader): ... used as "disk-image-installer" here. (grub-efi-bootloader): set "disk-image-installer" to #f. * gnu/system/image.scm (root-partition?, find-root-partition): Move to "Helpers" section. (root-partition-index): New procedure. (system-disk-image): Honor disk-image-installer, and use it to install the bootloader directly on the disk-image, if supported. Mathieu Othacehe 2019-08-30system: Add 'bootloader-menu-entries' field to <boot-parameters>....This allows us to keep track of the extra menu entries specified in the OS configuration. * gnu/system.scm (<boot-parameters>)[bootloader-menu-entries]: New field. (read-boot-parameters): Initialize it. (operating-system-boot-parameters): Likewise. (operating-system-boot-parameters-file): Serialize it. * gnu/bootloader.scm (menu-entry->sexp, sexp->menu-entry): New procedures. Ludovic Courtès 2019-08-30bootloader: Fix comment about 'menu-entries'....* gnu/bootloader.scm (<bootloader-configuration>)[menu-entries]: Fix margin comment. Ludovic Courtès