From b02bc5c8a3308ebbe7f322f965b4f2402cbd9325 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 1 Jun 2019 21:46:12 +0200 Subject: [PATCH 1/6] Revert "Disable travis builds on 3.8 (#6912)" This reverts commit 3c64bcaaaaa31315b3e442a9ecc7807f98482335. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b87e8a4b94df..32a35205c63b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,8 +41,8 @@ jobs: - TOXENV=py - EXTRA_ARGS="-n 12" - TEST_MYPYC=1 - # - name: "run test suite with python 3.8-dev" - # python: 3.8-dev + - name: "run test suite with python 3.8-dev" + python: 3.8-dev - name: "type check our own code" python: 3.7 env: From 6e41b4792bb832aa38d2f05fd1375965b80bc81e Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 1 Jun 2019 21:51:30 +0200 Subject: [PATCH 2/6] tests: skip testreports with missing lxml Ref: https://github.com/python/mypy/pull/6912#issuecomment-497972587 --- mypy/test/testreports.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mypy/test/testreports.py b/mypy/test/testreports.py index 84ac3e005bec..82c4c0e53202 100644 --- a/mypy/test/testreports.py +++ b/mypy/test/testreports.py @@ -4,7 +4,12 @@ from mypy.test.helpers import Suite, assert_equal from mypy.report import CoberturaPackage, get_line_rate -import lxml.etree as etree # type: ignore +try: + import lxml.etree as etree # type: ignore +except Exception as exc: + import pytest # type: ignore # no pytest in typeshed + + pytestmark = pytest.mark.skip("no lxml: {}".format(exc)) class CoberturaReportSuite(Suite): From 4c0c0feea8d4335e79c29fdb34bec7bc5b4e6223 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 3 Jun 2019 09:12:01 +0200 Subject: [PATCH 3/6] TEMP: less jobs --- .travis.yml | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/.travis.yml b/.travis.yml index 32a35205c63b..519653c60433 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,54 +18,8 @@ jobs: - name: "run test suite with python 3.5.1" python: 3.5.1 dist: trusty - - name: "run test suite with python 3.6" - python: 3.6 # 3.6.3 pip 9.0.1 - - name: "run test suite with python 3.7" - python: 3.7 # 3.7.0 pip 10.0.1 - - name: "run test suite with python 3.5.1 (new semantic analyzer)" - python: 3.5.1 - dist: trusty - env: - - TOXENV=py - - EXTRA_ARGS="-n 12" - - NEWSEMANAL=1 - - name: "run test suite with python 3.7 (new semantic analyzer)" - python: 3.7 - env: - - TOXENV=py - - EXTRA_ARGS="-n 12" - - NEWSEMANAL=1 - - name: "run test suite with python 3.7 (compiled with mypyc)" - python: 3.7 - env: - - TOXENV=py - - EXTRA_ARGS="-n 12" - - TEST_MYPYC=1 - name: "run test suite with python 3.8-dev" python: 3.8-dev - - name: "type check our own code" - python: 3.7 - env: - - TOXENV=type - - EXTRA_ARGS= - - name: "check code style with flake8" - python: 3.7 - env: - - TOXENV=lint - - EXTRA_ARGS= - - name: "trigger a build of wheels" - python: 3.7 - script: if [[ ($TRAVIS_BRANCH = "master" || $TRAVIS_BRANCH =~ release-*) && $TRAVIS_PULL_REQUEST = "false" ]]; then ./misc/trigger_wheel_build.sh; fi - - name: "check documentation build" - python: 3.7 - env: - - TOXENV=docs - # Disabled because of some pip bug? See #6716 - # - name: "check dev environment builds" - # python: 3.7 - # env: - # - TOXENV=dev - # - EXTRA_ARGS= install: - pip install -U pip setuptools From c3639d1aa194c38bc486724838f7ccf47eb3d23b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 3 Jun 2019 09:08:44 +0200 Subject: [PATCH 4/6] test-requirements.txt: do not install lxml for py38 --- test-requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 6ce7e3856bb1..18e4d76197ed 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,8 @@ attrs>=18.0 flake8>=3.7 flake8-bugbear; python_version >= '3.5' flake8-pyi; python_version >= '3.6' -lxml>=4.2.4 +# Temporarily disabled, until fixed for py38. +lxml>=4.2.4; python_version < '3.8' mypy_extensions>=0.4.0,<0.5.0 psutil>=4.0 pytest>=4.4 From bc52c33b032598e68002c2c8657b521e668e9ec1 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 3 Jun 2019 10:08:37 +0200 Subject: [PATCH 5/6] TEMP: only py38 on Travis --- .travis.yml | 4 ---- appveyor.yml | 31 ------------------------------- 2 files changed, 35 deletions(-) delete mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 519653c60433..b997b22d1f33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,10 +14,6 @@ env: jobs: include: - # Specifically request 3.5.1 because we need to be compatible with that. - - name: "run test suite with python 3.5.1" - python: 3.5.1 - dist: trusty - name: "run test suite with python 3.8-dev" python: 3.8-dev diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 51fe0c44a217..000000000000 --- a/appveyor.yml +++ /dev/null @@ -1,31 +0,0 @@ -cache: - - '%LOCALAPPDATA%\pip\Cache' - -environment: - matrix: - - - PYTHON: "C:\\Python37-x64" - PYTHON_VERSION: "3.7.x" - PYTHON_ARCH: "64" - -install: - - "git submodule update --init mypy/typeshed" - - "%PYTHON%\\python.exe -m pip install -U setuptools tox==3.9.0" - - "%PYTHON%\\python.exe -m tox -e py37 --notest" - -build: off - -test_script: - - "%PYTHON%\\python.exe -m tox -e py37" - -skip_commits: - files: - - docs/**/* - - '**/*.rst' - - '**/*.md' - - .gitignore - - .travis.yml - - CREDITS - - LICENSE - -skip_branch_with_pr: true From 02d2d27c0859d21874aa42450ffd6cc7746a27d4 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 3 Jun 2019 10:13:37 +0200 Subject: [PATCH 6/6] test_python_cmdline: skip --html-report tests without lxml --- mypy/test/testcmdline.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mypy/test/testcmdline.py b/mypy/test/testcmdline.py index b256966b9f33..124c53123a64 100644 --- a/mypy/test/testcmdline.py +++ b/mypy/test/testcmdline.py @@ -15,6 +15,7 @@ from mypy.test.data import fix_cobertura_filename from mypy.test.data import DataDrivenTestCase, DataSuite from mypy.test.helpers import assert_string_arrays_equal, normalize_error_messages +import pytest import mypy.version # Path to Python 3 interpreter @@ -45,6 +46,8 @@ def test_python_cmdline(testcase: DataDrivenTestCase, step: int) -> None: for s in testcase.input: file.write('{}\n'.format(s)) args = parse_args(testcase.input[0]) + if "--html-report" in args: + pytest.importorskip('lxml') args.append('--show-traceback') args.append('--no-site-packages') # Type check the program.