Skip to content

Contributing

Thank you for your interest in contributing to Fairspec Python! This document provides guidelines and instructions for contributing to this project.

Project is a monorepo with the following packages:

  • fairspec-metadata: Core metadata functionality
  • fairspec-dataset: File-related functionality
  • fairspec-table: Table-related functionality
  • fairspec-library: All the above functionality
  • fairspec-terminal: Terminal interface
  • fairspec: Meta-package that re-exports the underlying functionality
  • Python: v3.12 or higher
  • uv: v0.7.0 or higher
  1. Clone the repository

    Terminal window
    git clone https://github.com/yourusername/fairspec-python.git fairspec-python
    cd fairspec-python
  2. Install dependencies

    Terminal window
    uv run task install

We use Ruff for linting and formatting, and ty for type checking:

  • Lint: Check for code issues

    Terminal window
    uv run task lint
  • Format: Auto-fix formatting issues

    Terminal window
    uv run task format
  • Type Check: Verify Python types

    Terminal window
    uv run task type

Tests are collocated with the code and use pytest:

  • Run All Tests: (includes linting and type checking)

    Terminal window
    uv run task test
  • Run Tests Only: (without linting/type checking)

    Terminal window
    uv run task spec
  • Run a Specific Test:

    Terminal window
    uv run pytest path/to/test_spec.py
  • Use Python with strict type checking
  • Target Python 3.12+
  • Tests should be placed in *_spec.py files alongside the code
  • Use 4-space indentation, UTF-8 encoding, and LF line endings
  • Use PascalCase for classes, snake_case for functions, methods, and variables

When adding new functionality:

  1. Add it to the appropriate package first
  2. Ensure it’s properly exported from that package
  3. No additional work is needed for the meta-package as it automatically re-exports everything
  1. Create a feature branch (git checkout -b feature/your-feature)
  2. Make your changes with appropriate tests
  3. Ensure the code passes all checks: uv run task test
  4. Commit your changes with a descriptive message
  5. Submit a pull request

By contributing to Fairspec Python, you agree that your contributions will be licensed under the project’s license.

Thank you for your contribution!