Development Guide
This guide explains how to set up the development environment for contributing to moneyx.
Setting Up the Development Environment
Clone the repository:
git clone https://github.com/devAbreu/moneyx.git cd moneyx
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install development dependencies:
pip install -e ".[dev,test]"
Set up pre-commit hooks:
pre-commit install
Running Tests
Run the test suite with pytest:
# Run all tests
pytest
# Run tests with coverage
pytest --cov=moneyx
# Run tests with specific marks
pytest -m "not slow"
# Run specific test file
pytest tests/test_money.py
Code Style and Quality
moneyx uses several tools to ensure code quality:
Black: Code formatting
isort: Import sorting
mypy: Static type checking
ruff: Linting and code quality checks
bandit: Security checks
You can run these tools individually:
# Format code with Black
black .
# Sort imports with isort
isort .
# Type-check with mypy
mypy src
# Lint with ruff
ruff .
# Security check with bandit
bandit -r src
Or run all checks at once using pre-commit:
pre-commit run --all-files
Building Documentation
To build the documentation:
Install documentation dependencies:
pip install -e ".[docs]"
Build the documentation:
cd docs make html
View the documentation:
Open
docs/build/html/index.htmlin your browser.
Versioning and Releases
moneyx follows Semantic Versioning.
To create a new release:
Update the version using the version script:
python scripts/bump_version.py [major|minor|patch]
Review and commit the changes:
git commit -am "Bump version to x.y.z"
Tag the release:
git tag -a vx.y.z -m "Version x.y.z"
Push the changes:
git push && git push --tags
The CI/CD pipeline will automatically publish the package to PyPI when a new tag is pushed.
Pull Request Guidelines
When submitting a pull request:
Ensure all tests pass and code quality checks succeed.
Add tests for new features or bug fixes.
Update documentation if necessary.
Follow the code style of the project.
Include a clear description of the changes.
Reference any relevant issues in your PR description.
Reporting Issues
If you find a bug or want to request a feature:
Check the existing issues on GitHub to avoid duplicates.
Create a new issue with a clear title and description.
For bug reports, include steps to reproduce, expected behavior, and actual behavior.
For feature requests, explain the use case and benefits.
License
By contributing to moneyx, you agree that your contributions will be licensed under the project’s MIT License.