Skip to content

Commit 3b203d9

Browse files
authored
Change pypi package names to use 'MeasurementLink' (#178)
* Rename pypi packages to include MeasurementLink * Update references to packages in examples * Rename directory to include MeasurementLink * Rename generator directory * Update imports to use ni_measurementlink_service instead of ni_measurement_service * Update generator directory in publish_nims script * More usages of ni_measurement_generator * Udpate contributing.md * Update readme and contributing docs * Remove measurement-services-python references after repo rename.
1 parent 3cdf70f commit 3b203d9

109 files changed

Lines changed: 161 additions & 161 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ Search open/closed issues before submitting. Someone may have reported the same
4444
<!--- Include as many relevant details as possible about the environment you experienced the bug in -->
4545

4646
* OS & Device: [e.g. macOS, Windows, Linux] on [Mac, PC]
47-
* `ni-measurement-service` version [e.g. 0.12.3]
47+
* `ni-measurementlink-service` version [e.g. 0.12.3]
4848
* MeasurementLink version [e.g. 23.0.0d123]
4949
* Python version [e.g. 3.9]

.github/workflows/PR.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ jobs:
3434
- name: Lint the Code
3535
run: poetry run ni-python-styleguide lint
3636
- name: MyPy Static Analysis
37-
run: poetry run mypy -p ni_measurement_service --show-error-codes -v
37+
run: poetry run mypy -p ni_measurementlink_service --show-error-codes -v
3838
- name: MyPy Static Analysis on examples
3939
run: poetry run mypy -p examples --show-error-codes -v
40-
- name: MyPy Static Analysis ni_measurement_generator
41-
run: poetry run mypy -p ni_measurement_generator --show-error-codes -v
40+
- name: MyPy Static Analysis ni_measurementlink_generator
41+
run: poetry run mypy -p ni_measurementlink_generator --show-error-codes -v
4242

4343
checks-nimg:
4444
runs-on: ubuntu-latest
4545
defaults: # in theory this sets the working-dir for all steps in this job
4646
run:
47-
working-directory: ./ni_measurement_generator
47+
working-directory: ./ni_measurementlink_generator
4848
env:
4949
PYTHON_VERSION: 3.9
5050
steps:
@@ -57,7 +57,7 @@ jobs:
5757
poetry-version: ${{ env.POETRY_VERSION }}
5858
- name: Check for lock changes (generator)
5959
run: poetry lock --check
60-
working-directory: ./ni_measurement_generator
60+
working-directory: ./ni_measurementlink_generator
6161
- uses: actions/cache@v2
6262
with:
6363
path: ~/.cache/pypoetry/virtualenvs
@@ -91,10 +91,10 @@ jobs:
9191
- name: Install the Package (measurement service).
9292
run: poetry install -vvv
9393
- name: Run tests and Code coverage summary (measurement service).
94-
run: poetry run pytest ./tests -v --cov=ni_measurement_service
94+
run: poetry run pytest ./tests -v --cov=ni_measurementlink_service
9595
- name: Install the Package (generator).
9696
run: poetry install -vvv
97-
working-directory: ./ni_measurement_generator
97+
working-directory: ./ni_measurementlink_generator
9898
- name: Run tests and Code coverage summary (generator).
9999
run: poetry run pytest -v
100-
working-directory: ./ni_measurement_generator
100+
working-directory: ./ni_measurementlink_generator

.github/workflows/Publish_NIMS.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: Setup NIMG
3939
run: poetry install
40-
working-directory: ./ni_measurement_generator
40+
working-directory: ./ni_measurementlink_generator
4141

4242
- name: Lint NIMS, NIMG, and examples
4343
run: poetry run ni-python-styleguide lint
@@ -54,7 +54,7 @@ jobs:
5454
- name: Update NIMG package version based on tag name.
5555
run: |
5656
poetry version ${{ steps.vars.outputs.tag }}
57-
working-directory: ./ni_measurement_generator
57+
working-directory: ./ni_measurementlink_generator
5858

5959
- name: Update API Reference Documents(Generated using Sphinx)
6060
run: |
@@ -89,7 +89,7 @@ jobs:
8989
if: ${{ startsWith(github.event.release.target_commitish, 'main') }}
9090
run: |
9191
poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}
92-
working-directory: ./ni_measurement_generator
92+
working-directory: ./ni_measurementlink_generator
9393

9494
- uses: actions/upload-artifact@v3
9595
with:

CONTRIBUTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Contributions to MeasurementLink Support for Python are welcome from all!
44

55
MeasurementLink Support for Python is managed via [git](https://git-scm.com), with the canonical upstream
6-
repository hosted on [GitHub](https://github.com/ni/measurement-services-python/). The repo contains templates and examples for developing MeasurementLink services in Python.
6+
repository hosted on [GitHub](https://github.com/ni/measurementlink-python/). The repo contains templates and examples for developing MeasurementLink services in Python.
77

88
MeasurementLink Support for Python follows a pull-request model for development. If you wish to
99
contribute, you will need to create a GitHub account, fork this project, push a
@@ -33,7 +33,7 @@ See [GitHub's official documentation](https://help.github.com/articles/using-pul
3333
Clone the repo, this will pull the MeasurementLink Support for Python components and related components.
3434

3535
```cmd
36-
git clone https://github.com/ni/measurement-services-python.git
36+
git clone https://github.com/ni/measurementlink-python.git
3737
```
3838

3939
## Initializing the repo with .venv
@@ -52,7 +52,7 @@ poetry init
5252

5353
# Adding dependencies
5454

55-
Add dependency package for `ni_measurement_service` using [poetry add](https://python-poetry.org/docs/cli/#add) command.
55+
Add dependency package for `ni_measurementlink_service` using [poetry add](https://python-poetry.org/docs/cli/#add) command.
5656

5757
```cmd
5858
poetry add <name_of_dependency>:<version>
@@ -66,7 +66,7 @@ poetry add -D <name_of_dev_dependency>:<version>
6666

6767
# Updating gRPC stubs when a .proto file is modified
6868

69-
The `ni_measurement_service\_internal\stubs` directory contains the auto-generated python files based on MeasurementLink protobuf (.proto) files. The file needs to be replaced whenever there is a change to these .proto files:
69+
The `ni_measurementlink_service\_internal\stubs` directory contains the auto-generated python files based on MeasurementLink protobuf (.proto) files. The file needs to be replaced whenever there is a change to these .proto files:
7070

7171
- ni/measurementlink/pin_map_context.proto
7272
- ni/measurementlink/discovery/v1/discovery_service.proto
@@ -76,7 +76,7 @@ The `ni_measurement_service\_internal\stubs` directory contains the auto-generat
7676
- nidevice_grpc/README.md
7777
- nidevice_grpc/session.proto
7878

79-
The latest .proto files are available in [Azure Repo](https://dev.azure.com/ni/DevCentral/_git/ASW?path=/Source/Protos). From the Azure Repo manually download and overwrite the proto files under the `ni_measurement_service\_internal\stubs\proto` folder.
79+
The latest .proto files are available in [Azure Repo](https://dev.azure.com/ni/DevCentral/_git/ASW?path=/Source/Protos). From the Azure Repo manually download and overwrite the proto files under the `ni_measurementlink_service\_internal\stubs\proto` folder.
8080

8181
Run `poetry run python scripts/generate_grpc_stubs.py`. This generates the required *.py file for the listed proto files. The required `grpcio-tools` package is already added as a development dependency in pyproject.toml.
8282

@@ -96,21 +96,21 @@ poetry run ni-python-styleguide fix
9696
poetry build
9797
```
9898

99-
Running this command from the repo's root directory will generate the tar.gz file and .whl file of ni_measurement_service package to the `dist` directory.
99+
Running this command from the repo's root directory will generate the tar.gz file and .whl file of ni_measurementlink_service package to the `dist` directory.
100100

101101
# Testing
102102

103-
`ni-measurement-service` includes tests under the directory `tests\` that exercises the python and grpc modules. The GitHub CI run these tests for PRs targeting the main branch. It is recommended that during development you run the tests locally before creating a PR.
103+
`ni-measurementlink-service` includes tests under the directory `tests\` that exercises the python and grpc modules. The GitHub CI run these tests for PRs targeting the main branch. It is recommended that during development you run the tests locally before creating a PR.
104104

105-
In order to run the `ni-measurement-service` tests locally:
105+
In order to run the `ni-measurementlink-service` tests locally:
106106

107107
## Using Command Line
108108

109109
1. Install production dependencies and development dependencies into a venv by running `poetry install`.
110110
2. Execute the command `poetry run pytest -v` to run the tests, from the repo's root directory.
111111

112112
``` ps
113-
(.venv) PS D:\TAF\measurement-services-python> poetry run pytest -v
113+
(.venv) PS D:\TAF\measurementlink-python> poetry run pytest -v
114114
```
115115
116116
## Using VS code Test Explorer extension(UI)
@@ -121,8 +121,8 @@ Install and configure the `Python Test Explorer for Visual Studio Code` extensio
121121
122122
- Install the required dependency by running `poetry install`
123123
- Activate the virtual environment if not already activated : `.venv\Scripts\activate`
124-
- Run the command `pytest --cov=ni_measurement_service`, from the repo's root directory **to get the summary of test coverage** in the console.
125-
- Run the command `pytest --cov-report html:cov_html --cov=ni_measurement_service`, from the repo's root directory **to generate detailed HTML based coverage report**. Upon running, the coverage reports will be created under `<repo_root>\cov_html` directory.
124+
- Run the command `pytest --cov=ni_measurementlink_service`, from the repo's root directory **to get the summary of test coverage** in the console.
125+
- Run the command `pytest --cov-report html:cov_html --cov=ni_measurementlink_service`, from the repo's root directory **to generate detailed HTML based coverage report**. Upon running, the coverage reports will be created under `<repo_root>\cov_html` directory.
126126
127127
# Developer Certificate of Origin (DCO)
128128
@@ -154,5 +154,5 @@ Install and configure the `Python Test Explorer for Visual Studio Code` extensio
154154
155155
(taken from [developercertificate.org](https://developercertificate.org/))
156156
157-
See [LICENSE](https://github.com/ni/measurement-services-python/blob/master/LICENSE)
157+
See [LICENSE](https://github.com/ni/measurementlink-python/blob/master/LICENSE)
158158
for details about how MeasurementLink Support for Python is licensed.

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
- [Appendix: Managing Measurement as Python Package(Project)](#appendix-managing-measurement-as-python-packageproject)
1919
- [Create and Manage Python Measurement Package using poetry](#create-and-manage-python-measurement-package-using-poetry)
2020
- [Create and Manage Python Measurement Package using venv](#create-and-manage-python-measurement-package-using-venv)
21-
- [Create and Manage Python Measurement Package by directly installing `ni-measurement-service` as a system-level package](#create-and-manage-python-measurement-package-by-directly-installing-ni-measurement-service-as-a-system-level-package)
21+
- [Create and Manage Python Measurement Package by directly installing `ni-measurementlink-service` as a system-level package](#create-and-manage-python-measurement-package-by-directly-installing-ni-measurementlink-service-as-a-system-level-package)
2222

2323
---
2424

2525
## Introduction
2626

27-
MeasurementLink Support for Python (`ni-measurement-service`) is a python framework that enables measurement developers to quickly create python measurements and run them as a service (gRPC).
27+
MeasurementLink Support for Python (`ni-measurementlink-service`) is a python framework that enables measurement developers to quickly create python measurements and run them as a service (gRPC).
2828

2929
---
3030

@@ -60,10 +60,10 @@ The example measurements shared are *poetry-based* projects. Follow the below st
6060

6161
``` cmd
6262
cd <path_of_example_measurement>
63-
REM Example: cd "..\measurement-services-python\examples\dc_measurement"
63+
REM Example: cd "..\measurementlink-python\examples\dc_measurement"
6464
```
6565
66-
3. Run `poetry install`. This command creates/updates the .venv and installs all the dependencies(including `ni-measurement-service` package) needed for the Example into `.venv`
66+
3. Run `poetry install`. This command creates/updates the .venv and installs all the dependencies(including `ni-measurementlink-service` package) needed for the Example into `.venv`
6767
6868
``` cmd
6969
poetry install
@@ -92,41 +92,41 @@ Make sure the system has the recommended python version is installed. Install Me
9292
9393
``` cmd
9494
REM Activate the required virtual environment if any.
95-
pip install ni-measurement-service
95+
pip install ni-measurementlink-service
9696
```
9797

9898
Check if you have installed the expected version of MeasurementLink Support for Python installed by running the below command:
9999

100100
```cmd
101-
pip show ni-measurement-service
101+
pip show ni-measurementlink-service
102102
```
103103

104104
### Developing a minimal python measurement
105105

106-
1. Install the `ni-measurement-generator` package.
106+
1. Install the `ni-measurementlink-generator` package.
107107

108108
``` cmd
109109
REM Activate the required virtual environment if any.
110-
pip install ni-measurement-generator
110+
pip install ni-measurementlink-generator
111111
```
112112

113-
2. Run the `ni-measurement-generator` tool. Use command line arguments to specify the `display-name` and optionally the `version`, `measurement-type`, and `product-type`.
113+
2. Run the `ni-measurementlink-generator` tool. Use command line arguments to specify the `display-name` and optionally the `version`, `measurement-type`, and `product-type`.
114114

115-
1. Running `ni-measurement-generator` without optional arguments:
115+
1. Running `ni-measurementlink-generator` without optional arguments:
116116

117-
`ni-measurement-generator SampleMeasurement`
117+
`ni-measurementlink-generator SampleMeasurement`
118118

119119
'SampleMeasurement' is the display name of your measurement service. Without the optional arguments,
120120
the other arguments are generated for you based on the display name.
121121

122-
2. Running `ni-measurement-generator` with optional arguments for `measurement-version`, `ui-file`,
122+
2. Running `ni-measurementlink-generator` with optional arguments for `measurement-version`, `ui-file`,
123123
`service-class`, and `description-url`:
124124

125-
`ni-measurement-generator SampleMeasurement --measurement-version 0.1.0.0 --ui-file MeasurementUI.measui --service-class SampleMeasurement_Python --description-url https://www.example.com/SampleMeasurement.html`
125+
`ni-measurementlink-generator SampleMeasurement --measurement-version 0.1.0.0 --ui-file MeasurementUI.measui --service-class SampleMeasurement_Python --description-url https://www.example.com/SampleMeasurement.html`
126126

127-
3. Running `ni-measurement-generator` with optional argument for `directory-out`
127+
3. Running `ni-measurementlink-generator` with optional argument for `directory-out`
128128

129-
`ni-measurement-generator SampleMeasurement --directory-out <new_path_for_created_files>`
129+
`ni-measurementlink-generator SampleMeasurement --directory-out <new_path_for_created_files>`
130130

131131
If no output directory is specified, the files will
132132
be placed in a new folder under the current directory
@@ -238,7 +238,7 @@ pyinstaller --onefile --console --add-data "<path_of_the_UI_File>;." --paths .ve
238238

239239
## API References
240240

241-
[Click here](https://ni.github.io/measurement-services-python/) to view the API reference documentation.
241+
[Click here](https://ni.github.io/measurementlink-python/) to view the API reference documentation.
242242

243243
## Appendix: Managing Measurement as Python Package(Project)
244244

@@ -265,7 +265,7 @@ Note: Once we have the template support for Python measurement, the approach to
265265

266266
2. Install the `poetry` using the installation steps given in <https://python-poetry.org/docs/#installation>.
267267

268-
2. Create a new python project and add `ni-measurement-service` as a dependency to the project.
268+
2. Create a new python project and add `ni-measurementlink-service` as a dependency to the project.
269269

270270
1. Open a command prompt, and change the working directory to the directory of your choice where you want to create the project.
271271

@@ -279,11 +279,11 @@ Note: Once we have the template support for Python measurement, the approach to
279279
poetry new <name_of_the_project>
280280
```
281281

282-
3. Add the `ni-measurement-service` package as a dependency using the [poetry add command](https://python-poetry.org/docs/cli/#add).
282+
3. Add the `ni-measurementlink-service` package as a dependency using the [poetry add command](https://python-poetry.org/docs/cli/#add).
283283

284284
``` cmd
285285
cd <name_of_the_project>
286-
poetry add ni-measurement-service
286+
poetry add ni-measurementlink-service
287287
```
288288

289289
4. The virtual environment will be auto-created by poetry.
@@ -322,10 +322,10 @@ For detailed info on managing projects using poetry [refer to the official docum
322322
python -m pip install -U pip
323323
```
324324

325-
5. Install the `ni-measurement-service` package into the virtual environment.
325+
5. Install the `ni-measurementlink-service` package into the virtual environment.
326326

327327
``` cmd
328-
pip install ni-measurement-service
328+
pip install ni-measurementlink-service
329329
```
330330

331331
6. Create measurement modules as described in ["Developing a minimal python measurement"](#developing-a-minimal-python-measurement)
@@ -337,14 +337,14 @@ For detailed info on managing projects using poetry [refer to the official docum
337337

338338
For detailed info on managing projects with a virtual environment [refer to the official documentation](https://docs.python.org/3/tutorial/venv.html).
339339

340-
### Create and Manage Python Measurement Package by directly installing `ni-measurement-service` as a system-level package
340+
### Create and Manage Python Measurement Package by directly installing `ni-measurementlink-service` as a system-level package
341341

342-
Measurement developers can also install `ni-measurement-service` as a system package if necessary.
342+
Measurement developers can also install `ni-measurementlink-service` as a system package if necessary.
343343

344-
1. Install the `ni-measurement-service` package from the command prompt
344+
1. Install the `ni-measurementlink-service` package from the command prompt
345345

346346
``` cmd
347-
pip install ni-measurement-service
347+
pip install ni-measurementlink-service
348348
```
349349

350350
2. Create measurement modules as described in ["Developing a minimal python measurement"](#developing-a-minimal-python-measurement)

_docs_source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# tell autoapi to doc the public options
4545
autoapi_options = list(autoapi.extension._DEFAULT_OPTIONS)
4646
autoapi_options.remove("private-members") # note: remove this to include "_" members in docs
47-
autoapi_dirs = [root_path / "ni_measurement_service"]
47+
autoapi_dirs = [root_path / "ni_measurementlink_service"]
4848
autoapi_type = "python"
4949
autodoc_typehints = "none"
5050

examples/nidaqmx_analog_input/measurement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import click
88
import nidaqmx
99

10-
import ni_measurement_service as nims
10+
import ni_measurementlink_service as nims
1111

1212
measurement_info = nims.MeasurementInfo(
1313
display_name="NI-DAQmx Analog Input (Py)",

examples/nidaqmx_analog_input/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = ["National Instruments"]
77
[tool.poetry.dependencies]
88
python = "^3.8"
99
nidaqmx = ">=0.6.3"
10-
ni-measurement-service = "*"
10+
ni-measurementlink-service = "*"
1111
click = ">=7.1.2"
1212

1313
[tool.poetry.dev-dependencies]

examples/nidcpower_source_dc_voltage/_helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
import grpc
88

9-
from ni_measurement_service import session_management
10-
from ni_measurement_service._internal.discovery_client import DiscoveryClient
11-
from ni_measurement_service._internal.stubs.ni.measurementlink.pinmap.v1 import (
9+
from ni_measurementlink_service import session_management
10+
from ni_measurementlink_service._internal.discovery_client import DiscoveryClient
11+
from ni_measurementlink_service._internal.stubs.ni.measurementlink.pinmap.v1 import (
1212
pin_map_service_pb2,
1313
pin_map_service_pb2_grpc,
1414
)
15-
from ni_measurement_service.measurement.service import GrpcChannelPool
15+
from ni_measurementlink_service.measurement.service import GrpcChannelPool
1616

1717

1818
class ServiceOptions(NamedTuple):

examples/nidcpower_source_dc_voltage/measurement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import nidcpower
1414
from _helpers import ServiceOptions
1515

16-
import ni_measurement_service as nims
16+
import ni_measurementlink_service as nims
1717

1818

1919
NIDCPOWER_WAIT_FOR_EVENT_TIMEOUT_ERROR_CODE = -1074116059

0 commit comments

Comments
 (0)