Skip to content

Add tox test matrix, Makefile targets, and dev extra#11

Open
Riccardo-Maio wants to merge 2 commits into
monetate:masterfrom
Riccardo-Maio:tox-makefile
Open

Add tox test matrix, Makefile targets, and dev extra#11
Riccardo-Maio wants to merge 2 commits into
monetate:masterfrom
Riccardo-Maio:tox-makefile

Conversation

@Riccardo-Maio

@Riccardo-Maio Riccardo-Maio commented Jun 17, 2026

Copy link
Copy Markdown

Why

The suite runs on pytest (merged in #10), but there is no matrix runner, no single entry point for the test commands, and nothing CI can invoke yet. This sets up the tox test tooling for Python 2.7 and 3.7, a Makefile, and a dev extra, structured to match the monetate library CI pattern (e.g. monetate-caching) so a follow-up PR can wire it into Jenkins. The Jenkinsfile ships separately.

How

  • tox.ini: py27 and py37 environments. Each runs pip install -U pip, pip install -e .[test], then pytest. Django is pinned to the 1.11 series (the last release that runs on both interpreters and still ships the smart_text and PyLibMCCache symbols the backend imports). skip_missing_interpreters = False so a missing interpreter fails rather than silently passing. No hardcoded basepython: interpreters are selected by PYENV_VERSION, matching the monetate-caching pattern so the future Jenkins stage can drive it.
  • Makefile: test (default, runs pytest), install (pip install -e ., no test deps), install-test (pip install -e '.[test]'), test-tox (tox, the entry point CI will invoke), and clean.
  • setup.py: adds a dev extra (pip install -e '.[dev]') that pulls in tox. No install_requires or library-code changes, and the test extra is untouched.
  • README documents the make shortcuts and bumps the supported-versions line from 3.4 to 3.7.

Next Steps

  • Cleanup any errors after running tests in py37 venv
  • Jenkins setup for auto running tests

Validation

  1. make install-test (or pip install -e '.[test]'). Expect the package and pytest to install; on Python 3 the mock backport is correctly skipped. make install installs the package alone, without the test deps.
  2. make test (or pytest). Expect the 28 existing tests to pass: 21 in tests/test_backend.py and 7 in tests/test_protocol.py.
  3. make test-tox (or tox) to run the matrix. Expect the same 28 tests to pass on each interpreter. The py27 env has been run this way locally (28 passed). py37 needs libmemcached present so the pylibmc C extension builds.
  4. make clean. Expect .pytest_cache, .tox, build/egg-info, and compiled artifacts to be removed.

@Riccardo-Maio Riccardo-Maio requested a review from Copilot June 17, 2026 17:44
@Riccardo-Maio Riccardo-Maio changed the title Add tox matrix and Makefile test targets Add tox test matrix, Makefile targets, and dev extra Jun 17, 2026

This comment was marked as resolved.

@Riccardo-Maio Riccardo-Maio requested a review from jjpersch June 17, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants