This repo allows someone to practice PRs like they would happen with open source projects. It assumes someone knows basic git but wants to learn how to interact with an open source repo.
See README_code.md for the regular readme.
- Multiple changes possible: python code, python tests, markdown docs
- CI/CD pipeline (via Github actions) which runs linters and tests for python and linters for markdown files
- Some errors get annotations: black, isort, and flake8 violations for python and any spelling errors
- Aims at scaled trunk based development workflow with a main branch and short-lived feature branches
- MIT licensed
- Fork the repo
- Clone the repo from your personal fork (using ssh!)
- Add upstream to your local repo to enable pulling the latest changes from
it:
git remote add upstream https://github.com/jankatins/pr-workflow-example.git
- Create a new branch:
git checkout -b 'new_feature'
- Initialize the virtualenv:
poetry install
and run the code:poetry run python -m calculator '1 + 1'
- Do changes in the code/text. See the README.md for Python code and docs
- Coordinate with others to create merge conflicts by changing the same lines in the code in different ways
- Add a changelog
- Check your code: first add your changes to the git index
git add -u -p
and then runpoetry run pre-commit run --all-files
(fix and repeat until all is fine) - Commit
git commit -m "Add new feature"
and push to your fork:git push origin
- Create the PR in the github web ui: https://github.com/jankatins/pr-workflow-example
- Add additional changes by either additional commits or changing commits/rebases and force pushes
- Fix CI/CD failures
- Fix merge conflicts
- Wait for the maintainer to get it merged
- Poetry as python package manager
- mkdocs for documentation + automatic upload of the docs on releases to a github page (example)
- pytest python unit testing + PR annotations via utgwkk/pytest-github-actions-annotate-failures
- Black and isort python code formatter
- flake8 and mypy python code checking
- cspell spell checking including inline annotations
- markdownlint-cli markdown linting
- pre-commit for all checks above + some additional ones
- Changelog for relevant code changes based on "keep a changelog"
- Pull request template for PR checklists
- Automatic PRs for dependency updates and updates from the cookiecutter template
This project was generated using the wolt-python-package-cookiecutter template.