This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/CONTRIBUTING.md
Santiago L a85e7c90e1 Manage dependencies using pip-tools
Add instructions to CONTRIBUTING.md & create requirements.in
2022-09-29 12:11:10 +02:00

1.5 KiB

Contributing to devicehub

Writing code

Javascript and compatibility with "old" browsers

Warning: This project is using babel compiler... You need run an additional build step to make build js file

npm install
npm run babel

NOTE: If you prefer you can use yarn instead, it's compatible NOTE2: This only affect to file ereuse_devicehub/static/js/main_inventory.js.

Coding style

Python style

  • Unless otherwise specified, follow PEP 8. Use flake8 to check for problems in this area.
  • Use isort to automate import sorting.

To automatize this work just configure pre-commit hooks in your development environment:

# on your virtual environment
pip install -r requirements-dev.txt
pre-commit install

HTML (templates)

  • Template file names should be all lowercase, using underscores instead of camelCase.

    Do this: device_detail.html

    Don't do this: DeviceDetail.html, Device-detail.html

Adding a new dependency to the project

This project tracks its packages using pip-tools, it could be installed by running:

pip install pip-tools

Whenever you need to install a new package using pip install :

  1. Put the package name into requirements.in instead.
# requirements.in
...
new_package
  1. Compile the requirements
pip-compile requirements.in --output-file=requirements.txt

  1. Then install upgraded dependencies:
pip install -U -r requirements.txt