diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ca4418..90abe5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -43,8 +40,6 @@ jobs: steps: - uses: actions/checkout@v4 - with: - submodules: recursive - uses: astral-sh/setup-uv@v6 with: @@ -70,8 +65,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: recursive - uses: astral-sh/setup-uv@v6 with: diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index eaaa044..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "dae-py-relay-controller"] - path = dae-py-relay-controller - url = https://github.com/petersbingham/dae-py-relay-controller.git diff --git a/README.md b/README.md index 9c2cc52..21caec4 100644 --- a/README.md +++ b/README.md @@ -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. @@ -16,47 +17,33 @@ 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 -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 @@ -64,9 +51,9 @@ 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 @@ -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 @@ -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. diff --git a/dae-py-relay-controller b/dae-py-relay-controller deleted file mode 160000 index 9fb005f..0000000 --- a/dae-py-relay-controller +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9fb005fda0a9168e02087f2d7ce323d05d0038ec diff --git a/pyproject.toml b/pyproject.toml index d6503e3..d449d91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,24 +4,34 @@ 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" @@ -29,11 +39,6 @@ denkovi = "denkovi_cli.cli:main" 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", diff --git a/src/denkovi_cli/board.py b/src/denkovi_cli/board.py index 6fd022c..758c50a 100644 --- a/src/denkovi_cli/board.py +++ b/src/denkovi_cli/board.py @@ -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 diff --git a/uv.lock b/uv.lock index 9c5a3ad..f4822ee 100644 --- a/uv.lock +++ b/uv.lock @@ -14,7 +14,11 @@ wheels = [ [[package]] name = "dae-relayboard" version = "1.5.2" -source = { directory = "dae-py-relay-controller" } +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/42/49/d0451e3fb5f8509705b63f82363c7c44fd7c179a3099ca67b4178f66e846/dae_relayboard-1.5.2.tar.gz", hash = "sha256:d0722c26253e78c64b367881ba6329042cccf2faaa5ce22ad092d23008c7e635", size = 9839, upload-time = "2024-08-02T01:49:21.327Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2b/d6/2f48df66385a042053a2d620dbe9f73d4a6e75d8e8f56a2291b8a66878e9/dae_RelayBoard-1.5.2-py3-none-any.whl", hash = "sha256:c80a640d138a4c1792a7bd8a1cc6978c90f792caf8fdd182219daa0c9f56e0a3", size = 13967, upload-time = "2024-08-02T01:49:19.498Z" }, +] [[package]] name = "denkovi-cli" @@ -33,7 +37,7 @@ dev = [ [package.metadata] requires-dist = [ - { name = "dae-relayboard", directory = "dae-py-relay-controller" }, + { name = "dae-relayboard", specifier = ">=1.5.2" }, { name = "pyserial", specifier = ">=3.5" }, ]