Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.PHONY: test install install-test test-tox clean

test:
pytest

install:
pip install -e .

install-test:
pip install -e '.[test]'

# test-tox runs the suite on every supported interpreter (2.7 and 3.7); Jenkins CI invokes this target.
test-tox:
tox

Comment thread
Riccardo-Maio marked this conversation as resolved.
clean:
rm -rf .pytest_cache .tox build dist *.egg-info
find . -name '*.py[co]' -delete
find . -name __pycache__ -type d -prune -exec rm -rf {} +
8 changes: 7 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Requirements
* pylibmc
* Django 1.5+.

It was written and tested on Python 2.7 and 3.4.
It was written and tested on Python 2.7 and 3.7.

Installation
------------
Expand Down Expand Up @@ -169,3 +169,9 @@ Install the test dependencies and run the tests like this::

pip install -e '.[test]'
pytest

To run the suite across the supported Python versions (2.7 and 3.7), use tox::

tox

These steps are also wrapped in the Makefile as ``make install-test``, ``make test``, and ``make test-tox``.
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"pytest>=4.6; python_version >= '3.0'",
"mock; python_version < '3.0'",
],
# Orchestration tooling for the outer env. tox builds and runs the per-version test envs.
"dev": ["tox"],
},
classifiers=[
'Development Status :: 4 - Beta',
Expand Down
14 changes: 14 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[tox]
envlist = py27, py37
skip_missing_interpreters = False

[testenv]
# Pin Django to the 1.11 series this package targets, the last release that runs on both 2.7 and 3.7
# and still ships smart_text and PyLibMCCache that the backend imports.
deps = Django>=1.11,<2.0
setenv =
PYTHONPATH = {toxinidir}
commands =
pip install -U pip
pip install -e .[test]
pytest --basetemp={envtmpdir}
Comment thread
Riccardo-Maio marked this conversation as resolved.