Copier template for Poetry FBS based projects.
This copier template is mainly for my own usage, but feel free to try it out, or fork it!
- Poetry setup, with pre-defined
pyproject.toml
- FBS setup, with pre-defined
base.json
and other needed boilerplate and setup with .ui mainwindow and about dialog with Qsettings. - Documentation built with MkDocs (Material theme and "autodoc" mkdocstrings plugin)
- Pre-configured tools for code formatting, quality analysis and testing:
- Tests run with pytest and plugins, with coverage support
- Cross-platform tasks with duty
- Support for GitHub workflow and Gitlab CI
- Python 3.6 or above
- Auto-generated
CHANGELOG.md
from git commits (using Angular message style) - Auto-generated
CREDITS.md
from Python dependencies - All licenses from choosealicense.com
- Makefile for convenience
Make sure all the requirements are met, then:
copier "https://gitlab.com/mikeramsey/copier-poetry-fbs.git" /path/to/your/new/project
Or even shorter:
copier "gl:mikeramsey/copier-poetry-fbs.git" /path/to/your/new/project
See the documentation for more details.
Once poetry venv is installed you can run the below to see the skeleton mainwindow.
fbs run
You can then add all your custom widgets and signals and slots easily to the src/main/python/{{your_app}}/main.py
file.
To edit the GUI just open src/main/python/{{your_app}}/ui/mainwindow.ui
file in Qt Designer and save and then rerun fbs run to see changes instantly.
If using python 3.7 or higher with fbs it may complain due to the super low pinned pyinstaller version in fbs 0.9.0 which was the last one updated before pro. You can easily fix this by running the below which will ignore the dependency pinning to lower pyinstaller==3.4.
poetry run pip install pyinstaller==4.2
It is a workaround, but is the best way to address that issue as poetry does not yet offer a clean way to ignore/override sub-dependencies. Reference: python-poetry/poetry#697
If you run a poetry update/install, you will want to just rerun the above command to upgrade pyinstaller forcibly to later version which supports python 3.7+ before trying to fbs freeze/installer/release.
fbs-documentation : FBS documentation for the fbs specific details.
LearnPyQt : Has some of the best video tutorials and up to date resources for PyQT/Pyside.