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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "third_party/ni-apis"]
path = third_party/ni-apis
url = https://github.com/ni/ni-apis.git
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
group: travis_latest
language: python
dist: focal
git:
submodules: false
matrix:
include:
# Historically, we've run tests on the latest supported version of Python first.
Expand All @@ -14,6 +16,7 @@ matrix:
- python: "3.14"

install:
- git submodule update --init --recursive --progress
- travis_retry sudo apt-get -y install python3-pip
- travis_retry pip install --upgrade pip
# tox 4.0 broke plugin compatibility
Expand Down
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ Building **[`nimi-python`](https://github.com/ni/nimi-python)**
---------------------------------------------------------------

1. Fork [the repository](https://github.com/ni/nimi-python) on GitHub and clone it to your local system.
1. Initialize and fetch submodules (also re-run this after `git pull` to keep the submodule up to date):

git submodule update --init --recursive

Optionally, configure git to do this automatically after `git fetch`, `git pull` and `git checkout`:

git config submodule.recurse true

1. On a terminal, navigate to the **[`nimi-python`](https://github.com/ni/nimi-python)** root
directory. Then run

Expand All @@ -71,6 +79,16 @@ Building **[`nimi-python`](https://github.com/ni/nimi-python)**
tox -e clean


Updating submodules
-------------------

To update the submodule (e.g., ni-apis) to the latest version from its remote repository:

git submodule update --remote

This fetches and checks out the latest commit from the submodule's default branch. You'll periodically need to do this to pick up the latest changes.


Running the system tests
------------------------

Expand Down
5 changes: 2 additions & 3 deletions build/defines.mak
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ DRIVER_DIR := $(ROOT_DIR)/src/$(DRIVER)
METADATA_DIR := $(DRIVER_DIR)/metadata
METADATA_FILES := $(wildcard $(METADATA_DIR)/*.py)
SHARED_PROTOS_DIR := $(ROOT_DIR)/src/shared_protos
PROTO_DIRS := $(METADATA_DIR) $(SHARED_PROTOS_DIR)
NI_APIS_PROTOS_DIR := $(ROOT_DIR)/third_party/ni-apis/ni/grpcdevice/v1
Comment thread
ni-jfitzger marked this conversation as resolved.
PROTO_DIRS := $(METADATA_DIR) $(SHARED_PROTOS_DIR) $(NI_APIS_PROTOS_DIR)
PROTO_FILE ?= $(METADATA_DIR)/$(DRIVER).proto

BUILD_HELPER_SCRIPTS := $(wildcard $(BUILD_HELPER_DIR)/*.py $(BUILD_HELPER_DIR)/helper/*.py)
Expand Down Expand Up @@ -67,8 +68,6 @@ DEFAULT_PY_FILES_TO_GENERATE := \
$(basename $(notdir $(PROTO_FILE)))_pb2_grpc.py \
nidevice_pb2.py \
nidevice_pb2_grpc.py \
session_pb2.py \
session_pb2_grpc.py \
) \

DEFAULT_PY_FILES_TO_COPY := \
Expand Down
1 change: 0 additions & 1 deletion build/rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ $(MODULE_DIR)/%: %.mako $(BUILD_HELPER_SCRIPTS) $(METADATA_FILES)
$(MODULE_DIR)/%_pb2.py: %.proto
$(call trace_to_console, "Generating",$@ and $(notdir $*)_pb2_grpc.py)
$(_hide_cmds)$(call log_command,python -m grpc_tools.protoc $(addprefix -I=,$(PROTO_DIRS)) --python_out=$(MODULE_DIR) --grpc_python_out=$(MODULE_DIR) $*.proto)
$(_hide_cmds)$(call log_command,sed -i 's/^import session_pb2/from . import session_pb2/' $(MODULE_DIR)/$*_pb2*.py)
$(_hide_cmds)$(call log_command,sed -i 's/^import nidevice_pb2/from . import nidevice_pb2/' $(MODULE_DIR)/$*_pb2*.py)
$(_hide_cmds)$(call log_command,sed -i 's/^import $(notdir $*)_pb2/from . import $(notdir $*)_pb2/' $(MODULE_DIR)/$*_pb2*.py)

Expand Down
2 changes: 1 addition & 1 deletion build/templates/_grpc_stub_interpreter.py.mako
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ are_complex_parameters_used = helper.are_complex_parameters_used(functions)

import grpc
import hightime # noqa: F401
import session_pb2 as session_grpc_types
import threading
import warnings

Expand All @@ -25,7 +26,6 @@ from . import nidevice_pb2 as grpc_complex_types # noqa: F401
% endif
from . import ${proto_name}_pb2 as grpc_types
from . import ${proto_name}_pb2_grpc as ${module_name}_grpc
from . import session_pb2 as session_grpc_types
% for c in config['custom_types']:

from . import ${c['file_name']} as ${c['file_name']} # noqa: F401
Expand Down
3 changes: 2 additions & 1 deletion build/templates/setup.py.mako
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ setup(
extras_require={
'grpc': [
'grpcio>=1.59.0,<2.0',
'protobuf>=4.21.6'
'protobuf>=4.21.6',
'ni.grpcdevice.v1.proto>=1.0.0'
],
},
% endif
Expand Down
2 changes: 1 addition & 1 deletion generated/nidcpower/nidcpower/_grpc_stub_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import grpc
import hightime # noqa: F401
import session_pb2 as session_grpc_types
import threading
import warnings

from . import enums as enums # noqa: F401
from . import errors as errors
from . import nidcpower_pb2 as grpc_types
from . import nidcpower_pb2_grpc as nidcpower_grpc
from . import session_pb2 as session_grpc_types

from . import lcr_measurement as lcr_measurement # noqa: F401

Expand Down
2 changes: 1 addition & 1 deletion generated/nidcpower/nidcpower/nidcpower_pb2.py

Large diffs are not rendered by default.

52 changes: 0 additions & 52 deletions generated/nidcpower/nidcpower/session_pb2.py

This file was deleted.

204 changes: 0 additions & 204 deletions generated/nidcpower/nidcpower/session_pb2_grpc.py

This file was deleted.

3 changes: 2 additions & 1 deletion generated/nidcpower/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def read_contents(file_to_read):
extras_require={
'grpc': [
'grpcio>=1.59.0,<2.0',
'protobuf>=4.21.6'
'protobuf>=4.21.6',
'ni.grpcdevice.v1.proto>=1.0.0'
],
},
classifiers=[
Expand Down
Loading
Loading