docs: update development setup commands and scripts for uv#1249
docs: update development setup commands and scripts for uv#1249asabya wants to merge 5 commits intolibp2p:mainfrom
Conversation
Screen.Recording.2026-02-27.at.4.41.43.PM.mov |
|
@seetadev @acul71 @sumanjeet0012 This needs a bit of love. |
docs/contributing.rst
Outdated
| On macOS, help the build command find and link against the ``gmp`` library: | ||
|
|
There was a problem hiding this comment.
This should be removed with the code section it refers to below.
| echo -e "${YELLOW}Upgrading pip to support PEP 735 dependency-groups...${NC}" | ||
| pip install --upgrade pip | ||
| fi | ||
|
|
There was a problem hiding this comment.
Does the pip install on mac need the gmp flags too?
There was a problem hiding this comment.
We should add it to this pip branch of the script then.
| python3 -m venv .venv | ||
| source .venv/bin/activate | ||
| ./scripts/setup_dev.sh | ||
|
|
There was a problem hiding this comment.
The script does work on linux, but it sounds like mac auto-manages the venv, where linux doesn't.
When you run the script on linux, you see this:
root@0e89be2e03a0:/py-libp2p# ./scripts/setup_dev.sh
Setting up py-libp2p development environment...
Warning: Not in a virtual environment. Creating one...
Virtual environment created. Activate it with:
source .venv/bin/activate
Then run this script again.Might be worth adding to docs so there are no surprises for new linux users.
There was a problem hiding this comment.
Claude keeps poking me that the virtual environment check isn't necessary, even in linux. And indeed, it does seem that the uv sync properly syncs in to a .venv. So maybe the whole virtual environment check in the uv branch of the script isn't even necessary.
Do you see the same behavior on mac?
|
Looking good! Couple comments/questions, good to merge once those are addressed. |
docs/contributing.rst
Outdated
| python3 -m venv ./venv | ||
| . venv/bin/activate | ||
| python3 -m venv .venv | ||
| source .venv/bin/activate |
There was a problem hiding this comment.
The use of . is a shorthand for source. It’s a bit more elegant—would you consider using it instead?"
There was a problem hiding this comment.
Didn't ask you specifically but If you change source with . in a place you should do everywhere
scripts/setup_dev.sh
Outdated
| pre-commit install | ||
|
|
||
| echo -e "${GREEN}Setup complete! You can now run 'make pr' to check your changes.${NC}" | ||
| echo -e "${GREEN}Setup complete! You can now run 'make pr' to check your changes.${NC}" |
There was a problem hiding this comment.
You could also add make docs to check docs (gives errors in CI/CD if doc generation has warnings)
What was wrong?
Contributing guide with
uvcommands were failing.Issue #1248
How was it fixed?
Fixed the
setup_dev.shscript to support default uv virtual environment directory.venvalong with the contributing guideTo-Do