Skip to content

Commit 45aae2a

Browse files
committed
Update developer instructions
Signed-off-by: Anish Asthana <[email protected]>
1 parent f529763 commit 45aae2a

File tree

2 files changed

+30
-23
lines changed

2 files changed

+30
-23
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ dist/
22
.python-version
33
__pycache__/
44
.coverage
5+
Pipfile
6+
Pipfile.lock

README.md

+28-23
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,31 @@ Can be installed via `pip`: `pip install codeflare-sdk`
1515

1616
## Development
1717

18-
For testing, make sure to have installed:
19-
- `pytest`, `pytest-mock` (can both be installed with `pip`)
20-
- The remaining dependencies located in `requirements.txt`
21-
- To run the unit tests, run `pytest -v tests/unit_test.py`)
22-
- Any new test functions/scripts can be added into the `tests` folder
23-
24-
NOTE: Functional tests coming soon, will live in `tests/func_test.py`
25-
26-
For checking code coverage while testing:
27-
- Start by installing `coverage` (can be done via `pip`)
28-
- Now instead when testing run `coverage run -m --source=src pytest tests/unit_test.py`
29-
- To then view a code coverage report w/ missing lines, run `coverage report -m`
30-
31-
For formatting:
32-
- Currently using black v22.3.0 for format checking
33-
- To install, run `pip install black==22.3.0`
34-
- To check file formatting, in top-level dir run `black --check .`
35-
- To auto-reformat all files, remove the `--check` flag
36-
- To reformat an individual file, run `black <filename>`
37-
38-
To build the python package:
39-
- If poetry is not installed: `pip install poetry`
40-
- `poetry build`
18+
### Prerequisites
19+
20+
We recommend using Python 3.8 for development.
21+
Install development specific dependencies:
22+
`$ pip install poetry pytest pytest-mock coverage black==22.3.0`
23+
24+
Additional dependencies can be found in `requirements.txt`: `$ pip install -r requirements.txt`
25+
26+
### Testing
27+
28+
- To run the unit tests, run `pytest -v tests/unit_test.py`
29+
- Any new test functions/scripts can be added into the `tests` folder
30+
- NOTE: Functional tests coming soon, will live in `tests/func_test.py`
31+
32+
#### Code Coverage
33+
34+
- Run tests with the following command: `coverage run -m --source=src pytest tests/unit_test.py`
35+
- To then view a code coverage report w/ missing lines, run `coverage report -m`
36+
37+
### Code Formatting
38+
39+
- To check file formatting, in top-level dir run `black --check .`
40+
- To auto-reformat all files, remove the `--check` flag
41+
- To reformat an individual file, run `black <filename>`
42+
43+
### Package Build
44+
45+
To build the python package: `$ poetry build`

0 commit comments

Comments
 (0)