-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for PyCharm test debugging, and add tox environment setup (#5189
) Most open source projects use tox as a way of automating project setup. It means the user can just invoke tox and that will setup automatically environments in what to develop and run tests. Additionally, PyCharm is a highly popular IDE, that allows users not that friendly to the command line to quickly become productive. This PR makes some changes to ensure that out of box clone of mypy allows running the tests from within PyCharm (and that they pass). Plus, it exposes targets that also run inside the CI locally (e.g. running tests for Python 3.4, 3.5, 3.6, 3.7). Once you have tox installed on a system or user level (``pip install tox``): ```bash cd mypy tox -av default environments: py34 -> run the test driver with python3.4 py35 -> run the test driver with python3.5 py36 -> run the test driver with python3.6 py37 -> run the test driver with python3.7 lint -> check the code style type -> type check ourselves docs -> invoke sphinx-build to build the HTML docs additional environments: dev -> generate a DEV environment, that has all project libraries ``` E.g. to generate the documentation locally all one needs to do is ``tox -e docs``, and can then view it by opening the HTML up from a browser inside ``.tox/docs_out`` folder. Tox is kinda like make, but cross-platform (https://tox.readthedocs.org), written in Python and built-in isolation and virtualenv creation.
- Loading branch information
1 parent
ec47e84
commit 5959e1a
Showing
5 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[tox] | ||
minversion = 2.9.1 | ||
skip_missing_interpreters = true | ||
envlist = py34, | ||
py35, | ||
py36, | ||
py37, | ||
lint, | ||
type, | ||
docs | ||
|
||
[testenv] | ||
description = run the test driver with {basepython} | ||
deps = -rtest-requirements.txt | ||
commands = python runtests.py -x lint -x self-check {posargs} | ||
|
||
[testenv:lint] | ||
description = check the code style | ||
basepython = python3.6 | ||
commands = python runtests.py lint {posargs} | ||
|
||
[testenv:type] | ||
description = type check ourselves | ||
basepython = python3.6 | ||
commands = python runtests.py self-check -p '-n0' -p '-v' | ||
|
||
[testenv:docs] | ||
description = invoke sphinx-build to build the HTML docs | ||
basepython = python3.6 | ||
deps = -rdocs/requirements-docs.txt | ||
commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs/source "{toxworkdir}/docs_out" --color -W -bhtml {posargs} | ||
|
||
[testenv:dev] | ||
description = generate a DEV environment, that has all project libraries | ||
usedevelop = True | ||
basepython = python3.6 | ||
deps = -rtest-requirements.txt | ||
-rdocs/requirements-docs.txt | ||
commands = python -m pip list --format=columns | ||
python -c 'import sys; print(sys.executable)' |