Contributing to ray-ascend
Thank you for your interest in contributing to ray-ascend! This document provides guidelines and instructions for contributing to the project.
Getting Started
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://gitcode.com/YOUR_USERNAME/ray-ascend.git cd ray-ascend - Add the upstream repository:
git remote add upstream https://gitcode.com/Ascend/ray-ascend.git
Development Setup
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install the package in development mode:
pip install -e . -
Install pre-commit hooks:
pip install pre-commit pre-commit install
Making Changes
-
Create a new branch for your changes:
git checkout -b feature/your-feature-name -
Make your changes and commit them:
git add . git commit -m "Description of your changes" -
Push your changes to your fork:
git push origin feature/your-feature-name -
Open a pull request on GitHub
Code Style
This project uses the following tools to maintain code quality:
- black: Code formatting
- isort: Import sorting
- flake8: Linting
- mypy: Type checking
Pre-commit hooks will automatically run these tools before each commit. You can also run them manually:
# Format code
black .
# Sort imports
isort .
# Run linter
flake8 .
# Type checking
mypy .
Testing
Before submitting a pull request, please ensure that:
- All existing tests pass
- New features include appropriate tests
- Code coverage is maintained or improved
Run tests with:
pytest
Pull Request Guidelines
- Keep pull requests focused on a single feature or bug fix
- Write clear, descriptive commit messages
- Update documentation as needed
- Ensure all tests pass
- Follow the existing code style
- Add tests for new features
Reporting Issues
When reporting issues, please include:
- A clear description of the problem
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Environment details (OS, Python version, etc.)
Code of Conduct
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive feedback
- Assume good intentions
Questions?
If you have questions about contributing, feel free to:
- Open an issue for discussion
- Reach out to the maintainers
Thank you for contributing to ray-ascend!