From 8bb9b1a0e8e78712c3d63318c43dfbd46896e3a7 Mon Sep 17 00:00:00 2001 From: Joel Dixon <38357562+dixonjoel@users.noreply.github.com> Date: Fri, 12 Jan 2024 11:11:49 -0600 Subject: [PATCH 1/5] Check if NIMS and NIMG versions are different before committing (#585) * Don't commit version changes if empty * Add conditional for pushing commit to branch * Use GITHUB_OUTPUT for check * Move brackets outside whole expression * Add a fi statement. Use a boolean variable --- .github/workflows/Publish_NIMS.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Publish_NIMS.yml b/.github/workflows/Publish_NIMS.yml index b7764154f..4e724d6a5 100644 --- a/.github/workflows/Publish_NIMS.yml +++ b/.github/workflows/Publish_NIMS.yml @@ -54,15 +54,20 @@ jobs: working-directory: ./ni_measurementlink_generator - name: Commit file changes + id: commit if: ${{ startsWith(github.event.release.target_commitish, 'main') || startsWith(github.event.release.target_commitish, 'releases/') }} run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "Promote NIMS package version and update Sphinx generated files in _docs" -a + echo "version_changed=false" >> $GITHUB_OUTPUT + if [ -n "$(git status --porcelain)" ]; then + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Promote NIMS and NIMG package version" -a + echo "version_changed=true" >> $GITHUB_OUTPUT + fi - name: Push changes to the appropriate branch - if: ${{ startsWith(github.event.release.target_commitish, 'main') || startsWith(github.event.release.target_commitish, 'releases/') }} + if: ${{ steps.commit.outputs.version_changed && (startsWith(github.event.release.target_commitish, 'main') || startsWith(github.event.release.target_commitish, 'releases/')) }} uses: CasperWA/push-protected@v2 with: token: ${{ secrets.ADMIN_PAT }} From ae553621422ccb9146ba06724aa546b0a8bd41e8 Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Fri, 12 Jan 2024 11:53:55 -0600 Subject: [PATCH 2/5] Change examples in main to use 1.3.0 released packages --- examples/game_of_life/pyproject.toml | 2 +- examples/nidaqmx_analog_input/pyproject.toml | 2 +- examples/nidcpower_source_dc_voltage/pyproject.toml | 2 +- examples/nidigital_spi/pyproject.toml | 2 +- examples/nidmm_measurement/pyproject.toml | 2 +- examples/nifgen_standard_function/pyproject.toml | 2 +- examples/niscope_acquire_waveform/pyproject.toml | 2 +- examples/niswitch_control_relays/pyproject.toml | 2 +- examples/nivisa_dmm_measurement/pyproject.toml | 2 +- examples/output_voltage_measurement/pyproject.toml | 2 +- examples/sample_measurement/pyproject.toml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/game_of_life/pyproject.toml b/examples/game_of_life/pyproject.toml index 951da67cf..b3d9d697b 100644 --- a/examples/game_of_life/pyproject.toml +++ b/examples/game_of_life/pyproject.toml @@ -6,7 +6,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" -ni-measurementlink-service = {version = "^1.3.0-dev0", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0"} click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 [tool.poetry.group.dev.dependencies] diff --git a/examples/nidaqmx_analog_input/pyproject.toml b/examples/nidaqmx_analog_input/pyproject.toml index f436bd459..1aa3b957d 100644 --- a/examples/nidaqmx_analog_input/pyproject.toml +++ b/examples/nidaqmx_analog_input/pyproject.toml @@ -7,7 +7,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" nidaqmx = { version = ">=0.8.0", extras = ["grpc"] } -ni-measurementlink-service = {version = "^1.3.0-dev2", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0"} click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 [tool.poetry.group.dev.dependencies] diff --git a/examples/nidcpower_source_dc_voltage/pyproject.toml b/examples/nidcpower_source_dc_voltage/pyproject.toml index 2da7b4f4f..93eda5eec 100644 --- a/examples/nidcpower_source_dc_voltage/pyproject.toml +++ b/examples/nidcpower_source_dc_voltage/pyproject.toml @@ -7,7 +7,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" nidcpower = { version = ">=1.4.4", extras = ["grpc"] } -ni-measurementlink-service = {version = "^1.3.0-dev2", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0"} click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 grpcio = "*" diff --git a/examples/nidigital_spi/pyproject.toml b/examples/nidigital_spi/pyproject.toml index 8b3757c30..514e890b5 100644 --- a/examples/nidigital_spi/pyproject.toml +++ b/examples/nidigital_spi/pyproject.toml @@ -7,7 +7,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" nidigital = ">=1.4.4" -ni-measurementlink-service = {version = "^1.3.0-dev2", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0"} click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 grpcio = "*" diff --git a/examples/nidmm_measurement/pyproject.toml b/examples/nidmm_measurement/pyproject.toml index d2cd663a0..cc6386b87 100644 --- a/examples/nidmm_measurement/pyproject.toml +++ b/examples/nidmm_measurement/pyproject.toml @@ -7,7 +7,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" nidmm = { version = ">=1.4.4", extras = ["grpc"] } -ni-measurementlink-service = {version = "^1.3.0-dev2", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0"} click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 grpcio = "*" diff --git a/examples/nifgen_standard_function/pyproject.toml b/examples/nifgen_standard_function/pyproject.toml index e0a247468..40175180d 100644 --- a/examples/nifgen_standard_function/pyproject.toml +++ b/examples/nifgen_standard_function/pyproject.toml @@ -7,7 +7,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" nifgen = { version = ">=1.4.4", extras = ["grpc"] } -ni-measurementlink-service = {version = "^1.3.0-dev2", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0"} click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 grpcio = "*" diff --git a/examples/niscope_acquire_waveform/pyproject.toml b/examples/niscope_acquire_waveform/pyproject.toml index b5ea232b9..f28c5ebd2 100644 --- a/examples/niscope_acquire_waveform/pyproject.toml +++ b/examples/niscope_acquire_waveform/pyproject.toml @@ -7,7 +7,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" niscope = { version = ">=1.4.4", extras = ["grpc"] } -ni-measurementlink-service = {version = "^1.3.0-dev2", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0"} click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 grpcio = "*" diff --git a/examples/niswitch_control_relays/pyproject.toml b/examples/niswitch_control_relays/pyproject.toml index 24fe87dd9..bd0f8be8a 100644 --- a/examples/niswitch_control_relays/pyproject.toml +++ b/examples/niswitch_control_relays/pyproject.toml @@ -7,7 +7,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" niswitch = { version = ">=1.4.4", extras = ["grpc"] } -ni-measurementlink-service = {version = "^1.3.0-dev2", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0"} click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 grpcio = "*" diff --git a/examples/nivisa_dmm_measurement/pyproject.toml b/examples/nivisa_dmm_measurement/pyproject.toml index 7aa757023..483abdd4c 100644 --- a/examples/nivisa_dmm_measurement/pyproject.toml +++ b/examples/nivisa_dmm_measurement/pyproject.toml @@ -6,7 +6,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" -ni-measurementlink-service = {version = "^1.3.0-dev2", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0} PyVISA = "^1.13.0" PyVISA-sim = "^0.5.1" click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 diff --git a/examples/output_voltage_measurement/pyproject.toml b/examples/output_voltage_measurement/pyproject.toml index e23d532a5..0e6b671a2 100644 --- a/examples/output_voltage_measurement/pyproject.toml +++ b/examples/output_voltage_measurement/pyproject.toml @@ -6,7 +6,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" -ni-measurementlink-service = {version = "^1.3.0-dev2", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0} PyVISA = "^1.13.0" PyVISA-sim = "^0.5.1" nidcpower = { version = ">=1.4.4", extras = ["grpc"] } diff --git a/examples/sample_measurement/pyproject.toml b/examples/sample_measurement/pyproject.toml index 926df2364..c4ad89f60 100644 --- a/examples/sample_measurement/pyproject.toml +++ b/examples/sample_measurement/pyproject.toml @@ -6,7 +6,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" -ni-measurementlink-service = {version = "^1.3.0-dev0", allow-prereleases = true} +ni-measurementlink-service = {version = "^1.3.0"} click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 [tool.poetry.group.dev.dependencies] From 470672f827fff3dd8b6825365feb21abc50e17e3 Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Fri, 12 Jan 2024 12:08:00 -0600 Subject: [PATCH 3/5] Fix .toml file --- examples/nivisa_dmm_measurement/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nivisa_dmm_measurement/pyproject.toml b/examples/nivisa_dmm_measurement/pyproject.toml index 483abdd4c..8a96dc5a6 100644 --- a/examples/nivisa_dmm_measurement/pyproject.toml +++ b/examples/nivisa_dmm_measurement/pyproject.toml @@ -6,7 +6,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" -ni-measurementlink-service = {version = "^1.3.0} +ni-measurementlink-service = {version = "^1.3.0"} PyVISA = "^1.13.0" PyVISA-sim = "^0.5.1" click = ">=7.1.2, !=8.1.4" # mypy fails with click 8.1.4: https://github.com/pallets/click/issues/2558 From 7b01f37ad621daa1c3c9bd1ae422e16d3e263924 Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Fri, 12 Jan 2024 12:24:53 -0600 Subject: [PATCH 4/5] Only update the top level and examples readme --- README.md | 3 ++- examples/README.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa195d870..942b485d5 100644 --- a/README.md +++ b/README.md @@ -62,13 +62,14 @@ There are three ways to do this: ## Examples -The `examples` directory contains example measurements for MeasurementLink 2024 Q1 or later. If +The `examples` directory contains example measurements for MeasurementLink 2024 Q2 or later. If you are using a previous version of MeasurementLink, download the appropriate examples: - MeasurementLink 2023 Q1: [measurementlink-python-examples-1.0.1.zip](https://github.com/ni/measurementlink-python/releases/download/1.0.1/measurementlink-python-examples-1.0.1.zip) - MeasurementLink 2023 Q2: [measurementlink-python-examples-1.0.1.zip](https://github.com/ni/measurementlink-python/releases/download/1.0.1/measurementlink-python-examples-1.0.1.zip) - MeasurementLink 2023 Q3: [measurementlink-python-examples-1.1.0.zip](https://github.com/ni/measurementlink-python/releases/download/1.1.0/measurementlink-python-examples-1.1.0.zip) - MeasurementLink 2023 Q4: [measurementlink-python-examples-1.2.0.zip](https://github.com/ni/measurementlink-python/releases/download/1.2.0/measurementlink-python-examples-1.2.0.zip) +- MeasurementLink 2024 Q1: [measurementlink-python-examples-1.3.0.zip](https://github.com/ni/measurementlink-python/releases/download/1.3.0/measurementlink-python-examples-1.3.0.zip) For more information on setting up and running the example measurements, see the included `README.md` file. diff --git a/examples/README.md b/examples/README.md index dfdfa7126..00986279b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,7 +1,7 @@ ## Example Measurements -These are example measurements for MeasurementLink 2024 Q1 or later. +These are example measurements for MeasurementLink 2024 Q2 or later. If you are using a previous version of MeasurementLink, download the appropriate examples: @@ -9,6 +9,7 @@ If you are using a previous version of MeasurementLink, download the appropriate - MeasurementLink 2023 Q2: [measurementlink-python-examples-1.0.1.zip](https://github.com/ni/measurementlink-python/releases/download/1.0.1/measurementlink-python-examples-1.0.1.zip) - MeasurementLink 2023 Q3: [measurementlink-python-examples-1.1.0.zip](https://github.com/ni/measurementlink-python/releases/download/1.1.0/measurementlink-python-examples-1.1.0.zip) - MeasurementLink 2023 Q4: [measurementlink-python-examples-1.2.0.zip](https://github.com/ni/measurementlink-python/releases/download/1.2.0/measurementlink-python-examples-1.2.0.zip) +- MeasurementLink 2024 Q1: [measurementlink-python-examples-1.3.0.zip](https://github.com/ni/measurementlink-python/releases/download/1.3.0/measurementlink-python-examples-1.3.0.zip) For best results, use the example measurements corresponding to the version of MeasurementLink that you are using. Newer examples may demonstrate features that are not available in older From 56767b76d4d73f26ee9f7e7f61cacb4ed00d381e Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Fri, 12 Jan 2024 12:33:15 -0600 Subject: [PATCH 5/5] Fix output voltage .toml --- examples/output_voltage_measurement/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/output_voltage_measurement/pyproject.toml b/examples/output_voltage_measurement/pyproject.toml index 0e6b671a2..de083f33d 100644 --- a/examples/output_voltage_measurement/pyproject.toml +++ b/examples/output_voltage_measurement/pyproject.toml @@ -6,7 +6,7 @@ authors = ["National Instruments"] [tool.poetry.dependencies] python = "^3.8" -ni-measurementlink-service = {version = "^1.3.0} +ni-measurementlink-service = {version = "^1.3.0"} PyVISA = "^1.13.0" PyVISA-sim = "^0.5.1" nidcpower = { version = ">=1.4.4", extras = ["grpc"] }