forked from goodboy/tractor
1
0
Fork 0

Make windows job names explicit

try_trip^2
Tyler Goodlet 2020-01-26 22:09:32 -05:00
parent e18fec9b17
commit 7c1bc1fce4
2 changed files with 15 additions and 13 deletions

View File

@ -4,7 +4,7 @@ sudo: required
matrix: matrix:
include: include:
- name: "Windows, Python Latest" - name: "Windows, Python Latest: multiprocessing"
os: windows os: windows
language: sh language: sh
python: 3.x # only works on linux python: 3.x # only works on linux
@ -13,7 +13,7 @@ matrix:
- export PATH="/c/Python:/c/Python/Scripts:$PATH" - export PATH="/c/Python:/c/Python/Scripts:$PATH"
- python -m pip install --upgrade pip wheel - python -m pip install --upgrade pip wheel
- name: "Windows, Python 3.7" - name: "Windows, Python 3.7: multiprocessing"
os: windows os: windows
python: 3.7 # only works on linux python: 3.7 # only works on linux
language: sh language: sh
@ -24,17 +24,17 @@ matrix:
- name: "Python 3.7: multiprocessing" - name: "Python 3.7: multiprocessing"
python: 3.7 # this works for Linux but is ignored on macOS or Windows python: 3.7 # this works for Linux but is ignored on macOS or Windows
env: SPAWN_BACKEND=mp env: SPAWN_BACKEND="mp"
- name: "Python 3.7: trio-run-in-process" - name: "Python 3.7: trio-run-in-process"
python: 3.7 # this works for Linux but is ignored on macOS or Windows python: 3.7 # this works for Linux but is ignored on macOS or Windows
env: SPAWN_BACKEND=trio_run_in_process env: SPAWN_BACKEND="trio_run_in_process"
- name: "Pytron 3.8: multiprocessing" - name: "Pytron 3.8: multiprocessing"
python: 3.8 # this works for Linux but is ignored on macOS or Windows python: 3.8 # this works for Linux but is ignored on macOS or Windows
env: SPAWN_BACKEND=mp env: SPAWN_BACKEND="mp"
- name: "Python 3.8: trio-run-in-process" - name: "Python 3.8: trio-run-in-process"
python: 3.8 # this works for Linux but is ignored on macOS or Windows python: 3.8 # this works for Linux but is ignored on macOS or Windows
env: SPAWN_BACKEND=trio_run_in_process env: SPAWN_BACKEND="trio_run_in_process"
install: install:
- cd $TRAVIS_BUILD_DIR - cd $TRAVIS_BUILD_DIR
@ -43,4 +43,4 @@ install:
script: script:
- mypy tractor/ --ignore-missing-imports - mypy tractor/ --ignore-missing-imports
- pytest tests/ --no-print-logs --spawn-backend=$SPAWN_BACKEND - pytest tests/ --no-print-logs --spawn-backend=${SPAWN_BACKEND}

View File

@ -29,7 +29,7 @@ def pytest_addoption(parser):
def pytest_configure(config): def pytest_configure(config):
backend = config.option.spawn_backend backend = config.option.spawn_backend
if plaform.system() == "Windows": if platform.system() == "Windows":
backend = 'mp' backend = 'mp'
if backend == 'mp': if backend == 'mp':
@ -59,13 +59,15 @@ def pytest_generate_tests(metafunc):
if spawn_backend == 'mp': if spawn_backend == 'mp':
from multiprocessing import get_all_start_methods from multiprocessing import get_all_start_methods
methods = get_all_start_methods() methods = get_all_start_methods()
if 'fork' in methods: # fork not available on windows, so check before removing if 'fork' in methods:
# XXX: the fork method is in general incompatible with # fork not available on windows, so check before
# trio's global scheduler state # removing XXX: the fork method is in general
# incompatible with trio's global scheduler state
methods.remove('fork') methods.remove('fork')
elif spawn_backend == 'trio_run_in_process': elif spawn_backend == 'trio_run_in_process':
if platform.system() == "Windows": if platform.system() == "Windows":
pytest.fail("Only `--spawn-backend=mp` is supported on Windows") pytest.fail(
"Only `--spawn-backend=mp` is supported on Windows")
methods = ['trio_run_in_process'] methods = ['trio_run_in_process']