Metadata-Version: 2.4
Name: sphinx-needs-trace
Version: 0.1.0
Summary: Traceability findings, totals, an interactive trace graph and a merge of needs.json files for sphinx-needs.
License-Expression: MIT
License-File: LICENSE
Author: cuinixam
Author-email: cuinixam@gmail.com
Requires-Python: >=3.11
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: Sphinx :: Extension
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Documentation :: Sphinx
Requires-Dist: sphinx (>=7.4)
Requires-Dist: sphinx-needs (>=9.3)
Project-URL: Bug Tracker, https://github.com/yanga-project/sphinx-needs-trace/issues
Project-URL: Changelog, https://github.com/yanga-project/sphinx-needs-trace/blob/main/CHANGELOG.md
Project-URL: Repository, https://github.com/yanga-project/sphinx-needs-trace
Description-Content-Type: text/markdown

# sphinx-needs-trace

A Sphinx extension for projects that use [sphinx-needs](https://sphinx-needs.readthedocs.io): see in the report what is traced and what is missing.

- `traceability-findings`: the findings of the sphinx-needs schema rules as a table.
- `traceability-totals`: total, traced and missing per type.
- `trace-graph`: a link to an interactive trace graph page with search and a view per trace item.
- `merge_needs_files`: merge the `needs.json` files of several builds of one product into one file that `needimport` reads.

A trace item is one element of the trace chain: a requirement, a spec, an implementation, a test, a test result. sphinx-needs calls it a "need".

## Installation

```bash
pip install sphinx-needs-trace
```

It needs Python 3.11 or newer and sphinx-needs 9.3 or newer.

## Usage

In `conf.py`:

```python
extensions = ["sphinx_needs", "sphinx_needs_trace"]
```

On a page:

```rst
.. traceability-totals::

.. traceability-findings::

.. trace-graph::
```

The [documentation](docs/index.md) describes the directives, the graph page and the merge functions.

## Third-party code

The package contains a copy of [Cytoscape.js](https://js.cytoscape.org) 3.35.0 (`src/sphinx_needs_trace/static/cytoscape.min.js`), which draws the trace graph. Cytoscape.js is under the MIT licence; its licence text is next to the copy in `cytoscape.LICENSE`.

## Development

```bash
pipx install pypeline-runner
pypeline run
```

`pypeline run` creates the virtual environment with uv, runs pre-commit, the tests and the docs build. uv and pipx are needed on macOS, Ubuntu and Windows; there are no other system dependencies.

## Licence

MIT, see [LICENSE](LICENSE).

