Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes in build_wheel #11873

Merged
merged 1 commit into from
Dec 30, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions misc/build_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,14 @@ def create_environ(python_version: str) -> Dict[str, str]:

# lxml doesn't have a wheel for Python 3.10 on the manylinux image we use.
# lxml has historically been slow to support new Pythons as well.
env['CIBW_BEFORE_TEST'] = (
'pip install -r <(grep -v lxml {project}/mypy/test-requirements.txt)'
)
env['CIBW_BEFORE_TEST'] = """
(
grep -v lxml {project}/mypy/test-requirements.txt > /tmp/test-requirements.txt
&& cp {project}/mypy/mypy-requirements.txt /tmp/mypy-requirements.txt
&& cp {project}/mypy/build-requirements.txt /tmp/build-requirements.txt
&& pip install -r /tmp/test-requirements.txt
)
""".replace('\n', ' ')

# pytest looks for configuration files in the parent directories of where the tests live.
# since we are trying to run the tests from their installed location, we copy those into
Expand All @@ -94,7 +99,7 @@ def create_environ(python_version: str) -> Dict[str, str]:
&& MYPY_TEST_PREFIX='{project}/mypy' pytest $MYPY_TEST_DIR -k 'not (reports.test or testreports)'

&& MYPYC_TEST_DIR=$(python -c 'import mypyc.test; print(mypyc.test.__path__[0])')
&& pytest $MYPYC_TEST_DIR -k 'not test_external'
&& MYPY_TEST_PREFIX='{project}/mypy' pytest $MYPYC_TEST_DIR -k 'not test_external'
)
""".replace('\n', ' ')

Expand Down
12 changes: 8 additions & 4 deletions mypyc/test/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import os

this_file_dir = os.path.dirname(os.path.realpath(__file__))
prefix = os.path.dirname(os.path.dirname(this_file_dir))
provided_prefix = os.getenv('MYPY_TEST_PREFIX', None)
if provided_prefix:
PREFIX = provided_prefix
else:
this_file_dir = os.path.dirname(os.path.realpath(__file__))
PREFIX = os.path.dirname(os.path.dirname(this_file_dir))

# Locations of test data files such as test case descriptions (.test).
test_data_prefix = os.path.join(prefix, 'mypyc', 'test-data')
# Location of test data files such as test case descriptions.
test_data_prefix = os.path.join(PREFIX, 'mypyc', 'test-data')