@@ -5,6 +5,7 @@ It outlines our workflow and standards for contributing to this project.
55
66## Table of Contents
77
8+ - [ Pre-requisites] ( #pre-requisites )
89- [ Pre-commit Hooks] ( #pre-commit-hooks )
910- [ Documentation] ( #documentation )
1011 - [ Editor Support] ( #editor-support )
@@ -13,6 +14,25 @@ It outlines our workflow and standards for contributing to this project.
1314- [ Making and Reviewing Changes] ( #making-and-reviewing-changes )
1415- [ Notes] ( #notes )
1516
17+ ## Pre-requisites
18+
19+ Clone the repository and navigate to the root directory:
20+
21+ ``` bash
22+ git clone
[email protected] :luxonis/luxonis-ml.git
23+ cd luxonis-train
24+ ```
25+
26+ Install the development dependencies by running ` pip install -r requirements-dev.txt ` or install the package with the ` dev ` extra flag:
27+
28+ ``` bash
29+ pip install -e .[dev]
30+ ```
31+
32+ > \[ !NOTE\]
33+ > This will install the package in editable mode (` -e ` ),
34+ > so you can make changes to the code and run them immediately.
35+
1636## Pre-commit Hooks
1737
1838We use pre-commit hooks to ensure code quality and consistency:
@@ -31,8 +51,11 @@ To verify that your documentation is formatted correctly, follow these steps:
31511 . Download [ ` get-docs.py ` ] ( https://github.com/luxonis/python-api-analyzer-to-json/blob/main/gen-docs.py ) script
32521 . Run ` python3 get-docs.py luxonis_ml ` in the root directory.
3353 - If the script runs successfully and produces ` docs.json ` file, your documentation is formatted correctly.
34- - ** NOTE:** If the script fails, it might not give the specific error message. In that case, you can run
35- the script for each file individually until you find the one that is causing the error.
54+
55+ > \[ !NOTE\]
56+ > If the script fails, it might not give a specific error message.
57+ > In that case, you can run the script for each file individually
58+ > until you find the one that is causing the error.
3659
3760### Editor Support
3861
@@ -46,32 +69,36 @@ We use [pytest](https://docs.pytest.org/en/stable/) for testing.
4669The tests are located in the ` tests ` directory. You can run the tests locally with:
4770
4871``` bash
49- pytest tests --cov
72+ pytest tests --cov=luxonis_ml --cov-report=html
5073```
5174
52- This command will run all tests and print a coverage report. The coverage report
53- is only informational for now, but we may enforce a minimum coverage in the future.
75+ This command will run all tests and generate HTML coverage report.
5476
55- ** If a new feature is added, a new test should be added to cover it.**
77+ > \[ !TIP\]
78+ > The coverage report will be saved to ` htmlcov ` directory.
79+ > If you want to inspect the coverage in more detail, open ` htmlcov/index.html ` in a browser.
80+
81+ > \[ !IMPORTANT\]
82+ > If a new feature is added, a new test should be added to cover it.
83+ > There is no minimum coverage requirement for now, but minimal coverage will be enforced in the future.
5684
5785## GitHub Actions
5886
5987Our GitHub Actions workflow is run when a new PR is opened.
60- It first checks that the pre-commit hook passes and that the documentation builds successfully.
61- The tests are run only if the pre-commit hook and documentation build pass.
62- Successful tests are required for merging a PR.
6388
64- 1 . Checks and tests are run automatically when you open a pull request.
65- 1 . For the tests to run, the [ pre-commit] ( #pre-commit-hooks ) hook must pass, and
66- the [ documentation] ( #documentation ) must be built successfully.
67- 1 . Review the GitHub Actions output if your PR fails.
68- 1 . Fix any issues to ensure that all checks and tests pass.
89+ 1 . First, the [ pre-commit] ( #pre-commit-hooks ) hooks must pass and the [ documentation] ( #documentation ) must be built successfully.
90+ 1 . If all previous checks pass, the [ tests] ( #tests ) are run.
91+
92+ > \[ !TIP\]
93+ > Review the GitHub Actions output if your PR fails.
94+
95+ > \[ !IMPORTANT\]
96+ > Successful completion of all the workflow checks is required for merging a PR.
6997
7098## Making and Reviewing Changes
7199
721001 . Make changes in a new branch.
731011 . Test your changes locally.
74- 1 . Commit (pre-commit hook will run).
75- 1 . Push to your branch and create a pull request.
76- 1 . Any other relevant team members can be added as reviewers as well.
102+ 1 . Commit your changes (pre-commit hooks will run).
103+ 1 . Push your branch and create a pull request.
771041 . The team will review and merge your PR.
0 commit comments