@@ -6,23 +6,37 @@ This guide provides an overview of how to develop in this repository.
66
771 . 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
13133 . 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
2741You 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
4256There is a potential need for you to reinstall the package. You can do this by
4357either run ` pip install -e . ` again (which will reinstall), or manually
4458uninstall ` pip uninstall comfy-cli ` and reinstall, or even cleaning your conda
4559env 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
881021 . Fork your own branches of ` comfy-cli ` and ` ComfyUI-Manager ` , make changes
891032 . 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
921061 . clone the changed branch of ` comfy-cli ` , then live install ` comfy-cli ` :
93107 - ` pip install -e comfy-cli `
941082 . 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 - `
981124 . 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
1011151 . Follow instructions above to get working install with changes
1021162 . Add breakpoints directly to code: ` import ipdb; ipdb.set_trace() `
1031173 . Execute relevant ` comfy-cli ` command
0 commit comments