Contributing

Contributions are welcome! Here’s how you can contribute to the project:

Setting Up the Development Environment

  1. Clone the repository:

    git clone https://github.com/holgern/pymempool.git
    cd pymempool
    
  2. Install the development dependencies:

    pip install -r requirements-test.txt
    
  3. Install the package in development mode:

    pip install -e .
    
  4. Install pre-commit hooks:

    pip install pre-commit
    pre-commit install
    

Running Tests

Run the whole test suite:

pytest

Run a specific test file:

pytest tests/test_this_file.py

Run a specific test:

pytest tests/test_this_file.py::test_this_specific_test

Run tests with coverage:

pytest --cov=pymempool

Code Style

The project uses ruff for linting and formatting. Pre-commit hooks are configured to automatically check these when you commit.

You can manually run the pre-commit hooks on all files:

pre-commit run --all-files

Or with detailed output:

pre-commit run --show-diff-on-failure --color=always --all-files

Pull Request Process

  1. Create a new branch for your feature or bugfix

  2. Make your changes

  3. Add tests for your changes

  4. Ensure all tests pass

  5. Submit a pull request

Please make sure your code follows the project’s coding standards and includes appropriate tests.