* Update python versions as part of update_dependencies * refactor: pulling out to update_pythons * refactor: rewrite and expect install * feat: support macos too, logging output * WIP: update * refactor: drive from original file * Remove unused variable * Output a diff instead of the result file, to review changes more easily * fix: minor cleanup Co-authored-by: Henry Fredrick Schreiner <henry.fredrick.schreiner@cern.ch> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Joe Rickerby <joerick@mac.com>
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
import pytest
|
|
import toml
|
|
|
|
from cibuildwheel.util import resources_dir
|
|
|
|
Version = pytest.importorskip("packaging.version").Version
|
|
|
|
from cibuildwheel.extra import InlineArrayDictEncoder # noqa: E402
|
|
|
|
|
|
def test_compare_configs():
|
|
with open(resources_dir / "build-platforms.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
|
|
|
|
|
|
def test_dump_with_Version():
|
|
example = {
|
|
"windows": {
|
|
"python_configurations": [
|
|
{"identifier": "cp27-win32", "version": Version("2.7.18"), "arch": "32"},
|
|
{"identifier": "cp27-win_amd64", "version": Version("2.7.18"), "arch": "64"},
|
|
]
|
|
}
|
|
}
|
|
|
|
result = """\
|
|
[windows]
|
|
python_configurations = [
|
|
{ identifier = "cp27-win32", version = "2.7.18", arch = "32" },
|
|
{ identifier = "cp27-win_amd64", version = "2.7.18", arch = "64" },
|
|
]
|
|
"""
|
|
|
|
output = toml.dumps(example, encoder=InlineArrayDictEncoder())
|
|
print(output)
|
|
assert output == result
|