zabbix-cli icon indicating copy to clipboard operation
zabbix-cli copied to clipboard

Missing documentation steps to start contributing

Open fauust opened this issue 1 year ago • 2 comments

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.

fauust avatar Nov 28 '24 11:11 fauust

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.

pederhan avatar Nov 28 '24 13:11 pederhan

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 :)

fauust avatar Nov 28 '24 13:11 fauust