Merge pull request #420 from henryiii/fix/exfile
fix: Windows extra file
This commit is contained in:
@@ -177,8 +177,14 @@ def pep_518_cp35_workaround(package_dir: Path, env: Dict[str, str]) -> None:
|
|||||||
if 'build-system' in data
|
if 'build-system' in data
|
||||||
else []
|
else []
|
||||||
)
|
)
|
||||||
|
|
||||||
if requirements:
|
if requirements:
|
||||||
shell(['pip', 'install'] + requirements, env=env)
|
with tempfile.TemporaryDirectory() as d:
|
||||||
|
reqfile = Path(d) / "requirements.txt"
|
||||||
|
with reqfile.open("w") as f:
|
||||||
|
for r in requirements:
|
||||||
|
print(r, file=f)
|
||||||
|
call(['pip', 'install', '-r', reqfile], env=env)
|
||||||
|
|
||||||
|
|
||||||
def build(options: BuildOptions) -> None:
|
def build(options: BuildOptions) -> None:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import textwrap
|
import textwrap
|
||||||
from . import test_projects
|
from . import test_projects
|
||||||
from . import utils
|
from . import utils
|
||||||
|
import os
|
||||||
|
|
||||||
basic_project = test_projects.new_c_project(
|
basic_project = test_projects.new_c_project(
|
||||||
setup_py_add=textwrap.dedent(
|
setup_py_add=textwrap.dedent(
|
||||||
@@ -27,6 +28,7 @@ basic_project.files[
|
|||||||
[build-system]
|
[build-system]
|
||||||
requires = [
|
requires = [
|
||||||
"setuptools >= 42",
|
"setuptools >= 42",
|
||||||
|
"setuptools_scm[toml]>=4.1.2",
|
||||||
"wheel",
|
"wheel",
|
||||||
"requests==2.22.0; python_version<'3.6'",
|
"requests==2.22.0; python_version<'3.6'",
|
||||||
"requests==2.23.0; python_version>='3.6'"
|
"requests==2.23.0; python_version>='3.6'"
|
||||||
@@ -47,3 +49,10 @@ def test_pep518(tmp_path):
|
|||||||
# check that the expected wheels are produced
|
# check that the expected wheels are produced
|
||||||
expected_wheels = utils.expected_wheels("spam", "0.1.0")
|
expected_wheels = utils.expected_wheels("spam", "0.1.0")
|
||||||
assert set(actual_wheels) == set(expected_wheels)
|
assert set(actual_wheels) == set(expected_wheels)
|
||||||
|
|
||||||
|
# These checks ensure an extra file is not created when using custom
|
||||||
|
# workaround; see https://github.com/joerick/cibuildwheel/issues/421
|
||||||
|
assert not (project_dir / "42").exists()
|
||||||
|
assert not (project_dir / "4.1.2").exists()
|
||||||
|
|
||||||
|
assert len(os.listdir(project_dir)) == len(basic_project.files)
|
||||||
|
|||||||
Reference in New Issue
Block a user