Skip to content

Latest commit

 

History

History
212 lines (145 loc) · 6.17 KB

CONTRIBUTING.md

File metadata and controls

212 lines (145 loc) · 6.17 KB

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:

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:

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Reference issues and pull requests liberally after the first line

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.

Poetry 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 Poetry via make install target:

make install

By default make install target will search first for python3 then python executable in your PATH. If needed this can be overridden by PYTHON environment variable.

export PYTHON=/path/to/my/python
make install

If Poetry is not found in its default installation directory (${HOME}/.local/share/pypoetry) this target will install it for you. However, one can always point to existing/customize Poetry installation with environment variables:

export POETRY_HOME=/custom/poetry/path
export POETRY_CACHE_DIR=/custom/poetry/path/cache
export POETRY_VIRTUALENVS_IN_PROJECT=true
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 "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:

  • Updated the CHANGELOG.md file with your changes.
  • Added tests for changed code where applicable.
  • Documentation reflects the changes where applicable.
  • Open a new pull request

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!