Skip to content

Latest commit

 

History

History
123 lines (74 loc) · 3.61 KB

CONTRIBUTING.md

File metadata and controls

123 lines (74 loc) · 3.61 KB

Contributing to Pixano

Thank you for your interest in Pixano! Here you will find information on running Pixano locally and guidelines on how to publish your contributions.

Getting started

Issue and suggestions

If you find a bug or you think of some missing features that could be useful while using Pixano, please open an issue!

Modifications

To contribute more actively to the project, you are welcome to develop the fix or the feature you have in mind, and create a pull request!

And if you want to change the application to your liking, feel free to fork this repository!

Running Pixano locally

If you are looking to contribute to Pixano and develop new features, you will need to clone the Pixano repository and run it locally.

Requirements

Backend

You will need python == 3.10. Then, inside the root pixano/ directory, run this command to install all the Python dependencies:

pip install .

Frontend

You will need node ~= 18.17 and pnpm ~= 8.6. Then, you will need to run this to install all the pnpm dependencies:

cd ui/
pnpm i

Running the server and apps

First, you will need to launch the backend server using this command:

LIBRARY_DIR=your_datasets_directory/ uvicorn pixano.app:create_app --factory --reload

Then, in another terminal, you can launch the frontend apps using:

cd ui/
pnpm --parallel run dev

This command should provide you with a http://localhost link you can open in your browser to access the Pixano app.

Both the backend server and the frontend apps should refresh automatically when you make changes to the code.

Testing the code

Backend

We test our backend code with Python's built-in unittest framework.

All our unit testing files are in the tests/ folder, with a test_ prefix.

Frontend

Our frontend code is tested using Storybook, which you can launch with the following command:

cd ui/
pnpm -r run storybook

Formatting and linting the code

Backend

We format Python files and Jupyter notebooks with the Black formatter.

You can install the Visual Studio Extension and set it to format files automatically on save.

Or you can use the Python package:

pip install black
black pixano/
black notebooks/

Frontend

We format frontend files (Typescript, Javascript, Svelte, HTML, CSS, JSON, YAML, Markdown) with the Prettier formatter.

You can install the Visual Studio Extension (and this Extension for Svelte) and set them to format files automatically on save.

Or you can use the command line we have set up:

cd ui/
pnpm format

We also lint frontend files with eslint.

You can use the command line we have set up:

cd ui/
pnpm lint

Formatting your commits

We format our commit messages with the Conventional Commits guidelines.

Updating the changelog

When you want to create a pull request with the changes you have made, please update the CHANGELOG.md accordingly.

We format our changelog with the Keep a Changelog guidelines.