Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add poetry setup to CONTRIBUTING.md #89

Open
planetf1 opened this issue Jan 8, 2025 · 2 comments
Open

Add poetry setup to CONTRIBUTING.md #89

planetf1 opened this issue Jan 8, 2025 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@planetf1
Copy link
Collaborator

planetf1 commented Jan 8, 2025

The CONTRIBUTING.md has information on creating a virtual environment and setting up the tools needed for Bee

After creating a virtual environment and activating, the docs include an invocation of poetry shell. However at this point poetry is likely not installed. Additionally, the 'shell' command is now in a plugin.

We could add
pip install poetry poetry-plugin-shell

However, in addition, poetry shell does not create a virtual environment - this would also need adding (Note: am unfamilar with poetry)

python -m venv .venv 

This will help a new contributor get their environment sorted more quickly.

Since a similar CONTRIBUTING.md is used in other parts of the bee stack we may wish to update elsewhere (or link together)?

That being said, we don't yet have a pyproject.toml so poetry shell will not (yet) work ...

@psschwei
Copy link
Collaborator

psschwei commented Jan 8, 2025

The contributing doc implicitly focuses on the python bee agent more than the hive (indeed, hive hasn't been configured to use poetry yet as you mention), so we'll need to update that.

Also worth noting that the recommended way to setup poetry is via pipx, which will install in a virtual environment so as not to break system Python but allow poetry to be used globally. Once that's done, running poetry shell will create a new virtual environment when run from a directory with a pyproject.toml:

$ cd /tmp

$ git clone [email protected]:i-am-bee/bee-hive.git
Cloning into 'bee-hive'...
remote: Enumerating objects: 389, done.
remote: Counting objects: 100% (138/138), done.
remote: Compressing objects: 100% (110/110), done.
remote: Total 389 (delta 46), reused 65 (delta 25), pack-reused 251 (from 1)
Receiving objects: 100% (389/389), 504.44 KiB | 5.31 MiB/s, done.
Resolving deltas: 100% (128/128), done.

$ cd bee-hive/framework/bee-py/

$ poetry shell
Creating virtualenv bee-agent-hWeAOn7W-py3.12 in /home/paul/.cache/pypoetry/virtualenvs
Spawning shell within /home/paul/.cache/pypoetry/virtualenvs/bee-agent-hWeAOn7W-py3.12
. /home/paul/.cache/pypoetry/virtualenvs/bee-agent-hWeAOn7W-py3.12/bin/activate

@planetf1
Copy link
Collaborator Author

planetf1 commented Jan 9, 2025

Adding a note that the shell is not part of a standard poetry install (any more). After the pipx it can be installed with poetry self add poetry-plugin-shell

@maximilien maximilien added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants