generated from ni/github-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Add the discovery client package to ni-apis-python #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
cbb6fd2
Unit tests and linters are passing.
b6eb783
Update docs.
39eaf10
Fix up the index page title and remove commented dep.
1d136b7
Address PR feedback.
060c511
Merge branch 'main' into users/mjohanse/discovery_client
3986eab
Add new package to packages.json
fde30c5
Move ServiceInfo into _types.py.
92976db
Update docstring for deployment target.
5785dfd
Fix some comments and change to use Popen[bytes].
4f3ff98
Add __weakref__ to slots.
fb541bf
Switch to Popen[Any].
ca9bdfc
Add pywin32 dev dependency on Linux to address pyright warning.
c8bef3c
Remove pywin32 dep on linux because it errors during install.
99b08ad
Disable reportinMissingModuleSource pyright warnings.
72bb258
Merge branch 'main' into users/mjohanse/discovery_client
6443ad4
Add a py.typed marker.
df74bb3
Add ni-grpc-extensions and ni.measurementlink.discovery.v1.client to …
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/ni.measurementlink.discovery.v1.client/.readthedocs.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
87
packages/ni.measurementlink.discovery.v1.client/docs/conf.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
8 changes: 8 additions & 0 deletions
8
packages/ni.measurementlink.discovery.v1.client/docs/index.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
27
packages/ni.measurementlink.discovery.v1.client/docs/intro.inc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.