Contributing¶
First off, thanks for taking the time to contribute!
Issues¶
Before submitting
Check that your issue does not already exist in the issue tracker
Questions¶
If you have any question about fastapi-mvc, or you are seeking for help you are encouraged to open question or a new discussion.
Suggesting enhancements¶
Feel free to open enhancement so we can discuss it. Bringing new ideas and pointing out elements needing clarification allows to make this project better!
Reporting Bugs¶
If you encountered an unexpected behavior using fastapi-mvc, please open bug report and provide the necessary information by filling in the template.
Documentation¶
The project could always use more documentation, whether as part of the official project docs, or even on the web in blog posts, articles, and such.
Discuss¶
Feel free to discuss with community through discussion channel.
Contributing to code¶
Codebase¶
This project is made of two things:
Package: fastapi-mvc - implementation, tests, etc.
Builtin copier templates:
fastapi-mvc/copier-project for scaffolding new fastapi-mvc project.
fastapi-mvc/copier-controller for scaffolding new controller upon fastapi-mvc project.
fastapi-mvc/copier-generator for scaffolding new generator for fastapi-mvc.
fastapi-mvc/copier-script for scaffolding new shell script.
The project template (copier-project) has their own tests and checks. However, since template isn’t a valid Python code until its generated, all checks are done on the default (full) generated project in fastapi-mvc/copier-project CI workflow.
Style guide¶
Git Commit Messages: https://www.conventionalcommits.org/en/v1.0.0/#summary
Metrics stage ensure following rules are followed:
Development environment¶
This project provides two ways of setting up the project for local development. Feel free to choose one that suits you the most.
| uv | Nix (recommended) |
|---|---|
|
Prerequisites:
|
Prerequisites:
|
|
You will first need to fork fastapi-mvc and clone repository: git clone git@github.com:your_username/fastapi-mvc.git
cd fastapi-mvc
|
|
|
Now, you will need to install the required dependencies for fastapi-mvc with make install
By default export PYTHON=/path/to/my/python
make install
If export UV_INSTALL_DIR=/custom/uv/path
export UV_CACHE_DIR=/custom/uv/path/cache
export UV_PROJECT_ENVIRONMENT=/custom/uv/path/venv
make install
|
First enable Nix flakes if needed. (Optional) Setup fastapi-mvc Nix binary cache to speed up the build process: nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use fastapi-mvc
Build fastapi-mvc development environment with Nix: nix build .#fastapi-mvc-dev --print-build-logs
NOTE! On first run this may take a while. To spawn shell with complete development environment form Nix: nix develop
|
|
Create a branch for local development: git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally. When you’re done making changes, check that your changes pass all tests: |
|
make metrics
make test
|
nix run .#metrics
nix run .#test
|
|
Commit your changes and push your branch to GitHub: git add .
git commit -m "conventional_commit_type: meaningfull commit message"
git push origin name-of-your-bugfix-or-feature
|
|
Pull requests¶
Before you submit a pull request, check that it meets these guidelines:
Added tests for changed code where applicable.
Documentation reflects the changes where applicable.
If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!