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 pylintrmToo uses pytest with specific naming conventions:
- Test files:
RMTTest*.py - Test classes:
RMTTest* - Test methods:
rmttest*
- Unit tests:
tests/RMTTest-Unit/- Core component testing - Blackbox tests:
tests/RMTTest-Blackbox/- Full integration tests - Output tests:
tests/RMTTest-Output/- Testing specific output formats - Syntax tests:
tests/RMTTest-Syntax/- Input syntax validation
For output modules that generate XML, rmToo includes custom XML comparison utilities:
- Until version 19, rmToo used the
xmldifflibrary xmldiffwas too slow for large documents (20+ minutes for big files)- Custom XML comparison was implemented for better performance
- Not only node content must match, but also order
- Supports both directly generated files and library-generated 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- Fork the repository on GitHub
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Run the test suite:
tox - Submit a pull request
- Follow PEP 8 for Python code
- Use meaningful variable and function names
- Add docstrings for public functions and classes
- Keep functions small and focused
- Add tests for new features
- Ensure all existing tests pass
- Maintain or improve code coverage
- Test on multiple Python versions using tox
- Input Plugins: Parse requirement tags and dependencies
- Output Plugins: Generate different artifact formats
- Analytics: Quality checking modules
- Configuration: Hierarchical config system
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 rmtooSeveral forks have been created over the years. Some interesting ones to review:
- apre/rmtoo: GUI branch
- andipla/rmtoo: SIL (Safety Integrity Level) feature
- joesteeve/rmtoo: Virtualenv support (merged)
When reviewing forks, consider:
- Cherry-picking useful features
- Contacting fork maintainers
- Coordinating integration efforts
- Check existing GitHub issues
- Contact the maintainers: rmtoo@florath.net
- Update documentation when adding features
- Test documentation examples
- Follow the documentation style guide
- make: Build automation
- graphviz: Graph generation
- texlive: LaTeX processing
- python3-dev: Python development headers
- tox: Testing across Python versions
- coverage: Code coverage analysis
- pytest: Test runner
- flake8: Linting
- pylint: Advanced linting