Fix flake8 errors
This commit is contained in:
+1
-3
@@ -1,3 +1 @@
|
||||
This folder contains repos that are built by cibuildwheel to test cibuildwheel. Confusing, I know.
|
||||
|
||||
Basically, if cibuildwheel can build these projects, we're good.
|
||||
This folder contains integration tests for cibuildwheel.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import io
|
||||
import jinja2
|
||||
from typing import Union, Dict, Any, Optional
|
||||
from typing import Union, Dict, Any
|
||||
|
||||
|
||||
FilesDict = Dict[str, Union[str, jinja2.Template]]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
import textwrap
|
||||
import platform
|
||||
from .template_projects import CTemplateProject
|
||||
from . import utils
|
||||
|
||||
@@ -12,6 +12,7 @@ basic_project = CTemplateProject(
|
||||
''')
|
||||
)
|
||||
|
||||
|
||||
def test(tmpdir):
|
||||
project_dir = str(tmpdir)
|
||||
basic_project.generate(project_dir)
|
||||
@@ -33,10 +34,10 @@ def test_build_identifiers(tmpdir):
|
||||
# after adding CIBW_MANYLINUX_IMAGE to support manylinux2010, there
|
||||
# can be multiple wheels for each wheel, though, so we need to limit
|
||||
# the expected wheels
|
||||
expected_wheels = [
|
||||
w
|
||||
for w in utils.expected_wheels("spam", "0.1.0")
|
||||
if not "-manylinux" in w or "-manylinux1" in w
|
||||
]
|
||||
if platform.machine() in ['x86_64', 'i686']:
|
||||
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
|
||||
if '-manylinux' not in w or '-manylinux1' in w]
|
||||
else:
|
||||
expected_wheels = utils.expected_wheels('spam', '0.1.0')
|
||||
build_identifiers = utils.cibuildwheel_get_build_identifiers(project_dir)
|
||||
assert len(expected_wheels) == len(build_identifiers)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import os, subprocess
|
||||
import pytest, textwrap
|
||||
import os
|
||||
import subprocess
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
|
||||
from . import utils
|
||||
from .template_projects import CTemplateProject
|
||||
|
||||
@@ -39,7 +43,6 @@ def test(tmpdir):
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
|
||||
|
||||
def test_extras_require(tmpdir):
|
||||
project_dir = str(tmpdir)
|
||||
project_with_a_test.generate(project_dir)
|
||||
@@ -74,4 +77,3 @@ def test_failing_test(tmp_path):
|
||||
})
|
||||
|
||||
assert len(os.listdir(output_dir)) == 0
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import os, textwrap
|
||||
import textwrap
|
||||
|
||||
from . import utils
|
||||
from .template_projects import CTemplateProject
|
||||
|
||||
|
||||
project_with_before_build_asserts = CTemplateProject(
|
||||
setup_py_add=textwrap.dedent(r'''
|
||||
import sys, os
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import os, textwrap
|
||||
import textwrap
|
||||
|
||||
from . import utils
|
||||
from .template_projects import CTemplateProject
|
||||
|
||||
|
||||
project_with_skip_asserts = CTemplateProject(
|
||||
setup_py_add=textwrap.dedent(r'''
|
||||
# explode if run on Python 2.7 or Python 3.7 (these should be skipped)
|
||||
@@ -13,6 +13,7 @@ project_with_skip_asserts = CTemplateProject(
|
||||
''')
|
||||
)
|
||||
|
||||
|
||||
def test(tmpdir):
|
||||
project_dir = str(tmpdir)
|
||||
project_with_skip_asserts.generate(project_dir)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import os, pytest, textwrap
|
||||
import platform
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
|
||||
from . import utils
|
||||
from .template_projects import CTemplateProject
|
||||
|
||||
|
||||
dockcross_only_project = CTemplateProject(
|
||||
setup_py_add=textwrap.dedent(r'''
|
||||
import os, sys
|
||||
@@ -16,6 +19,7 @@ dockcross_only_project = CTemplateProject(
|
||||
''')
|
||||
)
|
||||
|
||||
|
||||
def test(tmpdir):
|
||||
if utils.platform != 'linux':
|
||||
pytest.skip('the test is only relevant to the linux build')
|
||||
|
||||
+3
-2
@@ -1,8 +1,8 @@
|
||||
import os, textwrap
|
||||
import textwrap
|
||||
|
||||
from . import utils
|
||||
from .template_projects import CTemplateProject
|
||||
|
||||
|
||||
project_with_ssl_tests = CTemplateProject(
|
||||
setup_py_add=textwrap.dedent(r'''
|
||||
import ssl
|
||||
@@ -21,6 +21,7 @@ project_with_ssl_tests = CTemplateProject(
|
||||
''')
|
||||
)
|
||||
|
||||
|
||||
def test(tmpdir):
|
||||
# this test checks that SSL is working in the build environment using
|
||||
# some checks in setup.py.
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import os, pytest, textwrap, platform
|
||||
import platform
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
|
||||
from . import utils
|
||||
from .template_projects import CTemplateProject
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import os
|
||||
import textwrap
|
||||
|
||||
import jinja2
|
||||
import pytest
|
||||
|
||||
from . import utils
|
||||
from .template_projects import SetuptoolsTemplateProject
|
||||
import jinja2
|
||||
|
||||
cpp_project = SetuptoolsTemplateProject(
|
||||
setup_py_add='''ext_modules=[Extension('spam', sources=['spam.cpp'])],'''
|
||||
)
|
||||
|
||||
cpp_project.files['spam.cpp'] = jinja2.Template(r'''
|
||||
#include <Python.h>
|
||||
|
||||
@@ -63,7 +64,6 @@ MOD_INIT(spam)
|
||||
}
|
||||
''')
|
||||
|
||||
project_dir = os.path.dirname(__file__)
|
||||
|
||||
def test_cpp11(tmpdir):
|
||||
# This test checks that the C++11 standard is supported
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
from .template_projects.c import CTemplateProject
|
||||
from . import utils
|
||||
from test.template_projects.c import CTemplateProject
|
||||
|
||||
before_test_project = CTemplateProject()
|
||||
before_test_project.files['test/spam_test.py'] = r'''
|
||||
@@ -34,6 +33,7 @@ class TestBeforeTest(TestCase):
|
||||
assert os.stat(stored_prefix) == os.stat(sys.prefix)
|
||||
'''
|
||||
|
||||
|
||||
def test(tmpdir):
|
||||
project_dir = str(tmpdir)
|
||||
before_test_project.generate(project_dir)
|
||||
|
||||
Reference in New Issue
Block a user