Skip to content

Commit

Permalink
docs: replace poetry with uv in commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kai687 committed Nov 20, 2024
1 parent 4302a5d commit 85e8010
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@ Install the Python dependencies

.. code-block:: bash
poetry install
uv sync
#. Optional: install and test the pre-commit hooks:

.. code-block:: bash
poetry run pre-commit install
uv tool install pre-commit
pre-commit install --hook-type pre-push
If you don't plan on committing any changes to the repository,
If you don't plan on publishing any changes to the repository,
you can skip this step.
You can see the active pre-commit hooks in the file :gh:`.pre-commit-config.yaml`.

To test pre-commit with Poetry, run:
To test hooks, run:

.. code-block:: bash
poetry run pre-commit run --all
pre-commit run --all
.. note::

This project runs the hooks before you push instead.
More commonly, hooks run before every commit.

#. Test your Nox environment.

Expand Down
19 changes: 5 additions & 14 deletions docs/how-to/build-your-own/includes/prepare-python-environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@
Prepare Python environment
--------------------------

The |product| uses these Python tools:
To build the |product|, you'll need uv_ and Nox_.

- Poetry_ to manage the Python dependencies and building the package
- Nox_ to test and lint the Python code, and to build the docs
- Pipx_ to install Python applications in isolated environments and making them available globally

.. _Poetry: https://python-poetry.org/
.. _uv: https://docs.astral.sh/uv/
.. _Nox: https://nox.thea.codes/en/stable/
.. _Pipx: https://pipx.pypa.io/stable/

If you want to use the same versions of the Python tools,
you can provide a :gh:`requirements.txt <requirements.txt>` to the install commands.

To prepare the Python environment, run these commands:
Use your preferred installation method to install these tools.
For example, if you're already using uv, run:

.. code-block:: bash
pip install --user pipx [--requirement=requirements.txt]
pipx install poetry [--pip-args=--requirement=requirements.txt]
pipx install nox [--pip-args=--requirement=requirements.txt]
uv tool install nox

0 comments on commit 85e8010

Please sign in to comment.