Contributor Guide#

Creating a development environment#

If you plan to make code changes to this repository, you will need to install the following dependencies first:

Once you finish installing these dependencies, you can clone this repository:

git clone https://github.com/reactive-python/reactpy.git
cd reactpy

Executing test environment commands#

By utilizing hatch, the following commands are available to manage the development environment.

Python Tests#

Command

Description

hatch test

Run Python tests using the current environment’s Python version

hatch test --all

Run tests using all compatible Python versions

hatch test --python 3.9

Run tests using a specific Python version

hatch test -k test_use_connection

Run only a specific test

Python Package#

Command

Description

hatch fmt

Run all linters and formatters

hatch fmt --check

Run all linters and formatters, but do not save fixes to the disk

hatch fmt --linter

Run only linters

hatch fmt --formatter

Run only formatters

hatch run python:type_check

Run the Python type checker

JavaScript Packages#

Command

Description

hatch run javascript:check

Run the JavaScript linter/formatter

hatch run javascript:fix

Run the JavaScript linter/formatter and write fixes to disk

hatch run javascript:test

Run the JavaScript tests

hatch run javascript:build

Build all JavaScript packages

hatch run javascript:build_event_to_object

Build the event-to-object package

hatch run javascript:build_client

Build the @reactpy/client package

hatch run javascript:build_app

Build the @reactpy/app package

Documentation#

Command

Description

hatch run docs:serve

Start the documentation preview webserver

hatch run docs:build

Build the documentation

hatch run docs:check

Check the documentation for build errors

hatch run docs:docker_serve

Start the documentation preview webserver using Docker

hatch run docs:docker_build

Build the documentation using Docker

Environment Management#

Command

Description

hatch build --clean

Build the package from source

hatch env prune

Delete all virtual environments created by hatch

hatch python install 3.12

Install a specific Python version to your system

Other ReactPy Repositories#

ReactPy has several external packages that can be installed to enhance your user experience. For documentation on them you should refer to their respective documentation in the links below: