Skip to content

Commit

Permalink
WIP: try round trip
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Jan 5, 2021
1 parent f2d4de2 commit a59ac64
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 32 deletions.
64 changes: 32 additions & 32 deletions cibuildwheel/resources/linux.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
[tool.cibw.build-platforms]
linux = [
{identifier="cp27-manylinux_x86_64", version="2.7", path_str="/opt/python/cp27-cp27m"},
{identifier="cp27-manylinux_x86_64", version="2.7", path_str="/opt/python/cp27-cp27mu"},
{identifier="cp35-manylinux_x86_64", version="3.5", path_str="/opt/python/cp35-cp35m"},
{identifier="cp36-manylinux_x86_64", version="3.6", path_str="/opt/python/cp36-cp36m"},
{identifier="cp37-manylinux_x86_64", version="3.7", path_str="/opt/python/cp37-cp37m"},
{identifier="cp38-manylinux_x86_64", version="3.8", path_str="/opt/python/cp38-cp38"},
{identifier="cp39-manylinux_x86_64", version="3.9", path_str="/opt/python/cp39-cp39"},
{identifier="cp27-manylinux_i686", version="2.7", path_str="/opt/python/cp27-cp27m"},
{identifier="cp27-manylinux_i686", version="2.7", path_str="/opt/python/cp27-cp27mu"},
{identifier="cp35-manylinux_i686", version="3.5", path_str="/opt/python/cp35-cp35m"},
{identifier="cp36-manylinux_i686", version="3.6", path_str="/opt/python/cp36-cp36m"},
{identifier="cp37-manylinux_i686", version="3.7", path_str="/opt/python/cp37-cp37m"},
{identifier="cp38-manylinux_i686", version="3.8", path_str="/opt/python/cp38-cp38"},
{identifier="cp39-manylinux_i686", version="3.9", path_str="/opt/python/cp39-cp39"},
{identifier="pp27-manylinux_x86_64", version="2.7", path_str="/opt/python/pp27-pypy_73"},
{identifier="pp36-manylinux_x86_64", version="3.6", path_str="/opt/python/pp36-pypy36_pp73"},
{identifier="pp37-manylinux_x86_64", version="3.7", path_str="/opt/python/pp37-pypy37_pp73"},
{identifier="cp35-manylinux_aarch64", version="3.5", path_str="/opt/python/cp35-cp35m"},
{identifier="cp36-manylinux_aarch64", version="3.6", path_str="/opt/python/cp36-cp36m"},
{identifier="cp37-manylinux_aarch64", version="3.7", path_str="/opt/python/cp37-cp37m"},
{identifier="cp38-manylinux_aarch64", version="3.8", path_str="/opt/python/cp38-cp38"},
{identifier="cp39-manylinux_aarch64", version="3.9", path_str="/opt/python/cp39-cp39"},
{identifier="cp35-manylinux_ppc64le", version="3.5", path_str="/opt/python/cp35-cp35m"},
{identifier="cp36-manylinux_ppc64le", version="3.6", path_str="/opt/python/cp36-cp36m"},
{identifier="cp37-manylinux_ppc64le", version="3.7", path_str="/opt/python/cp37-cp37m"},
{identifier="cp38-manylinux_ppc64le", version="3.8", path_str="/opt/python/cp38-cp38"},
{identifier="cp39-manylinux_ppc64le", version="3.9", path_str="/opt/python/cp39-cp39"},
{identifier="cp35-manylinux_s390x", version="3.5", path_str="/opt/python/cp35-cp35m"},
{identifier="cp36-manylinux_s390x", version="3.6", path_str="/opt/python/cp36-cp36m"},
{identifier="cp37-manylinux_s390x", version="3.7", path_str="/opt/python/cp37-cp37m"},
{identifier="cp38-manylinux_s390x", version="3.8", path_str="/opt/python/cp38-cp38"},
{identifier="cp39-manylinux_s390x", version="3.9", path_str="/opt/python/cp39-cp39"},
{ identifier = "cp27-manylinux_x86_64", version = "2.7", path_str = "/opt/python/cp27-cp27m" },
{ identifier = "cp27-manylinux_x86_64", version = "2.7", path_str = "/opt/python/cp27-cp27mu" },
{ identifier = "cp35-manylinux_x86_64", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
{ identifier = "cp36-manylinux_x86_64", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
{ identifier = "cp37-manylinux_x86_64", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
{ identifier = "cp38-manylinux_x86_64", version = "3.8", path_str = "/opt/python/cp38-cp38" },
{ identifier = "cp39-manylinux_x86_64", version = "3.9", path_str = "/opt/python/cp39-cp39" },
{ identifier = "cp27-manylinux_i686", version = "2.7", path_str = "/opt/python/cp27-cp27m" },
{ identifier = "cp27-manylinux_i686", version = "2.7", path_str = "/opt/python/cp27-cp27mu" },
{ identifier = "cp35-manylinux_i686", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
{ identifier = "cp36-manylinux_i686", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
{ identifier = "cp37-manylinux_i686", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
{ identifier = "cp38-manylinux_i686", version = "3.8", path_str = "/opt/python/cp38-cp38" },
{ identifier = "cp39-manylinux_i686", version = "3.9", path_str = "/opt/python/cp39-cp39" },
{ identifier = "pp27-manylinux_x86_64", version = "2.7", path_str = "/opt/python/pp27-pypy_73" },
{ identifier = "pp36-manylinux_x86_64", version = "3.6", path_str = "/opt/python/pp36-pypy36_pp73" },
{ identifier = "pp37-manylinux_x86_64", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" },
{ identifier = "cp35-manylinux_aarch64", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
{ identifier = "cp36-manylinux_aarch64", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
{ identifier = "cp37-manylinux_aarch64", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
{ identifier = "cp38-manylinux_aarch64", version = "3.8", path_str = "/opt/python/cp38-cp38" },
{ identifier = "cp39-manylinux_aarch64", version = "3.9", path_str = "/opt/python/cp39-cp39" },
{ identifier = "cp35-manylinux_ppc64le", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
{ identifier = "cp36-manylinux_ppc64le", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
{ identifier = "cp37-manylinux_ppc64le", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
{ identifier = "cp38-manylinux_ppc64le", version = "3.8", path_str = "/opt/python/cp38-cp38" },
{ identifier = "cp39-manylinux_ppc64le", version = "3.9", path_str = "/opt/python/cp39-cp39" },
{ identifier = "cp35-manylinux_s390x", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
{ identifier = "cp36-manylinux_s390x", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
{ identifier = "cp37-manylinux_s390x", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
{ identifier = "cp38-manylinux_s390x", version = "3.8", path_str = "/opt/python/cp38-cp38" },
{ identifier = "cp39-manylinux_s390x", version = "3.9", path_str = "/opt/python/cp39-cp39" },
]
28 changes: 28 additions & 0 deletions unit_test/test_build_ids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import toml
from toml.encoder import TomlEncoder

from cibuildwheel.util import resources_dir


class InlineArrayDictEncoder(TomlEncoder):
def dump_sections(self, o: dict, sup: str):
if all(isinstance(a, list) for a in o.values()):
val = ""
for k, v in o.items():
inner = ",\n ".join(self.dump_inline_table(d_i).strip() for d_i in v)
val += f"{k} = [\n {inner},\n]\n"
return val, self._dict()
else:
return super().dump_sections(o, sup)


def test_compare_configs():
with open(resources_dir / "linux.toml") as f:
txt = f.read()

dict_txt = toml.loads(txt)

new_txt = toml.dumps(dict_txt, encoder=InlineArrayDictEncoder())
print(new_txt)

assert new_txt == txt

0 comments on commit a59ac64

Please sign in to comment.