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
8 changes: 8 additions & 0 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ jobs:
uses: ./.github/actions/run_and_upload_unit_tests
with:
package-name: ni.measurementlink.measurement.v2.proto
- name: Run and upload unit tests - ni-grpc-extensions
uses: ./.github/actions/run_and_upload_unit_tests
with:
package-name: ni-grpc-extensions
- name: Run and upload unit tests - ni.measurementlink.discovery.v1.client
uses: ./.github/actions/run_and_upload_unit_tests
with:
package-name: ni.measurementlink.discovery.v1.client
# Run grpc_generator unit tests on its oldest supported version.
- name: Run and upload unit tests - grpc_generator
if: ${{ !contains(fromJSON('["3.9", "3.10"]'), matrix.python-version) }}
Expand Down
4 changes: 4 additions & 0 deletions packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"proto-include-path": "./proto",
"output-format": "subpackage"
},
"ni.measurementlink.discovery.v1.client": {
"proto-subpath": "",
"output-format": ""
},
"ni.measurementlink.discovery.v1.proto": {
"proto-basepath": "./third_party/ni-apis",
"proto-subpath": "ni/measurementlink/discovery/v1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# .readthedocs.yml

version: 2

build:
os: ubuntu-24.04
tools:
python: "3.11"
jobs:
post_create_environment:
- pip install poetry==1.8.2
post_install:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry -C packages/ni.measurementlink.discovery.v1.client install --only main,docs

sphinx:
configuration: packages/ni.measurementlink.discovery.v1.client/docs/conf.py
27 changes: 27 additions & 0 deletions packages/ni.measurementlink.discovery.v1.client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Table of Contents

- [Table of Contents](#table-of-contents)
- [About](#about)
- [Operating System Support](#operating-system-support)
- [Python Version Support](#python-version-support)

# About

`ni.measurementlink.discovery.v1.client` is a Python package that provides a gRPC client for the
NI Discovery Service, version 1. The corresponding service is defined in the
[ni.measurementlink.discovery.v1.proto package](https://github.com/ni/ni-apis/tree/main/ni/measurementlink/discovery/v1).

NI created and supports this package.

## Operating System Support

`ni.measurementlink.discovery.v1.client` supports Windows operating systems.

## Python Version Support

`ni.measurementlink.discovery.v1.client` supports CPython 3.9+.

## Installation

You can directly install the `ni.measurementlink.discovery.v1.client` package using `pip` or by listing it as a
dependency in your project's `pyproject.toml` file.
87 changes: 87 additions & 0 deletions packages/ni.measurementlink.discovery.v1.client/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
"""Sphinx Configuration File."""

import datetime
import pathlib

import autoapi.extension
import toml

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"m2r2",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
]

root_path = pathlib.Path(__file__).parent.parent
pyproj_file = root_path / "pyproject.toml"
proj_config = toml.loads(pyproj_file.read_text())


project = proj_config["tool"]["poetry"]["name"]
company = "National Instruments"
copyright = f"2025-%Y, {company}"
if datetime.datetime.now().year == 2025:
copyright = f"%Y, {company}"


# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
version = proj_config["tool"]["poetry"]["version"]
release = ".".join(version.split(".")[:2])
description = proj_config["tool"]["poetry"]["description"]


htmlhelp_basename = f"{project}doc"


# tell autoapi to doc the public options
autoapi_options = list(autoapi.extension._DEFAULT_OPTIONS)
autoapi_options.remove("private-members") # note: remove this to include "_" members in docs
autoapi_dirs = [root_path / "src" / "ni"]
autoapi_python_use_implicit_namespaces = True
autoapi_template_dir = "templates/autoapi"
autoapi_python_class_content = "both"
autoapi_type = "python"
autodoc_typehints = "description"
autoapi_file_patterns = ["*.py"]
autoapi_ignore = [
'**/__init__.py',
]


def setup(sphinx):
"""Sphinx setup callback."""
pass

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "__init__.py"]

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"grpc": ("https://grpc.github.io/grpc/python/", None),
}

# -- Options for HTML output ----------------------------------------------


# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_theme_options = {
"navigation_depth": -1,
}

templates_path = ["templates"]

# Napoleon settings
napoleon_numpy_docstring = False
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
####################################
gRPC Client for NI Discovery Service
####################################

.. toctree::
:maxdepth: 1
:caption: Contents:

27 changes: 27 additions & 0 deletions packages/ni.measurementlink.discovery.v1.client/docs/intro.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Introduction
============

About
-----

The ``ni.measurementlink.discovery.v1.client`` Python package provides a gRPC client for the
NI Discovery Service, version 1. The corresponding service is defined in the
``ni.measurementlink.discovery.v1.proto`` package.

NI created and supports this package.

Operating System Support
------------------------

``ni.measurementlink.discovery.v1.client`` supports Windows operating systems.

Python Version Support
----------------------

``ni.measurementlink.discovery.v1.client`` supports CPython 3.9+.

Installation
------------

You can directly install the ``ni.measurementlink.discovery.v1.client`` package using ``pip`` or by listing it as a dependency in
your project's ``pyproject.toml`` file.
Loading
Loading