Contributing
Thank you for your interest in contributing to Fairspec Python! This document provides guidelines and instructions for contributing to this project.
Project Overview
Section titled “Project Overview”Project is a monorepo with the following packages:
fairspec-metadata: Core metadata functionalityfairspec-dataset: File-related functionalityfairspec-table: Table-related functionalityfairspec-library: All the above functionalityfairspec-terminal: Terminal interfacefairspec: Meta-package that re-exports the underlying functionality
Development Environment
Section titled “Development Environment”Prerequisites
Section titled “Prerequisites”- Python: v3.12 or higher
- uv: v0.7.0 or higher
-
Clone the repository
Terminal window git clone https://github.com/yourusername/fairspec-python.git fairspec-pythoncd fairspec-python -
Install dependencies
Terminal window uv run task install
Development Workflow
Section titled “Development Workflow”Code Style and Quality
Section titled “Code Style and Quality”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
Testing
Section titled “Testing”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
Code Style Guidelines
Section titled “Code Style Guidelines”- Use Python with strict type checking
- Target Python 3.12+
- Tests should be placed in
*_spec.pyfiles 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
Making Changes to the Meta-Package
Section titled “Making Changes to the Meta-Package”When adding new functionality:
- Add it to the appropriate package first
- Ensure it’s properly exported from that package
- No additional work is needed for the meta-package as it automatically re-exports everything
Submitting Changes
Section titled “Submitting Changes”- Create a feature branch (
git checkout -b feature/your-feature) - Make your changes with appropriate tests
- Ensure the code passes all checks:
uv run task test - Commit your changes with a descriptive message
- Submit a pull request
License
Section titled “License”By contributing to Fairspec Python, you agree that your contributions will be licensed under the project’s license.
Thank you for your contribution!