Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5ba63e0
Add discovery.v1 package
dixonjoel Aug 13, 2025
51922b4
Distinguish subpackage vs submodule
dixonjoel Aug 13, 2025
741d4d5
Remove check for discovery.v1 package - it's new
dixonjoel Aug 13, 2025
f53ec15
Explicitly pass the output-format
dixonjoel Aug 13, 2025
2cd83f4
Add .proto to discovery namespace
dixonjoel Aug 13, 2025
a655c4f
Remove some dependencies
dixonjoel Aug 13, 2025
314e174
Exclude __init__.py
dixonjoel Aug 13, 2025
e6a7d82
Exclude __init__.py from pyright and also remove PyPy references
dixonjoel Aug 13, 2025
98e6a54
Remove incorrect line
dixonjoel Aug 13, 2025
37016f4
Exclude __init__.py* to exclude __init__.pyi
dixonjoel Aug 13, 2025
56eb953
Test to see if docs will build with same content as ni.protobuf.types
dixonjoel Aug 14, 2025
ab001c6
Get the discovery docs building. Probably not working correctly, but …
dixonjoel Aug 14, 2025
9355f62
Additional PR feedback and cleanup
dixonjoel Aug 14, 2025
d87b078
Include ni.measurementlink.discovery.v1.proto in publish options
dixonjoel Aug 14, 2025
48130c2
Include a ni.measurementlink.measurement.v2 package
dixonjoel Aug 14, 2025
fa992b5
Add a docs configuration
dixonjoel Aug 14, 2025
6c6a775
Add .proto in the directory name. Add docs and pyproject.toml
dixonjoel Aug 14, 2025
b7fdd01
Add measurement.v1.proto package
dixonjoel Aug 14, 2025
406dd3f
Add measurement packages to build
dixonjoel Aug 14, 2025
772cf40
Merge remote-tracking branch 'origin/main' into users/jdixon/ni-measu…
dixonjoel Aug 14, 2025
ff51bbf
Delete _build folder contents. Restore discovery.v1 docs files.
dixonjoel Aug 14, 2025
7a4bbd4
Fix v1 excludes
dixonjoel Aug 14, 2025
e4ab122
Fix v1 excludes for ni-python-styleguide
dixonjoel Aug 14, 2025
907a108
Restore discovery pyproject
dixonjoel Aug 14, 2025
3909550
Fix mypy errors. Do not run it on __init__.py*
dixonjoel Aug 14, 2025
51b0412
Remove duplicate copyright line
dixonjoel Aug 14, 2025
0f7e8dd
Add some suppressions for mypy errors
dixonjoel Aug 15, 2025
4015c45
Fix some v1 / v2 copy pasta
dixonjoel Aug 15, 2025
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
6 changes: 6 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
- package-name: ni.measurementlink.discovery.v1.proto
proto-subpath: ni/measurementlink/discovery/v1
output-format: subpackage
- package-name: ni.measurementlink.measurement.v1.proto
proto-subpath: ni/measurementlink/measurement/v1
output-format: subpackage
- package-name: ni.measurementlink.measurement.v2.proto
proto-subpath: ni/measurementlink/measurement/v2
output-format: subpackage
uses: ./.github/workflows/check_package.yml
with:
package-name: ${{ matrix.package-name }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ on:
- ni.panels.v1.proto
- ni.protobuf.types
- ni.measurementlink.discovery.v1.proto
- ni.measurementlink.measurement.v1.proto
- ni.measurementlink.measurement.v2.proto

env:
environment: ${{ github.event_name == 'release' && 'pypi' || inputs.environment }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
copyright = f"2025-%Y, {company}"
if datetime.datetime.now().year == 2025:
copyright = f"%Y, {company}"
copyright = f"%Y, {company}"


# The version info for the project you're documenting, acts as replacement for
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.proto install --only main,docs

sphinx:
configuration: packages/ni.measurementlink.discovery.v1.proto/docs/conf.py
26 changes: 26 additions & 0 deletions packages/ni.measurementlink.measurement.v1.proto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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.measurement.v1.proto` is a Python package that provides data types for NI gRPC APIs in
the [ni.measurementlink.measurement.v1 package](https://github.com/ni/ni-apis/tree/main/ni/measurementlink/measurement/v1).

NI created and supports this package.

## Operating System Support

`ni.measurementlink.measurement.v1.proto` supports Windows and Linux operating systems.

## Python Version Support

`ni.measurementlink.measurement.v1.proto` supports CPython 3.9+.

## Installation

You can directly install the `ni.measurementlink.measurement.v1.proto` 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.measurement.v1.proto/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 = ["*.pyi", "*.py"]
autoapi_ignore = [
'**/__init__.py',
]


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),
# }


# -- 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 @@
#########################################
Protobuf types for NI discovery gRPC APIs
#########################################

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

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

About
-----

The ``ni.measurementlink.discovery.v1.proto`` Python package contains generated Python interfaces for proto files in the ``ni-apis`` repo.

NI created and supports this package.

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

``ni.measurementlink.discovery.v1.proto`` supports Windows and Linux operating systems.

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

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

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

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