Code Monkey home page Code Monkey logo

pyside2-boilerplate's Introduction

Qt for Python Application Boilerplate

This repository contains a boilerplate for Qt for Python (PySide2) based applications.

Qt for Python Application Boilerplate

Features

  • Dependency management using pip
  • Use the standard setup.py to build resources, docs, etc.
  • Manage resources and UI forms using a Qt Creator project
  • Generate a compiled application for Windows, Linux and macOS using PyInstaller
  • Multilanguage support
  • Document using Sphinx
  • Flake8 linting

Getting started

First of all create a new virtual environment and activate it:

python3 -m venv .venv
source .venv/bin/activate

Then install the application in development mode:

pip install -e .

Finally install development dependencies:

pip install -r requirements-dev.txt

Autogenerated files such as translation binaries or compiled forms are required but not pushed to the repository, so the first time you will need to generate them as described in the coming section. Once done, you can run the application like this:

python -m app

Resources and translations

In order to ease the development process, the Qt Creator project app.pro is provided. You can open it to edit the UI files or to manage resources. Translations can be edited using Qt Linguist, part of the Qt SDK. In order to build the translations, you will need to have the lrelease command on your PATH or set its full path to the LRELEASE_BIN environment variable. UI files, translations and resources can be built like this:

python setup.py build_res

Note that this command is automatically run before running sdist and bdist_app commands.

Compiled application

You can generate a compiled application so that end-users do not need to install anything. You can tweak some settings on the app.spec file. It can be generated like this:

python setup.py bdist_app

Documentation

Sphinx is used for documentation purposes. You can tweak its configuration in docs/conf.py and the documentation can be built like this:

python setup.py build_docs

Linting

Flake8 is a great tool to check for style issues, unused imports and similar stuff. You can tweak .flake8 to ignore certain types of errors, increase the maximum line length, etc. You can run it like this:

flake8 app

pyside2-boilerplate's People

Contributors

dependabot[bot] avatar gmarull avatar m6tm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.