Skip to content

Commit 75bb752

Browse files
Arcitecbigcat88
authored andcommitted
fix: Add developer pytest instructions and improve readability
Adds instructions for locally running `pytest` to save time later during code reviews. Also improves the readability of some other section titles and instructions.
1 parent 42b3c3c commit 75bb752

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

DEV_README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,37 @@ This guide provides an overview of how to develop in this repository.
66

77
1. Clone the repo, create and activate a conda env. Minimum Python version is 3.9.
88

9-
2. Install the package to local
9+
2. Install the package to your conda env.
1010

1111
`pip install -e .`
1212

1313
3. Set ENVIRONMENT variable to DEV.
1414

1515
`export ENVIRONMENT=dev`
1616

17-
4. Test script running
17+
4. Check if the "comfy" package can run.
1818

1919
`comfy --help`
2020

21-
5. Use pre commit hook
21+
5. Install the pre-commit hook to ensure that your code won't need reformatting later.
2222

2323
`pre-commit install`
2424

25-
## Debug
25+
6. To save time during code review, it's recommended that you also manually run
26+
the unit tests before submitting a pull request (see below).
27+
28+
## Running the unit tests
29+
30+
1. Install pytest into your conda env. You should preferably be using Python 3.9
31+
in your conda env, since it's the version we are targeting for compatibility.
32+
33+
`pip install pytest pytest-cov`
34+
35+
2. Verify that all unit tests run successfully.
36+
37+
`pytest --cov=comfy_cli --cov-report=xml .`
38+
39+
## Debugging
2640

2741
You can add following config to your VSCode `launch.json` to launch debugger.
2842

@@ -37,14 +51,14 @@ You can add following config to your VSCode `launch.json` to launch debugger.
3751
}
3852
```
3953

40-
## Make changes to the code base
54+
## Making changes to the code base
4155

4256
There is a potential need for you to reinstall the package. You can do this by
4357
either run `pip install -e .` again (which will reinstall), or manually
4458
uninstall `pip uninstall comfy-cli` and reinstall, or even cleaning your conda
4559
env and reinstalling the package (`pip install -e .`)
4660

47-
## Add New Command
61+
## Adding a new command
4862

4963
- Register it under `comfy_cli/cmdline.py`
5064

@@ -77,18 +91,18 @@ def remove(name: str):
7791
7892
```
7993

80-
## Guide
94+
## Important notes
8195

8296
- Use `typer` for all command args management
8397
- Use `rich` for all console output
8498
- For progress reporting, use either [`rich.progress`](https://rich.readthedocs.io/en/stable/progress.html)
8599

86100
## Develop comfy-cli and ComfyUI-Manager (cm-cli) together
87-
### Make changes to both
101+
### Making changes to both
88102
1. Fork your own branches of `comfy-cli` and `ComfyUI-Manager`, make changes
89103
2. Be sure to commit any changes to `ComfyUI-Manager` to a new branch, and push to remote
90104

91-
### Try out changes to both
105+
### Trying changes to both
92106
1. clone the changed branch of `comfy-cli`, then live install `comfy-cli`:
93107
- `pip install -e comfy-cli`
94108
2. Go to a test dir and run:
@@ -97,7 +111,7 @@ def remove(name: str):
97111
- `cd ComfyUI/custom_nodes/ComfyUI-Manager/ && git checkout <changed-branch> && cd -`
98112
4. Further changes can be pulled into these copies of the `comfy-cli` and `ComfyUI-Manager` repos
99113

100-
### Debug both simultaneously
114+
### Debugging both simultaneously
101115
1. Follow instructions above to get working install with changes
102116
2. Add breakpoints directly to code: `import ipdb; ipdb.set_trace()`
103117
3. Execute relevant `comfy-cli` command

0 commit comments

Comments
 (0)