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

Missing documentation steps to start contributing #260

Open
fauust opened this issue Nov 28, 2024 · 2 comments
Open

Missing documentation steps to start contributing #260

fauust opened this issue Nov 28, 2024 · 2 comments

Comments

@fauust
Copy link

fauust commented Nov 28, 2024

Hi!
I am not very familiar with this python environment setup (and hatch), but I am missing some explanatory steps to start building the project and contributing.

Here is what I did since uv venv is not sufficient (or there is a magic step that I am missing):

- uv venv
+ uv venv
+ source .venv/bin/activate
+ uv pip install hatch
+ uv pip install -r pyproject.toml

Which is probably not accurate, should I open a PR based on that, let me know.

@pederhan
Copy link
Member

pederhan commented Nov 28, 2024

Thanks for reporting this, I'll try to improve it. I am considering leaving out Hatch from the instructions, since we have now switched over to uv dependency groups for managing environments. We only use Hatch for building and versioning the project, which doesn't really involve the Hatch CLI at all.

When it comes to venv management, I don't think it's necessary to do any manual venv creation or installation beyond:

uv sync

This requires uv >= 0.5.0, which supports PEP 735 dependency groups.

With uv, you don't even need to activate the environment if. Running uv run pytest or uv run zabbix-cli will set up the environment and install dependencies automatically:

$ uv run zabbix-cli
Using CPython 3.12.7 interpreter at: /usr/bin/python3
Creating virtual environment at: .venv
Installed 88 packages in 247ms
╭───────────────────────────────────────────────────────╮
│ Welcome to the Zabbix command-line interface (v3.4.0) │
│ Connected to server https://<redacted> (v7.0.3)       │
╰───────────────────────────────────────────────────────╯
Type --help to list commands, :h for REPL help, :q to exit.

I will update the docs to reflect the changes made to environment management. They were written while we still relied on manual venv creation and installation from pyproject.toml dependencies.

@fauust
Copy link
Author

fauust commented Nov 28, 2024

Thanks @pederhan! I was not aware of that and I had to upgrade my uv version since the tool command was not available on my old version!

uv sync is very nice and fast. I'll still try to continue sourcing venv (with direnv) though, it makes me feel a bit more confident and I am used to that changing prompt :)

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

No branches or pull requests

2 participants