Setting Up Your Development Environment¶
This guide will help you set up your development environment for contributing to Albumentations.
Prerequisites¶
- Python 3.9 or higher
- Git
- A GitHub account
Step-by-Step Setup¶
1. Fork and Clone the Repository¶
- Fork the Albumentations repository on GitHub
- Clone your fork locally:
2. Create a Virtual Environment¶
Choose the appropriate commands for your operating system:
Linux / macOS¶
Windows (cmd.exe)¶
Windows (PowerShell)¶
3. Install Dependencies¶
- Install the project in editable mode:
- Install development dependencies:
4. Set Up Pre-commit Hooks¶
Pre-commit hooks help maintain code quality by automatically checking your changes before each commit.
- Install pre-commit:
- Set up the hooks:
- (Optional) Run hooks manually on all files:
Verifying Your Setup¶
Run Tests¶
Ensure everything is set up correctly by running the test suite:
Common Issues and Solutions¶
Permission Errors¶
- Linux/macOS: If you encounter permission errors, try using
sudo
for system-wide installations or consider using--user
flag with pip - Windows: Run your terminal as administrator if you encounter permission issues
Virtual Environment Not Activating¶
- Ensure you're in the correct directory
- Check that Python is properly installed and in your system PATH
- Try creating the virtual environment with the full Python path
Import Errors After Installation¶
- Verify that you're using the correct virtual environment
- Confirm that all dependencies were installed successfully
- Try reinstalling the package in editable mode
Next Steps¶
After setting up your environment:
- Create a new branch for your work
- Make your changes
- Run tests and pre-commit hooks
- Submit a pull request
For more detailed information about contributing, please refer to Coding Guidelines
Getting Help¶
If you encounter any issues with the setup:
- Check our Discord community
- Open an issue on GitHub
- Review existing issues for similar problems and solutions