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
4 changes: 4 additions & 0 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
uses: ./.github/actions/run_and_upload_unit_tests
with:
package-name: ni.measurementlink.discovery.v1.client
- name: Run and upload unit tests - ni.measurementlink.pinmap.v1.client
uses: ./.github/actions/run_and_upload_unit_tests
with:
package-name: ni.measurementlink.pinmap.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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Discovery Service, version 1. The corresponding service is defined in the
- [`ni.measurementlink.discovery.v1.proto`](https://github.com/ni/ni-apis-python/tree/main/packages/ni.measurementlink.discovery.v1.proto) -- provides Python stubs for the definitions in the `ni.measurementlink.discovery.v1` package. (.proto files at [ni/measurementlink/discovery/v1](https://github.com/ni/ni-apis/tree/main/ni/measurementlink/discovery/v1))
- [`ni.measurementlink.measurement.v1.proto`](https://github.com/ni/ni-apis-python/tree/main/packages/ni.measurementlink.measurement.v1.proto) -- provides Python stubs for the definitions in the `ni.measurementlink.measurement.v1` package. (.proto files at [ni/measurementlink/measurement/v1](https://github.com/ni/ni-apis/tree/main/ni/measurementlink/measurement/v1))
- [`ni.measurementlink.measurement.v2.proto`](https://github.com/ni/ni-apis-python/tree/main/packages/ni.measurementlink.measurement.v2.proto) -- provides Python stubs for the definitions in the `ni.measurementlink.measurement.v2` package. (.proto files at [ni/measurementlink/measurement/v2](https://github.com/ni/ni-apis/tree/main/ni/measurementlink/measurement/v2))
- [`ni.measurementlink.pinmap.v1.client`](https://github.com/ni/ni-apis-python/tree/main/packages/ni.measurementlink.pinmap.v1.client) -- provides gRPC client code for the NI Pin Map Service, version 1. The corresponding service is defined in the
`ni.measurementlink.pinmap.v1.proto` package.
- [`ni.measurementlink.pinmap.v1.proto`](https://github.com/ni/ni-apis-python/tree/main/packages/ni.measurementlink.pinmap.v1.proto) -- provides Python stubs for the definitions in the `ni.measurement.pinmap.v1` package. (.proto files at [ni/measurementlink/pinmap/v1](https://github.com/ni/ni-apis/tree/main/ni/measurementlink/pinmap/v1))
- [`ni.measurementlink.proto`](https://github.com/ni/ni-apis-python/tree/main/packages/ni.measurementlink.proto) -- provides Python stubs for the definitions in the `ni.measurementlink` package. (.proto files at [ni/measurementlink](https://github.com/ni/ni-apis/tree/main/ni/measurementlink))
- [`ni.measurementlink.sessionmanagement.v1.proto`](https://github.com/ni/ni-apis-python/tree/main/packages/ni.measurementlink.sessionmanagement.v1.proto) -- provides Python stubs for the definitions in the `ni.measurementlink.sessionmanagment.v1` package. (.proto files at [ni/measurementlink/sessionmanagement/v1](https://github.com/ni/ni-apis/tree/main/ni/measurementlink/sessionmanagement/v1))
Expand Down
4 changes: 4 additions & 0 deletions packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
"proto-include-path": "./third_party/ni-apis",
"output-format": "subpackage"
},
"ni.measurementlink.pinmap.v1.client": {
"proto-subpath": "",
"output-format": ""
},
"ni.measurementlink.pinmap.v1.proto": {
"proto-basepath": "./third_party/ni-apis",
"proto-subpath": "ni/measurementlink/pinmap/v1",
Expand Down
16 changes: 16 additions & 0 deletions packages/ni.measurementlink.pinmap.v1.client/.readthedocs.yaml
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==2.1.4
post_install:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry -C packages/ni.measurementlink.pinmap.v1.client install --only main,docs

sphinx:
configuration: packages/ni.measurementlink.pinmap.v1.client/docs/conf.py
27 changes: 27 additions & 0 deletions packages/ni.measurementlink.pinmap.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.pinmap.v1.client` is a Python package that provides a gRPC client for the
NI Pin Map Service, version 1. The corresponding service is defined in the
[ni.measurementlink.pinmap.v1.proto package](https://github.com/ni/ni-apis/tree/main/ni/measurementlink/pinmap/v1).

NI created and supports this package.

## Operating System Support

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

## Python Version Support

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

## Installation

You can directly install the `ni.measurementlink.pinmap.v1.client` package using `pip` or by listing it as a
dependency in your project's `pyproject.toml` file.
95 changes: 95 additions & 0 deletions packages/ni.measurementlink.pinmap.v1.client/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
"""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 = [
"autoapi.extension",
"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"]

# Optional: suppress warnings globally
suppress_warnings = [
"autoapi.python_import_resolution"
]


def process_docstring(app, what, name, obj, options, lines):
"""Make edits to docstrings as necessary"""
if r"@generated by mypy-protobuf" in lines[0]:
lines.clear()

def setup(sphinx):
"""Sphinx setup callback."""
sphinx.connect("autodoc-process-docstring", process_docstring)

# 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
21 changes: 21 additions & 0 deletions packages/ni.measurementlink.pinmap.v1.client/docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
##################################
gRPC Client for NI Pin Map Service
##################################

.. include:: intro.inc

Table of Contents
=================

.. toctree::
:maxdepth: 4

autoapi/index

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

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

About
-----

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

NI created and supports this package.

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

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

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

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

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

You can directly install the ``ni.measurementlink.pinmap.v1.client`` package using ``pip`` or by listing it as a dependency in
your project's ``pyproject.toml`` file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
API Reference
=============

This page contains auto-generated API reference documentation.

..
Custom index: reference https://github.com/readthedocs/sphinx-autoapi/issues/298
Add the top most levels in "ni.measurementlink.discovery.v1.client" to the index file
This is needed because we don't have __init__.py file in ni
and ni/measurementlink etc. package as we use nested implicit namespace packages.

.. toctree::
:titlesonly:

{% for page in pages | sort %}
{% if (page.top_level_object or page.name.split('.') | length == 5) and page.display %}
{{ page.include_path }}
{% endif %}
{% endfor %}
Loading
Loading