Skip to content

Commit

Permalink
Merge pull request #2 from sjaensch/rework-tox-build
Browse files Browse the repository at this point in the history
Rework tox.ini so that we specify Python versions
  • Loading branch information
sjaensch committed Nov 15, 2017
2 parents c97ae78 + 403a35b commit 3ee6439
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 30 deletions.
37 changes: 19 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: v0.7.1
sha: v1.1.1
hooks:
- id: autopep8-wrapper
language_version: python3
language_version: python3.6
args:
- -i
- --ignore=E309,E501
- id: check-added-large-files
language_version: python3
language_version: python3.6
- id: check-byte-order-marker
language_version: python3
language_version: python3.6
- id: check-json
language_version: python3
language_version: python3.6
- id: check-yaml
language_version: python3
language_version: python3.6
- id: debug-statements
language_version: python3
language_version: python3.6
- id: end-of-file-fixer
language_version: python3
language_version: python3.6
- id: fix-encoding-pragma
language_version: python3
language_version: python3.6
args:
- --remove
- id: flake8
language_version: python3
language_version: python3.6
- id: name-tests-test
language_version: python3
language_version: python3.6
- id: trailing-whitespace
language_version: python3
language_version: python3.6
- id: requirements-txt-fixer
language_version: python3
language_version: python3.6
files: requirements-dev.txt
- repo: https://github.com/asottile/pyupgrade
sha: v1.0.0
sha: v1.2.0
hooks:
- id: pyupgrade
language_version: python3
- repo: git@git.yelpcorp.com:mirrors/asottile/reorder_python_imports
sha: v0.3.1
language_version: python3.6
- repo: https://github.com/asottile/reorder_python_imports
sha: v0.3.5
hooks:
- id: reorder-python-imports
language_version: python3
language_version: python3.6
args: [
'--remove-import', 'from __future__ import absolute_import',
'--remove-import', 'from __future__ import print_function',
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ matrix:
include:
- env: TOXENV=py35
python: "3.5"
- env: TOXENV=cover
- env: TOXENV=py36
python: "3.6"
- env: TOXENV=pre-commit
python: "3.6"

install:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test: devenv
venv/bin/tox

venv:
virtualenv -p python3 venv
virtualenv -p python3.6 venv

.PHONY: clean
clean:
Expand Down
16 changes: 9 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,27 @@ the HTTP client to adhere to a specific interface, those parts should be relativ
Development and contributing
----------------------------

Developing ``bravado-asyncio`` requires a working installation of Python 3.5 or 3.6 with the
Developing ``bravado-asyncio`` requires a working installation of Python 3.6 with the
`virtualenv <https://virtualenv.pypa.io/en/stable/>`_ package being installed.
All other requirements will be installed in a virtualenv created in the ``venv`` directory.
All other requirements will be installed in a virtualenv created in the ``venv`` directory. A full run of our testsuite
runs the tests against Python 3.5 and 3.6, so if you want that to work you should install Python 3.5 as well.

1. Run ``make``. This will create the virtualenv you will use for development, with all runtime and development
dependencies installed.
2. If you're using `aactivator <https://github.com/Yelp/aactivator>`_ then you will be prompted to activate the new
environment, please do so. If you prefer not to use aactivator, do ``source .activate.sh``.
3. Make sure everything is set up correctly by running ``make test``.

Note that ``make test`` will run the tests with whatever version of Python 3 you have installed - i.e. whatever
version ``python3`` points to. Adjust your shell path settings accordingly to use a different Python version.
Alternatively, you can ask tox to run tests with a specific Python version like so:
Since ``make test`` will run tests with Python 3.5 and 3.6, you'll get an error if only one of them is installed.
You can ask tox to run tests with a specific Python version like so:

.. code-block:: bash
$ tox -e py36
$ tox -e py35
This will run tests with Python 3.6.
This will run tests with Python 3.5.

We do run linters that currently require Python 3.6. You can run them with ``tox -e pre-commit``.

Travis (the continuous integration system) will run tests with both Python 3.5 and Python 3.6, so make sure you don't
write code that works on Python 3.6 only.
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[tox]
envlist = cover, pre-commit
envlist = py35, py36, pre-commit

[testenv]
basepython = python3
deps =
-rrequirements-dev.txt
commands =
Expand All @@ -14,7 +13,7 @@ exclude = .git,__pycache__,.tox,docs,venv
max_line_length = 120

[testenv:pre-commit]
basepython = python3
basepython = python3.6
deps =
pre-commit
setenv =
Expand Down

0 comments on commit 3ee6439

Please sign in to comment.