This guide covers setting up a development environment for rmToo and contributing to the project.
# Debian/Ubuntu
sudo apt install -y make graphviz texlive-latex-extra
sudo apt install -y python3-dev python3-venv
# CentOS/RHEL
sudo yum install -y make graphviz texlive python3-devel
# Fedora
sudo dnf install -y make graphviz texlive python3-devel
# Clone the repository
git clone https://github.com/florath/rmtoo.git
cd rmtoo
# Create virtual environment
python3 -m venv dev-env
source dev-env/bin/activate
# Install in development mode
pip install -e .
export PYTHONPATH=${PWD}
cd rmtoo
pytest --junit-xml=result.xml --cov-report term --cov-report xml --cov=lib --cov=inputs --cov=outputs tests
# Unit tests only
pytest tests/RMTTest-Unit/
# Blackbox tests only
pytest tests/RMTTest-Blackbox/
# Output tests only
pytest tests/RMTTest-Output/
# Syntax tests only
pytest tests/RMTTest-Syntax/
# Run tests for all supported Python versions
tox
# Run specific environment
tox -e py39
tox -e py310
tox -e py311
# Run linting
tox -e pep8
tox -e pylint
rmToo uses pytest with specific naming conventions:
RMTTest*.py
RMTTest*
rmttest*
tests/RMTTest-Unit/
- Core component testingtests/RMTTest-Blackbox/
- Full integration teststests/RMTTest-Output/
- Testing specific output formatstests/RMTTest-Syntax/
- Input syntax validationFor output modules that generate XML, rmToo includes custom XML comparison utilities:
xmldiff
libraryxmldiff
was too slow for large documents (20+ minutes for big files)# Run flake8
flake8
# Run pylint
pylint rmtoo
# Using tox
tox -e pep8
tox -e pylint
# Generate coverage report
pytest --cov=lib --cov=inputs --cov=outputs --cov-report=html tests
# View coverage report
open htmlcov/index.html
git checkout -b feature-name
tox
See the setuptools entry points in setup.py
for examples of creating new input and output plugins.
# Build source distribution
python setup.py sdist
# Build wheel
python setup.py bdist_wheel --universal
# Upload to TestPyPI
python setup.py sdist upload -r testpypi
python setup.py bdist_wheel --universal upload -r testpypi
# Install from TestPyPI
pip install -i https://testpypi.python.org/pypi rmtoo
Several forks have been created over the years. Some interesting ones to review:
When reviewing forks, consider: