This directory contains Docker configuration to run python-mode tests locally. Note: Docker is only used for local development. CI tests run directly in GitHub Actions without Docker.
- Docker
- Docker Compose
To run all tests in Docker (default version 3.13.0):
# Using the convenience script
./scripts/user/run-tests-docker.sh
# Or manually with docker-compose
docker compose run --rm python-mode-testsTo start an interactive shell for development:
docker compose run --rm python-mode-devThe Docker environment includes:
- Ubuntu 24.04 base image
- pyenv for Python version management
- Multiple Python versions: 3.10.13, 3.11.9, 3.12.4, 3.13.0
- Python 3.13.0 as default
- Vim built from source with Python support for each Python version
- All required system dependencies:
- GUI libraries (GTK, X11, etc.)
- Lua 5.2
- Perl
- Build tools
- Python build dependencies
- python-mode plugin properly installed and configured
- Git submodules initialized
- Test environment matching the CI setup
The container replicates the GitHub Actions environment:
- Vim is built with
--enable-python3interp=yesfor each Python version - pyenv is installed at
/opt/pyenv - Python versions are managed by pyenv:
- 3.10.13
- 3.11.9
- 3.12.4
- 3.13.0 (default)
- Each Python version has its own Vim binary:
vim-3.10.13,vim-3.11.9, etc. - Python config directory is automatically detected using
python-config --configdir - python-mode is installed in
/root/.vim/pack/foo/start/python-mode - Test configuration files are copied to the appropriate locations
- All required environment variables are set
Tests are run using the Vader test framework via Docker Compose:
# Using docker compose directly
docker compose run --rm python-mode-tests
# Or using the convenience script
./scripts/user/run-tests-docker.sh
# Or using the Vader test runner script
./scripts/user/run_tests.shIn GitHub Actions CI, tests run directly without Docker using scripts/cicd/run_vader_tests_direct.sh. This approach:
- Runs 3-5x faster (no Docker build/pull overhead)
- Provides simpler debugging (direct vim output)
- Uses the same Vader test suite for consistency
Vader Test Suites:
- autopep8.vader - Tests automatic code formatting (8/8 tests passing)
- commands.vader - Tests Vim commands and autocommands (7/7 tests passing)
- folding.vader - Tests code folding functionality
- lint.vader - Tests linting functionality
- motion.vader - Tests motion operators
- rope.vader - Tests Rope refactoring features
- simple.vader - Basic functionality tests
- textobjects.vader - Tests text object operations
All legacy bash tests have been migrated to Vader tests.
You can test python-mode with different Python versions:
# Test with Python 3.11.9
./scripts/user/run-tests-docker.sh 3.11
# Test with Python 3.12.4
./scripts/user/run-tests-docker.sh 3.12
# Test with Python 3.13.0
./scripts/user/run-tests-docker.sh 3.13Available Python versions: 3.10.13, 3.11.9, 3.12.4, 3.13.0
Note: Use the major.minor format (e.g., 3.11) when specifying versions.
The Dockerfile uses python-config --configdir to automatically detect the correct Python config directory. If you encounter issues:
- Check that pyenv is properly initialized
- Verify that the requested Python version is available
- Ensure all environment variables are set correctly
If the Docker build fails:
- Check that all required packages are available in Ubuntu 24.04
- Verify that pyenv can download and install Python versions
- Ensure the Vim source code is accessible
- Check that pyenv is properly initialized in the shell
If tests fail in Docker but pass locally:
- Check that the Vim build includes Python support for the correct version
- Verify that all git submodules are properly initialized
- Ensure the test environment variables are correctly set
- Confirm that the correct Python version is active
- Verify that pyenv is properly initialized
To add support for additional Python versions:
- Add the new version to the PYTHON_VERSION arg in the Dockerfile
- Update the test scripts to include the new version
- Test that the new version works with the python-mode plugin
- Update this documentation with the new version information