Python Code Generator
- Python 3.9
pip install pycodegenor install with PDM
pdm add pycodegenor install with pipx1
pipx install git+https://github.com/myrontuttle/pycodegen.gitfrom pycodegen.coder import Coder
coder = Coder("repo_owner", "repo_name")
issue_number = 1
open_response_code = coder.open_issue(issue_number)
code_response_code = coder.start_coding()
# Work on issue
finish_response_code = coder.finish_issue("commit_msg")Command line (install with pipx)
coder start <githubaccount> <project> [-i <issuenumber>]
coder code <githubaccount> <project>
# Work on issue
coder finish <githubaccount> <project> [-m "<commit message>"]Makefile contains a lot of functions for faster development.
1. Install all dependencies and pre-commit hooks
Install requirements:
make installUpdate PDM
make updateUpdate all dev libraries to the latest version using one command
make update-dev-deps2. Codestyle Formatting
Automatic formatting uses autoflake, pyupgrade, isort and black.
make formatCodestyle checks only, without rewriting files:
make check-codestyleNote:
check-codestyleusesisort,blackandrufflibrary
3. Code security
make check-securityThis command launches PDM integrity checks as well as identifies security issues with Bandit.
make check-security4. Type checks
Run mypy static type checker
make mypy5. Tests with coverage badges
Run pytest
make test6. All checks
Run all checks:
make check-allthe same as:
make check-style && make mypy && make check-safety && make test7. Deploy
Prepare to deploy
make prepare-deploy8. Cleanup
Delete pycache files
make pycache-removeRemove package build
make build-removeRemove .mypycache
make mypycache-removeOr to remove all above run:
make cleanupBuilt using project template here.