From 10c4dbf785c4157de6098be3ae52ffee4cb96c3c Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 19 Jul 2020 14:58:17 +0200 Subject: [PATCH] Try to get rid of tox and test directly with pytest --- .gitignore | 1 - .travis.yml | 42 ++++++++++++++++++++---------------------- MANIFEST.in | 1 - appveyor.yml | 16 ++++++---------- deploy-master.sh | 2 +- tox.ini | 39 --------------------------------------- 6 files changed, 27 insertions(+), 74 deletions(-) delete mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index fc6b9070..1b4a42b9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ *.sw? *.pyc .ropeproject -.tox .coveralls.yml .coverage .idea diff --git a/.travis.yml b/.travis.yml index 18014285..d92237f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,20 +14,27 @@ env: matrix: include: - - python: 3.7 - env: - - TOXENV=cov-py37 - - JEDI_TEST_ENVIRONMENT=37 - # For now ignore pypy, there are so many issues that we don't really need - # to run it. - #- python: pypy - # The 3.9 dev build does not seem to be available end 2019. - #- python: 3.9-dev - # env: - # - JEDI_TEST_ENVIRONMENT=39 + - python: 3.8 + script: + pip install coverage + coverage run --source jedi -m pytest + coverage report + after_script: + - | + pip install --quiet codecov coveralls + coverage xml + coverage report -m + coveralls + bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -X search -X fix -X xcode -f coverage.xml + - python: 3.8 + install: + - pip install .[qa] + script: + # Ignore F401, which are unused imports. flake8 is a primitive tool and is sometimes wrong. + - run: 'flake8 --extend-ignore F401 {posargs:jedi}' install: - - pip install --quiet tox-travis - sudo apt-get -y install python3-venv + - pip install .[testing] script: - | # Setup/install Python for $JEDI_TEST_ENVIRONMENT. @@ -57,13 +64,4 @@ script: fi fi set +ex - - tox -after_script: - - | - if [ $TOXENV == "cov-py37" ]; then - pip install --quiet codecov coveralls - coverage xml - coverage report -m - coveralls - bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -X search -X fix -X xcode -f coverage.xml - fi + - pytest diff --git a/MANIFEST.in b/MANIFEST.in index 83368474..d6387b17 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,7 +6,6 @@ include .coveragerc include sith.py include conftest.py include pytest.ini -include tox.ini include requirements.txt recursive-include jedi/third_party *.pyi include jedi/third_party/typeshed/LICENSE diff --git a/appveyor.yml b/appveyor.yml index 007ad915..df1ed05d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,21 +1,17 @@ environment: matrix: - - TOXENV: py37 - PYTHON_PATH: C:\Python37 + - PYTHON_PATH: C:\Python37 JEDI_TEST_ENVIRONMENT: 37 - - TOXENV: py37 - PYTHON_PATH: C:\Python37 + - PYTHON_PATH: C:\Python37 JEDI_TEST_ENVIRONMENT: 36 - - TOXENV: py36 - PYTHON_PATH: C:\Python36 + - PYTHON_PATH: C:\Python36 JEDI_TEST_ENVIRONMENT: 37 - - TOXENV: py36 - PYTHON_PATH: C:\Python36 + - PYTHON_PATH: C:\Python36 JEDI_TEST_ENVIRONMENT: 36 install: - git submodule update --init --recursive - set PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%PATH% - - pip install tox + - pip install .[testing] build_script: - - tox + - pytest diff --git a/deploy-master.sh b/deploy-master.sh index b26a253a..e924eaa6 100755 --- a/deploy-master.sh +++ b/deploy-master.sh @@ -24,7 +24,7 @@ git checkout $BRANCH git submodule update --init # Test first. -tox +pytest # Create tag tag=v$(python3 -c "import $PROJECT_NAME; print($PROJECT_NAME.__version__)") diff --git a/tox.ini b/tox.ini deleted file mode 100644 index a8304353..00000000 --- a/tox.ini +++ /dev/null @@ -1,39 +0,0 @@ -[tox] -envlist = py36, py37, py38, qa -[testenv] -extras = testing -deps = -# numpydoc for typing scipy stack - numpydoc - sphinx - cov: coverage -# Overwrite the parso version (only used sometimes). - git+https://github.com/davidhalter/parso.git -passenv = JEDI_TEST_ENVIRONMENT -setenv = -# https://github.com/tomchristie/django-rest-framework/issues/1957 -# tox corrupts __pycache__, solution from here: - PYTHONDONTWRITEBYTECODE=1 -# Enable all warnings. - PYTHONWARNINGS=always -# To test Jedi in different versions than the same Python version, set a -# different test environment. - env36: JEDI_TEST_ENVIRONMENT=36 - env37: JEDI_TEST_ENVIRONMENT=37 - env38: JEDI_TEST_ENVIRONMENT=38 - interpreter: JEDI_TEST_ENVIRONMENT=interpreter -commands = - pytest {posargs} -[testenv:cov-py37] -commands = - coverage run --source jedi -m pytest {posargs} - coverage report -[testenv:sith] -commands = - {envpython} -c "import os; a='{envtmpdir}'; os.path.exists(a) or os.makedirs(a)" - {envpython} sith.py --record {envtmpdir}/record.json random {posargs:jedi} -[testenv:qa] -# Ignore F401, which are unused imports. flake8 is a primitive tool and is sometimes wrong. -commands = flake8 --extend-ignore F401 {posargs:jedi} -deps = -extras = qa