Contributing Workflow
Relevant source files
The following files were used as context for generating this wiki page:
The contributing workflow for the mbbank-lib project defines the standards, tools, and procedures required for developers to propose changes, report bugs, and maintain code quality. This system ensures that all contributions—ranging from feature enhancements to security patches—align with the project's architectural constraints and community standards.
The workflow is built around a fork-and-pull model, utilizing specific development tools for linting, type checking, and documentation to maintain a lightweight and high-quality Python API wrapper.
Sources: CONTRIBUTING.md:1-5, pyproject.toml:5-10
Development Environment Setup
To participate in the development process, contributors must set up a local environment compatible with Python 3.10 or higher. The project utilizes uv as the recommended package manager, though pip remains supported for installing development dependencies.
Installation Steps
- Repository Initialization: Clone the repository and navigate to the project root.
- Dependency Management: Use
uv sync --group devorpip install -e ".[dev]"to install core dependencies and development tools.
Sources: CONTRIBUTING.md:7-22, pyproject.toml:12-13
Development Toolchain
The project relies on a specific set of tools defined in the dependency groups to enforce consistency:
| Tool | Purpose | Source File |
|---|---|---|
| Ruff | Linting and code formatting | ruff.toml |
| Ty | Static type checking | pyproject.toml |
| Pdoc | API documentation generation | docs_gen.py |
Sources: CONTRIBUTING.md:28-32, pyproject.toml:29-33
Code Quality Standards
Contributors are required to run local checks before submitting any Pull Request. The project enforces strict linting rules and formatting via Ruff, configured to target Python 3.10.
Linting Configuration
The ruff.toml file defines specific rules, including the selection of pycodestyle, pyflakes, isort, and flake8-bandit for security analysis. It also explicitly ignores certain naming conventions (e.g., N815, N802) to accommodate the camelCase format of the underlying MBBank API.
Sources: ruff.toml:1-25, CONTRIBUTING.md:34-40
Validation Flow
The following diagram illustrates the local validation process required before a contribution is considered ready for submission:
The workflow ensures that logic, style, and types are validated sequentially.
Sources: CONTRIBUTING.md:34-40, docs_gen.py:38-46
Change Submission Process
The project follows a standard Git-based contribution cycle. Changes should be focused, minimal, and documented through clear commit messages.
Submission Lifecycle
- Fork and Branch: Create a feature branch from the
mainbranch. - Development: Implement focused changes.
- Verification: Execute the toolchain commands (
ruff,ty). - Pull Request: Open a PR using the provided template, ensuring one logical change per PR and linking related issues.
Sources: CONTRIBUTING.md:46-59
Documentation Generation
Documentation is generated using pdoc via the docs_gen.py script. This script processes multiple modules including mbbank.sync, mbbank.aio, and mbbank.modals. Contributors adding new features should ensure documentation renders correctly using the Google docstring format.
Sources: docs_gen.py:27-46, pyproject.toml:30
Reporting and Security
The workflow distinguishes between standard bug reports and security vulnerabilities to protect user data and banking credentials.
Issue Reporting
- Bug Reports: Use the YAML-based bug report template on GitHub.
- Prohibited Content: Contributors MUST NEVER include real banking credentials, account numbers, or session tokens in issues or PRs.
Sources: CONTRIBUTING.md:61-65
Security Protocol
Security vulnerabilities are handled through a dedicated policy. Reports should include descriptions, impact, and reproduction steps but must exclude AI-generated reports or issues regarding third-party dependencies.
Security reports are sent via the Security Vulnerability Report template and reviewed promptly by maintainers.
Sources: SECURITY.md:1-22, CODE_OF_CONDUCT.md:32-35
Community Standards
All contributors are bound by the Contributor Covenant Code of Conduct. The workflow emphasizes a harassment-free experience and professional conduct.
Expected Behavior
- Use inclusive and welcoming language.
- Respect differing viewpoints.
- Gracefully accept constructive criticism.
Unacceptable behavior (trolling, harassment, or publishing private info) is subject to enforcement by project maintainers via the contact email provided in the documentation.
Sources: CODE_OF_CONDUCT.md:1-45
Summary
The contributing workflow for mbbank-lib is a structured process designed to maintain a high-quality, lightweight SDK. By combining modern Python tools like uv and ruff with clear security and conduct policies, the project ensures that contributions are technically sound and community-focused. All contributions are ultimately licensed under the MIT License.
Sources: CONTRIBUTING.md:67-69, pyproject.toml:11