Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cibuildwheel/projectfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_requires_python_str(package_dir: Path) -> Optional[str]:
pass

try:
with (package_dir / "setup.py").open() as f2:
with (package_dir / "setup.py").open(encoding="utf8") as f2:
return setup_py_python_requires(f2.read())
except FileNotFoundError:
pass
Expand Down
7 changes: 5 additions & 2 deletions unit_test/projectfiles_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_read_setup_py_simple(tmp_path):


def test_read_setup_py_full(tmp_path):
with open(tmp_path / "setup.py", "w") as f:
with open(tmp_path / "setup.py", "w", encoding="utf8") as f:
f.write(
dedent(
"""
Expand All @@ -35,6 +35,7 @@ def test_read_setup_py_full(tmp_path):

setuptools.setup(
name = "hello",
description = "≥“”ü",
other = 23,
example = ["item", "other"],
python_requires = "1.24",
Expand All @@ -43,7 +44,9 @@ def test_read_setup_py_full(tmp_path):
)
)

assert setup_py_python_requires(tmp_path.joinpath("setup.py").read_text()) == "1.24"
assert (
setup_py_python_requires(tmp_path.joinpath("setup.py").read_text(encoding="utf8")) == "1.24"
)
assert get_requires_python_str(tmp_path) == "1.24"


Expand Down