Contributing
We welcome contributions to archetypax! This document outlines the process for contributing to the project and provides guidelines to ensure a smooth collaboration experience.
Development Environment
To set up a development environment:
Fork the repository on GitHub.
Clone your fork locally:
git clone https://github.com/your-username/archetypax.git cd archetypax
Create a virtual environment and install development dependencies:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -e ".[dev,docs,examples]"
Set up pre-commit hooks:
pre-commit install
Code Style
archetypax follows a consistent code style enforced by ruff and black. The configuration is defined in pyproject.toml. Key style guidelines include:
Use Google-style docstrings
Maximum line length of 100 characters
Type annotations for function signatures
Comprehensive test coverage
To check your code style:
ruff check .
black --check .
To automatically format your code:
ruff check --fix .
black .
Pull Request Process
Create a branch: Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
Make changes: Implement your changes, following the code style guidelines.
Write tests: Add tests that verify your changes work as expected.
Update documentation: Update relevant documentation, including docstrings and this documentation site if necessary.
Run tests locally: Ensure all tests pass:
pytest
Submit a pull request: Push your branch to your fork and submit a pull request to the main repository.
In your pull request description, clearly explain:
The purpose of your changes
Any issues they address
How to test the changes
Any dependencies introduced
Code review: Respond to any feedback on your pull request.
Testing
archetypax uses pytest for testing. Tests are located in the tests/ directory.
To run the test suite:
pytest
For more verbose output:
pytest -v
To run a specific test file:
pytest tests/test_specific_file.py
Documentation
Documentation is written in reStructuredText and built using Sphinx. To build the documentation locally:
cd docs
make html
The built documentation will be available in docs/_build/html/.
When contributing new features, please include:
Docstrings for all public functions, classes, and methods
Updates to relevant documentation pages
Example usage in docstrings or example files
Versioning
archetypax follows semantic versioning (SemVer):
MAJOR version for incompatible API changes
MINOR version for backwards-compatible functionality additions
PATCH version for backwards-compatible bug fixes
Release Process
archetypax uses an automated release process through GitHub Actions:
Update CHANGELOG.md: Before releasing, ensure the
CHANGELOG.mdfile is updated with all notable changes under the “Unreleased” section.Create a release tag: To trigger a release, create and push a tag with the version number:
git tag v0.1.0 git push origin v0.1.0
Automated workflow: The release workflow will automatically:
Build the package
Run tests
Publish to PyPI
Create a GitHub release with notes from: - The CHANGELOG.md file - Pull request descriptions and labels
Verify the release: After the workflow completes, verify:
The package is available on PyPI
The GitHub release is created with proper notes
The documentation is updated
When creating pull requests that should be included in release notes, use appropriate labels:
featureorenhancementfor new featuresbugorfixfor bug fixesdocumentationfor documentation changestestfor test improvementschoreordependenciesfor maintenance tasks
Issue Reporting
If you encounter a bug or have a feature request, please submit an issue on GitHub. When reporting bugs, please include:
A clear, descriptive title
A detailed description of the issue
Steps to reproduce the problem
Expected behavior
Actual behavior
Environment information (OS, Python version, package versions)
Code of Conduct
We expect all contributors to adhere to our Code of Conduct. Please be respectful and constructive in all interactions.
License
By contributing to archetypax, you agree that your contributions will be licensed under the project’s Apache 2.0 license.