Skip to content

Commit

Permalink
Tidy ups, bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joerick authored and henryiii committed Apr 27, 2022
1 parent 898dd62 commit 8c77d5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
4 changes: 2 additions & 2 deletions cibuildwheel/from_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def main() -> None:
the package directory.
""",
),
epilog="""Any further arguments will be passed on to cibuildwheel.""",
epilog="Any further arguments will be passed on to cibuildwheel.",
formatter_class=argparse.RawDescriptionHelpFormatter,
)

Expand Down Expand Up @@ -65,7 +65,7 @@ def main() -> None:

temp_dir_contents = list(temp_dir.iterdir())

if len(temp_dir_contents) != 1 or not temp_dir_contents[0].is_dir:
if len(temp_dir_contents) != 1 or not temp_dir_contents[0].is_dir():
exit("invalid sdist: didn't contain a single dir")

project_dir = temp_dir_contents[0]
Expand Down
21 changes: 8 additions & 13 deletions test/test_from_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

from . import test_projects, utils

basic_project = test_projects.new_c_project()


# utilities


Expand Down Expand Up @@ -54,6 +51,8 @@ def cibuildwheel_from_sdist_run(sdist_path, add_env=None, config_file=None):


def test_simple(tmp_path):
basic_project = test_projects.new_c_project()

# make an sdist of the project
sdist_dir = tmp_path / "sdist"
sdist_dir.mkdir()
Expand All @@ -62,9 +61,7 @@ def test_simple(tmp_path):
# build the wheels from sdist
actual_wheels = cibuildwheel_from_sdist_run(
sdist_path,
add_env={
"CIBW_BUILD": "cp39-*",
},
add_env={"CIBW_BUILD": "cp39-*"},
)

# check that the expected wheels are produced
Expand All @@ -73,6 +70,8 @@ def test_simple(tmp_path):


def test_external_config_file_argument(tmp_path, capfd):
basic_project = test_projects.new_c_project()

# make an sdist of the project
sdist_dir = tmp_path / "sdist"
sdist_dir.mkdir()
Expand All @@ -92,9 +91,7 @@ def test_external_config_file_argument(tmp_path, capfd):
# build the wheels from sdist
actual_wheels = cibuildwheel_from_sdist_run(
sdist_path,
add_env={
"CIBW_BUILD": "cp39-*",
},
add_env={"CIBW_BUILD": "cp39-*"},
config_file=config_file,
)

Expand Down Expand Up @@ -159,12 +156,10 @@ def test_internal_config_file_argument(tmp_path, capfd):
sdist_dir.mkdir()
sdist_path = make_sdist(project, sdist_dir)

# build the wheels from sdist
# build the wheels from sdist, referencing the config file inside
actual_wheels = cibuildwheel_from_sdist_run(
sdist_path,
add_env={
"CIBW_BUILD": "cp39-*",
},
add_env={"CIBW_BUILD": "cp39-*"},
config_file="{project}/wheel_build_config.toml",
)

Expand Down

0 comments on commit 8c77d5e

Please sign in to comment.