This guide will help you set up your development environment for contributing to Albumentations.
- Python 3.9 or higher
- Git
- A GitHub account
- Fork the Albumentations repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/albumentations.git
cd albumentations
Choose the appropriate commands for your operating system:
python3 -m venv env
source env/bin/activate
python -m venv env
env\Scripts\activate.bat
python -m venv env
env\Scripts\activate.ps1
- Install the project in editable mode:
pip install -e .
- Install development dependencies:
pip install -r requirements-dev.txt
Pre-commit hooks help maintain code quality by automatically checking your changes before each commit.
- Install pre-commit:
pip install pre-commit
- Set up the hooks:
pre-commit install
- (Optional) Run hooks manually on all files:
pre-commit run --files $(find albumentations -type f)
Ensure everything is set up correctly by running the test suite:
pytest
- 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
- 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
- Verify that you're using the correct virtual environment
- Confirm that all dependencies were installed successfully
- Try reinstalling the package in editable mode
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
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