Contributing
We welcome contributions to make cloudmesh-ai-vm more powerful and supportive of more clouds!
How to Contribute
Adding a New Provider
- Check libcloud: See if the provider is already supported by
libcloud. If so, inherit fromLibcloudManager. - Implement Interface: If it's a custom provider, inherit from
CloudBaseManagerand implement all abstract methods. - Add Config: Update the
clouds.yamlexample in the documentation to show required credentials. - Register: Add your provider to the
PROVIDERSmap insrc/main.py. - Test: Create a new test file in
tests/usingunittest.mock.
Development Workflow
- Branching: All active development and feature integration happen in the
dev2branch. Please create your feature branches fromdev2rather thanmain. - Commits: Use descriptive commit messages.
- PRs: Submit a Pull Request targeting the
dev2branch with a clear description of the changes and examples of how to use the new feature.
Code Formatting
To maintain a consistent style across the codebase, please format your code before committing.
Ruff
We use ruff for both linting and formatting. You can run it manually:
# Check for linting issues
ruff check .
# Automatically fix linting issues
ruff check --fix .
# Format the code
ruff format .
Pre-commit Hooks
The project includes a .pre-commit-config.yaml file. We recommend installing the pre-commit framework to automate formatting on every commit:
ruff is run automatically before each commit.
Coding Standards
- Follow PEP 8 guidelines.
- Use type hinting for all method signatures.
- Ensure all new functionality is covered by unit tests.
Appendix: Step-by-Step Feature Workflow
To help new contributors get started, here is a detailed guide on the development cycle for this project.
1. Environment Setup
Always start from the latest state of the integration branch:
2. Branching
Create a descriptive feature branch to keep your work isolated:
3. Implementation & Testing
Develop your feature following the coding standards. Ensure you add unit tests for any new logic:
4. Formatting & Linting
Ensure your code is clean and formatted before submitting. We use ruff:
pre-commit install to automate this step on every commit.
5. Committing and Pushing
git add .
git commit -m "feat: description of your change"
git push origin feature/your-feature-name
6. Creating the Pull Request
- Navigate to the GitHub repository.
- Click "Compare & pull request".
- Crucial: Set the base branch to
dev2(notmain). - Provide a clear description and a usage example of the new feature.
- Submit the PR for review.