Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# The relay library is a submodule, and uv sync builds it.
submodules: recursive

- uses: astral-sh/setup-uv@v6
with:
Expand All @@ -43,8 +40,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: astral-sh/setup-uv@v6
with:
Expand All @@ -70,8 +65,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: astral-sh/setup-uv@v6
with:
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

59 changes: 23 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# denkovi-cli

[![CI](../../actions/workflows/ci.yml/badge.svg)](../../actions/workflows/ci.yml)
[![CI](https://github.com/bitcrushtesting/denkovi_cli/actions/workflows/ci.yml/badge.svg)](https://github.com/bitcrushtesting/denkovi_cli/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/denkovi-cli.svg)](https://pypi.org/project/denkovi-cli/)

Command line control of [Denkovi](https://denkovi.com) USB relay boards.

Expand All @@ -16,57 +17,43 @@ on: 1, 3 [0x0005]

## Install

Python 3.12 or newer. The relay library is a git submodule, so clone with it:
Python 3.12 or newer.

```sh
git clone --recurse-submodules <this repo>
cd denkovi_cli
uv tool install denkovi-cli # or: pipx install denkovi-cli
```

If the repository was cloned without `--recurse-submodules`, run
`git submodule update --init` first, otherwise there is nothing to build.

### With uv
That puts `denkovi` on your PATH. To add it to a project instead:

```sh
uv sync
uv add denkovi-cli # or: pip install denkovi-cli
```

### With pip

uv is not required; this is a standard PEP 621 package.
### From a source checkout

```sh
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install ./dae-py-relay-controller # the submodule, first
pip install .
git clone https://github.com/bitcrushtesting/denkovi_cli
cd denkovi_cli
uv sync # or: pip install .
```

Install the submodule first, as above, if you want the copy this repository pins.
pip does not read `[tool.uv.sources]`, which is what points the `dae-RelayBoard`
dependency at the submodule, so a bare `pip install .` downloads `dae_RelayBoard`
from PyPI instead. Both work and both give version 1.5.2 — the PyPI release differs
only in code formatting — but only the two-step form is guaranteed to track the
submodule.

### Without installing anything

To run from a source checkout with only pyserial present:
To run from a source checkout with only the two runtime dependencies present:

```sh
pip install pyserial
PYTHONPATH=src:dae-py-relay-controller python -m denkovi_cli.cli status
pip install pyserial dae-RelayBoard
PYTHONPATH=src python -m denkovi_cli.cli status
```

`--version` reports `0.0.0+unknown` this way, since there is no installed package to
read it from.

### Running the command

The examples below are written as `uv run denkovi ...`. Drop the `uv run` prefix when
the virtualenv is activated, or after `uv tool install .` / `pipx install .`, which
put `denkovi` on your PATH.
The examples below are written as `uv run denkovi ...`, which is what a source
checkout needs. Drop the `uv run` prefix after `uv tool install` or `pipx install`,
or whenever the virtualenv is activated.

## Usage

Expand Down Expand Up @@ -203,16 +190,16 @@ against Python 3.12 to 3.14.
## Credits

The board communication is done by **[dae-py-relay-controller][lib]** by
[Peter Bingham][author], vendored here as a git submodule. It implements both the
ASCII serial protocol of the 16 relay boards and the D2XX bit-banging of the 4 and 8
relay boards; this project only adds discovery, argument parsing and output on top.
The library is distributed under the MIT licence — see
[`dae-py-relay-controller/README.md`](dae-py-relay-controller/README.md).
[Peter Bingham][author], taken from PyPI as [`dae_RelayBoard`][pypi]. It implements
both the ASCII serial protocol of the 16 relay boards and the D2XX bit-banging of the
4 and 8 relay boards; this project only adds discovery, argument parsing and output
on top. The library is distributed under the MIT licence.

Relay boards and their documentation are made by [Denkovi Assembly Electronics][denkovi],
who are not affiliated with this project.

[lib]: https://github.com/petersbingham/dae-py-relay-controller
[pypi]: https://pypi.org/project/dae-RelayBoard/
[author]: https://github.com/petersbingham
[denkovi]: https://denkovi.com

Expand All @@ -226,5 +213,5 @@ Foundation. It is distributed in the hope that it will be useful, but WITHOUT AN
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See [LICENSE](LICENSE) for the full text.

The MIT licence of the vendored library is compatible with the GPL, so the combined
work may be distributed under the GPL. The submodule keeps its own MIT licence.
The MIT licence of `dae_RelayBoard` is compatible with the GPL, so the combined work
may be distributed under the GPL. That library keeps its own MIT licence.
1 change: 0 additions & 1 deletion dae-py-relay-controller
Submodule dae-py-relay-controller deleted from 9fb005
19 changes: 12 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,41 @@ version = "0.1.0"
description = "Command line control of Denkovi USB relay boards"
readme = "README.md"
authors = [
{ name = "Bernhard Trinnes", email = "bernhard.trinnes@bitcushtesting.com" }
{ name = "Bernhard Trinnes", email = "bernhard.trinnes@bitcrushtesting.com" }
]
requires-python = ">=3.12"
license = "GPL-2.0-only"
license-files = ["LICENSE"]
keywords = ["denkovi", "relay", "usb", "ftdi", "automation", "cli"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: System :: Hardware :: Hardware Drivers",
]
dependencies = [
"pyserial>=3.5",
"dae-RelayBoard",
"dae-RelayBoard>=1.5.2",
]

[project.urls]
Homepage = "https://github.com/bitcrushtesting/denkovi_cli"
Repository = "https://github.com/bitcrushtesting/denkovi_cli"
Issues = "https://github.com/bitcrushtesting/denkovi_cli/issues"

[project.scripts]
denkovi = "denkovi_cli.cli:main"

[build-system]
requires = ["uv_build>=0.12.5,<0.13.0"]
build-backend = "uv_build"

# The Denkovi board library is vendored as a git submodule. It is a legacy
# setup.py-only project, so it is pulled in by path rather than from PyPI.
[tool.uv.sources]
dae-RelayBoard = { path = "dae-py-relay-controller" }

[dependency-groups]
dev = [
"pytest>=9.1.1",
Expand Down
5 changes: 2 additions & 3 deletions src/denkovi_cli/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

"""Discovery of, and access to, Denkovi USB relay boards.

Thin wrapper around the vendored ``dae_RelayBoard`` library (see the
``dae-py-relay-controller`` submodule) that adds device discovery, board type
probing and errors that are fit to show to a user.
Thin wrapper around the ``dae_RelayBoard`` library that adds device discovery,
board type probing and errors that are fit to show to a user.
"""

from __future__ import annotations
Expand Down
8 changes: 6 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading