1
0
forked from VimPlug/jedi

Try to get rid of tox and test directly with pytest

This commit is contained in:
Dave Halter
2020-07-19 14:58:17 +02:00
parent 7281302281
commit 10c4dbf785
6 changed files with 27 additions and 74 deletions

1
.gitignore vendored
View File

@@ -2,7 +2,6 @@
*.sw? *.sw?
*.pyc *.pyc
.ropeproject .ropeproject
.tox
.coveralls.yml .coveralls.yml
.coverage .coverage
.idea .idea

View File

@@ -14,20 +14,27 @@ env:
matrix: matrix:
include: include:
- python: 3.7 - python: 3.8
env: script:
- TOXENV=cov-py37 pip install coverage
- JEDI_TEST_ENVIRONMENT=37 coverage run --source jedi -m pytest
# For now ignore pypy, there are so many issues that we don't really need coverage report
# to run it. after_script:
#- python: pypy - |
# The 3.9 dev build does not seem to be available end 2019. pip install --quiet codecov coveralls
#- python: 3.9-dev coverage xml
# env: coverage report -m
# - JEDI_TEST_ENVIRONMENT=39 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: install:
- pip install --quiet tox-travis
- sudo apt-get -y install python3-venv - sudo apt-get -y install python3-venv
- pip install .[testing]
script: script:
- | - |
# Setup/install Python for $JEDI_TEST_ENVIRONMENT. # Setup/install Python for $JEDI_TEST_ENVIRONMENT.
@@ -57,13 +64,4 @@ script:
fi fi
fi fi
set +ex set +ex
- tox - pytest
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

View File

@@ -6,7 +6,6 @@ include .coveragerc
include sith.py include sith.py
include conftest.py include conftest.py
include pytest.ini include pytest.ini
include tox.ini
include requirements.txt include requirements.txt
recursive-include jedi/third_party *.pyi recursive-include jedi/third_party *.pyi
include jedi/third_party/typeshed/LICENSE include jedi/third_party/typeshed/LICENSE

View File

@@ -1,21 +1,17 @@
environment: environment:
matrix: matrix:
- TOXENV: py37 - PYTHON_PATH: C:\Python37
PYTHON_PATH: C:\Python37
JEDI_TEST_ENVIRONMENT: 37 JEDI_TEST_ENVIRONMENT: 37
- TOXENV: py37 - PYTHON_PATH: C:\Python37
PYTHON_PATH: C:\Python37
JEDI_TEST_ENVIRONMENT: 36 JEDI_TEST_ENVIRONMENT: 36
- TOXENV: py36 - PYTHON_PATH: C:\Python36
PYTHON_PATH: C:\Python36
JEDI_TEST_ENVIRONMENT: 37 JEDI_TEST_ENVIRONMENT: 37
- TOXENV: py36 - PYTHON_PATH: C:\Python36
PYTHON_PATH: C:\Python36
JEDI_TEST_ENVIRONMENT: 36 JEDI_TEST_ENVIRONMENT: 36
install: install:
- git submodule update --init --recursive - git submodule update --init --recursive
- set PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%PATH% - set PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%PATH%
- pip install tox - pip install .[testing]
build_script: build_script:
- tox - pytest

View File

@@ -24,7 +24,7 @@ git checkout $BRANCH
git submodule update --init git submodule update --init
# Test first. # Test first.
tox pytest
# Create tag # Create tag
tag=v$(python3 -c "import $PROJECT_NAME; print($PROJECT_NAME.__version__)") tag=v$(python3 -c "import $PROJECT_NAME; print($PROJECT_NAME.__version__)")

39
tox.ini
View File

@@ -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