Development | pywebview
Description: Build GUI for your Python program with JavaScript, HTML, and CSS

# # Development

Before you get busy coding a new feature, create an issue and discuss the details in the issue tracker.

## # Environment set-up

This guide assumes you have a GitHub
(opens new window) account, as well as Python 3
(opens new window), virtualenv
(opens new window) and Git
(opens new window) installed. The guide is written for Bash, for Windows you can use for example Bash bundled with Git.

- Fork
  (opens new window) pywebview
- Clone your forked repository

    git clone https://github.com/<username>/pywebview
    cd pywebview

- Create a virtual environment

    virtualenv -p python3 venv
    source venv/bin/activate
    pip install -e .
    pip install pytest

- Hello world

    python examples/simple_browser.py

## # Development work-flow

- Create and checkout a new branch

    git checkout -b new-branch master

- Make your changes

- Run tests

    pytest tests

- Commit and push your work

    git add .
    git commit -m "Your commit message goes here"
    git push -u origin new-branch

- Create a pull request
  (opens new window)

## # Testing

pywebview uses pytest
(opens new window) for testing.

To run all the tests in the project root directory

     pytest tests

To run a specific test

    pytest tests/test_simple_browser.py

Tests cover only trivial mistakes, syntax errors, exceptions and such. In other words there is no functional testing. Each test verifies that a pywebview window can be opened and exited without errors when run under different scenarios. Sometimes test fail / stuck randomly. The cause of the issue is not known, any help on resolving random fails is greatly appreciated.

## # Learning

### # Windows

- Windows Forms documentation
  (opens new window)
- Windows Forms API
  (opens new window)

### # macOS

- pyobjc
  (opens new window). Converting Objective C syntax to Python can be tricky at first. Be sure to check out the pyobjc intro
  (opens new window).
- AppKit
  (opens new window)
- WebKit
  (opens new window)

### # Linux

- PyGObject API reference
  (opens new window)

### # Qt

- Qt for Python Documentation
  (opens new window)
- Qt5 documentation
  (opens new window)
- PySide2 QtWidgets
  (opens new window)