Skip to content

docs: update development setup commands and scripts for uv#1249

Open
asabya wants to merge 5 commits intolibp2p:mainfrom
asabya:fix_contributing_commands
Open

docs: update development setup commands and scripts for uv#1249
asabya wants to merge 5 commits intolibp2p:mainfrom
asabya:fix_contributing_commands

Conversation

@asabya
Copy link
Copy Markdown
Contributor

@asabya asabya commented Feb 27, 2026

What was wrong?

Contributing guide with uv commands were failing.

Issue #1248

How was it fixed?

Fixed the setup_dev.sh script to support default uv virtual environment directory .venv along with the contributing guide

To-Do

  • Check the script and guide on linux and windows

@asabya
Copy link
Copy Markdown
Contributor Author

asabya commented Feb 27, 2026

Screen.Recording.2026-02-27.at.4.41.43.PM.mov

@asabya
Copy link
Copy Markdown
Contributor Author

asabya commented Apr 2, 2026

@seetadev @acul71 @sumanjeet0012 This needs a bit of love.

@seetadev
Copy link
Copy Markdown
Contributor

seetadev commented Apr 2, 2026

@asabya : This is fantastic. Please add a newsfragment.

Adding @pacrob to the thread.

Comment on lines 170 to 171
On macOS, help the build command find and link against the ``gmp`` library:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the pip install on mac need the gmp flags too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add it to this pip branch of the script then.

python3 -m venv .venv
source .venv/bin/activate
./scripts/setup_dev.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@pacrob
Copy link
Copy Markdown
Member

pacrob commented Apr 2, 2026

Looking good! Couple comments/questions, good to merge once those are addressed.

python3 -m venv ./venv
. venv/bin/activate
python3 -m venv .venv
source .venv/bin/activate
Copy link
Copy Markdown
Contributor

@acul71 acul71 Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of . is a shorthand for source. It’s a bit more elegant—would you consider using it instead?"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't ask you specifically but If you change source with . in a place you should do everywhere

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}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also add make docs to check docs (gives errors in CI/CD if doc generation has warnings)

@asabya asabya requested review from acul71 and pacrob April 3, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants