Skip to content

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions

Report Bugs

Report bugs at https://github.com/xinp-hub/pydiggs/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your local setup that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.

Implement Features

Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.

Write Documentation

pydiggs could always use more documentation, whether as part of the official pydiggs docs, in docstrings, or even on the web in blog posts, articles, and such.

Submit Feedback

The best way to send feedback is to file an issue at https://github.com/xinp-hub/pydiggs/issues.

If you are proposing a feature:

  • Explain in detail how it would work.
  • Keep the scope as narrow as possible, to make it easier to implement.
  • Remember that this is a volunteer-driven project, and that contributions are welcome :)

Development Setup

Ready to contribute? Here's how to set up pydiggs for local development.

  1. Fork the pydiggs repo on GitHub.

  2. Clone your fork locally:

    git clone git@github.com:your_name_here/pydiggs.git
    cd pydiggs
    

  3. Install Poetry if you haven't already:

    curl -sSL https://install.python-poetry.org | python3 -
    

  4. Install dependencies and set up your development environment:

    poetry install
    

This will create a virtual environment and install all dependencies, including development dependencies.

  1. Create a branch for local development:

    git checkout -b name-of-your-bugfix-or-feature
    

  2. Make your changes locally. The project uses several development tools:

  3. pytest for testing

  4. pylint for code quality
  5. mypy for type checking
  6. pre-commit for automated checks

Install pre-commit hooks:

poetry run pre-commit install

  1. When you're done making changes:
  2. Run tests with pytest:
    poetry run pytest
    
  3. Check code quality:
    poetry run pylint pydiggs tests
    
  4. Run type checking:

    poetry run mypy pydiggs
    

  5. Commit your changes and push your branch to GitHub:

    git add .
    git commit -m "Your detailed description of your changes."
    git push origin name-of-your-bugfix-or-feature
    

  6. Submit a pull request through the GitHub website.

Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

  1. The pull request should include tests.
  2. If the pull request adds functionality:
  3. Add docstrings to new functions/classes
  4. Update the documentation under docs/
  5. Add the feature to the list in README.md
  6. The pull request should work for Python 3.10 and above.
  7. Check that all tests pass in the GitHub Actions CI pipeline.

Documentation

To build and view the documentation locally:

poetry run mkdocs serve

Then visit http://127.0.0.1:8000 in your web browser.

Testing

To run a subset of tests:

poetry run pytest tests/test_pydiggs.py

To run tests with coverage:

poetry run pytest --cov=pydiggs

Type Checking

The project uses type hints and mypy for type checking:

poetry run mypy pydiggs

Code Style

The project follows PEP 8 style guidelines. Code quality is enforced using: * pylint * pre-commit hooks * GitHub Actions CI

Deploying

A reminder for the maintainers on how to deploy: 1. Update HISTORY.md with the new version changes 2. Update version in pyproject.toml:

poetry version patch  # possible: major / minor / patch
3. Commit the changes:
git add pyproject.toml HISTORY.md
git commit -m "Bump version to x.x.x"
git push
4. Create a new release on GitHub with the version number 5. GitHub Actions will automatically deploy to PyPI if tests pass.