Skip to content

Contributing

Thank you for your interest in contributing to Simple RDP! ❤

Development Setup

Prerequisites

  • Python 3.11+
  • Poetry
  • Git
  • Rust toolchain (install from rustup.rs)

Clone and Install

git clone https://github.com/abi-jey/simple-rdp.git
cd simple-rdp
poetry install

Install Pre-commit Hooks

poetry run pre-commit install

Build Rust Extension

maturin develop --release

Development Workflow

Running Tests

# Unit tests (no RDP connection needed)
poetry run pytest tests/ --ignore=tests/e2e

# With coverage
poetry run pytest tests/ --ignore=tests/e2e --cov=src/simple_rdp
# E2E tests (requires RDP server)
cp .env.example .env  # Edit with your credentials
poetry run pytest tests/e2e/

Linting

# Run Ruff linter
poetry run ruff check src/

# Auto-fix issues
poetry run ruff check src/ --fix

Type Checking

poetry run mypy src/

Format Code

poetry run ruff format src/

Run All Checks

Pre-commit hooks

poetry run pre-commit run --all-files
Code Structure
simple-rdp/
├── src/simple_rdp/
│   ├── __init__.py      # Package exports
│   ├── client.py        # Main RDPClient class
│   ├── capabilities.py  # RDP capability negotiation
│   ├── credssp.py       # CredSSP/NLA authentication
│   ├── mcs.py           # MCS/T.125 protocol layer
│   ├── pdu.py           # RDP PDU encoding/decoding
│   ├── rle.py           # RLE bitmap decompression
│   ├── display.py       # Display/video encoding
│   └── input.py         # Input type definitions
├── tests/
│   ├── test_*.py        # Unit tests
│   └── e2e/             # End-to-end tests
└── docs/                # MkDocs documentation

Pull Request Guidelines

  • Create a feature branch
  • Make changes with appropriate tests
  • Run all checks
  • Commit with a clear message
  • Push and create PR
Step-by-step
# 1. Create a feature branch
git checkout -b feature/my-feature

# 2. Make your changes with appropriate tests

# 3. Run all checks
poetry run pre-commit run --all-files
poetry run pytest tests/ --ignore=tests/e2e

# 4. Commit with a clear message
git commit -m "feat: add new feature"

# 5. Push and create PR
git push origin feature/my-feature

Commit Message Format

We follow Conventional Commits:

feat:
New features
fix:
Bug fixes
docs:
Documentation changes
test:
Test additions/changes
refactor:
Code refactoring
perf:
Performance improvements
chore:
Build/tooling changes

Documentation

Building Docs Locally

pip install mkdocs mkdocs-material mkdocstrings[python]
mkdocs serve

Open http://localhost:8000 to preview.

Writing Documentation

  • Add new pages to docs/
  • Update navigation in mkdocs.yml
  • Use Material for MkDocs features (admonitions, tabs, etc.)

Issues

Before creating an issue

  • Check existing issues before creating new ones
  • Use issue templates when available
  • Include reproduction steps for bugs
  • Include environment details (OS, Python version)

Questions?

Need help?

Open a discussion on GitHub or reach out to the maintainers.