Skip to content

Commit 26ea51f

Browse files
committed
update docs as requested by review
1 parent 91b50d6 commit 26ea51f

1 file changed

Lines changed: 50 additions & 52 deletions

File tree

doc/development.rst

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -77,53 +77,57 @@ Step-by-Step Contribution Guide
7777
7878
2. **Set Up Your Development Environment**
7979

80-
You can use either `pipx <https://pipx.pypa.io/>`__ or `uv <https://docs.astral.sh/uv/>`__
81-
to install development tools. Both methods are supported:
80+
We recommend using `uv <https://docs.astral.sh/uv/>`__ to install development tools and run CLI utilities.
81+
`uv` is a modern Python packaging tool that can quickly create virtual environments and manage dependencies,
82+
including downloading required Python versions automatically. The `uvx` command allows you to run CLI tools
83+
in isolated environments, separate from your global Python installation. This is useful for installing and
84+
running Python applications (such as tox) without affecting your project's dependencies or environment.
8285

83-
* **pipx** is a tool for installing and running Python applications (such as tox)
84-
in isolated environments, separate from your global Python installation.
85-
It is useful for globally installing CLI tools without affecting your project's dependencies or environment.
86-
* **uv** is a modern Python packaging tool that can quickly create virtual environments and manage dependencies,
87-
including downloading required Python versions automatically.
88-
The `uvx` command also provides functionality similar to pipx,
89-
allowing you to run CLI tools in isolated environments.
86+
**Install tox (if not already available):**
9087

91-
Choose the method that best fits your workflow and system setup.
9288

93-
**Install tox (if not already available):**
89+
.. code-block:: shell
9490
95-
.. tab:: Using uv
91+
uv tool install tox --with tox-uv
9692
97-
.. code-block:: shell
9893
99-
uv tool install tox --with tox-uv
94+
**Quickly running your local python-can code**
10095

101-
.. tab:: Using pipx
96+
To run a local script (e.g., `snippet.py`) using your current python-can code,
97+
you can use either the traditional `virtualenv` and `pip` workflow or the modern `uv` tool.
10298

103-
.. code-block:: shell
99+
**Traditional method (virtualenv + pip):**
100+
101+
Create a virtual environment and install the package in editable mode.
102+
This allows changes to your local code to be reflected immediately, without reinstalling.
104103

105-
pipx install tox
104+
.. code-block:: shell
106105
107-
**Create a virtual environment and install python-can in editable mode**
106+
# Create a new virtual environment
107+
python -m venv .venv
108108
109-
.. tab:: Using uv
109+
# Activate the environment
110+
.venv\Scripts\activate # On Windows
111+
source .venv/bin/activate # On Unix/macOS
110112
111-
.. code-block:: shell
113+
# Upgrade pip and install python-can in editable mode with development dependencies
114+
python -m pip install --upgrade pip
115+
pip install -e .[dev]
112116
113-
uv venv
114-
.venv\Scripts\activate # On Windows
115-
source .venv/bin/activate # On Unix/macOS
116-
uv pip install -e . --group dev
117+
# Run your script
118+
python snippet.py
117119
118-
.. tab:: Using virtualenv and pip
120+
**Modern method (uv):**
119121

120-
.. code-block:: shell
122+
With `uv`, you can run your script directly:
121123

122-
python -m venv .venv
123-
.venv\Scripts\activate # On Windows
124-
source .venv/bin/activate # On Unix/macOS
125-
python -m pip install --upgrade pip
126-
pip install -e . --group dev
124+
.. code-block:: shell
125+
126+
uv run snippet.py
127+
128+
When ``uv run ...`` is called inside a project,
129+
`uv` automatically sets up the environment and symlinks local packages.
130+
No editable install is needed—changes to your code are reflected immediately.
127131

128132
3. **Make Your Changes**
129133

@@ -158,28 +162,17 @@ Step-by-Step Contribution Guide
158162
tox p
159163
160164
Some environments require specific Python versions.
161-
If you use `uv`, it will automatically download and manage these for you.
162-
With `pipx`, you may need to install the required Python versions yourself.
165+
If you use `uv`, it will automatically download and manage these for you.
163166

164167
5. **(Optional) Build Source Distribution and Wheels**
165168

166-
If you want to manually build the source distribution (sdist) and wheels for python-can,
167-
you can use either `uvx` or `pipx` to run the build and twine tools.
168-
Choose the method that best fits your workflow.
169-
170-
.. tab:: Using uvx
171-
172-
.. code-block:: shell
169+
If you want to manually build the source distribution (sdist) and wheels for python-can,
170+
you can use `uvx` to run the build and twine tools:
173171

174-
uvx --from build pyproject-build --installer uv
175-
uvx twine check --strict dist/*
176-
177-
.. tab:: Using pipx
178-
179-
.. code-block:: shell
172+
.. code-block:: shell
180173
181-
pipx run build
182-
pipx run twine check dist/*
174+
uv build
175+
uvx twine check --strict dist/*
183176
184177
6. **Push and Submit Your Contribution**
185178

@@ -197,10 +190,15 @@ Creating a new interface/backend
197190
--------------------------------
198191

199192
.. attention::
200-
We strongly recommend using the :ref:`plugin interface` to extend python-can.
201-
Publish a python package that contains your :class:`can.BusABC` subclass and use
202-
it within the python-can API. We will mention your package inside this documentation
203-
and add it as an optional dependency.
193+
Please note: Pull requests that attempt to add new hardware interfaces directly to the
194+
python-can codebase will not be accepted. Instead, we encourage contributors to create
195+
plugins by publishing a Python package containing your :class:`can.BusABC` subclass and
196+
using it within the python-can API. We will mention your package in this documentation
197+
and add it as an optional dependency. For current best practices, please refer to
198+
:ref:`plugin interface`.
199+
200+
The following guideline is retained for informational purposes only and is not valid for new
201+
contributions.
204202

205203
These steps are a guideline on how to add a new backend to python-can.
206204

0 commit comments

Comments
 (0)