Skip to content

Commit d4f80d3

Browse files
Merge remote-tracking branch 'upstream/master' into users/vagupta/custom_expansion_for_repeated_capability
2 parents 7d116c9 + 9efe042 commit d4f80d3

File tree

17 files changed

+168
-61
lines changed

17 files changed

+168
-61
lines changed

.github/workflows/check_latest_release.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,23 @@ jobs:
2525
- x64
2626
- rdss-nimibot-win-10-py32
2727
timeout-minutes: 30
28-
strategy:
29-
matrix:
30-
module_name:
31-
- nidigital
32-
- nitclk
33-
- nifgen
34-
- nidcpower
35-
- nidmm
36-
- niscope
37-
- nimodinst
38-
- nise
39-
- niswitch
4028
steps:
4129
- name: checkout repository
4230
uses: actions/checkout@v3
31+
32+
- name: Extract module name and version from release tag
33+
id: extract_tag
34+
run: |
35+
# Extract module name and version from the release tag
36+
# Assuming the tag format is <module_name>-<version>, e.g., nidigital-1.4.0
37+
TAG="${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.event.release.tag_name }}"
38+
MODULE_NAME=$(echo "$TAG" | cut -d'-' -f1)
39+
MODULE_VERSION=$(echo "$TAG" | cut -d'-' -f2-)
40+
echo "module_name=$MODULE_NAME" >> "$GITHUB_OUTPUT"
41+
echo "module_version=$MODULE_VERSION" >> "$GITHUB_OUTPUT"
4342
# NOTE: we don't upload test coverage for this
4443
- name: run examples using PyPI uploads
4544
uses: ./.github/actions/run_examples_using_pypi_uploads
4645
with:
47-
module_name: ${{ matrix.module_name }}
48-
module_version: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.event.release.tag_name }}
46+
module_name: ${{ steps.extract_tag.outputs.module_name }}
47+
module_version: ${{ steps.extract_tag.outputs.module_version }}

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [nifgen (NI-FGEN)](#nifgen-ni-fgen)
88
- [nimodinst (NI-ModInst)](#nimodinst-ni-modinst)
99
- [nirfsg (NI-RFSG)](#nirfsg-ni-rfsg)
10+
- [nirfsg (NI-RFSG)](#nirfsg-ni-rfsg)
1011
- [niscope (NI-SCOPE)](#niscope-ni-scope)
1112
- [nise (NI Switch Executive)](#nise-ni-switch-executive)
1213
- [niswitch (NI-SWITCH)](#niswitch-ni-switch)
@@ -1667,7 +1668,7 @@
16671668

16681669
#### [nirfsg] Unreleased
16691670
- Added
1670-
- Added metadata for selected public APIs
1671+
- Enabled selected public APIs
16711672
- Basic example
16721673
- Documentation for APIs (not final)
16731674
- Changed

CONTRIBUTING.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ Release Process
149149
```
150150
1. Ensure no commits are made on ni/nimi-python/master until the release is complete
151151
1. Create and checkout a branch for release-related changes
152+
1. Perform Version Bump (If Needed)
153+
* If you need to upgrade the major or minor versions, include any of the following parameters:
154+
* --increment-major-version - To increment the major version of package. This will update the version to (N+1).X.X.dev0
155+
* --increment-minor-version - To increment the minor version of package. This will update the version to X.(N+1).X.dev0
156+
* Example: `python3 tools/build_release.py --increment-minor-version`
157+
* If you need to update the version for any specific driver(s), include the `drivers` parameter. By default, all drivers will be considered.
158+
For example:
159+
```bash
160+
python3 tools/build_release.py --drivers nidcpower --increment-minor-version
161+
```
162+
* Commit to branch
152163
1. Update [CHANGELOG.md](./CHANGELOG.md)
153164
* For packages that are releasing:
154165
* Delete empty (i.e. No changes) sub-sections under "Unreleased" section
@@ -157,8 +168,13 @@ Release Process
157168
* Change [Unreleased] in TOC to the version of the release
158169
* Commit to branch
159170
1. Update release versions
160-
* `python3 tools/build_release.py --update --release`
171+
* `python3 tools/build_release.py --update-for-release`
161172
* For each module, this will drop the .devN from our versions in config_addon.py and update the LATEST_RELEASE versions to match.
173+
* If you need to release any specific module(s), include the `drivers` parameter.
174+
For example:
175+
```bash
176+
python3 tools/build_release.py --drivers nidcpower --update-for-release
177+
```
162178
* Commit to branch
163179
1. Clean and build to update generated files with new version
164180
* `python3 tools/build_release.py --build`
@@ -170,19 +186,33 @@ Release Process
170186
1. Wait until the pull request has been approved
171187
1. Upload the releases to PyPI
172188
* `python3 tools/build_release.py --upload`
189+
* If you need to upload any specific module(s), include the `drivers` parameter.
190+
For example:
191+
```bash
192+
python3 tools/build_release.py --drivers nidcpower --upload
193+
```
173194
* You will need to type in your PyPI credentials
174195
1. Merge the pull request to origin/master
175-
1. Create a release on GitHub using the portion from the changelog for this release for the description
176-
* Add the ZIP files under `generated/examples` for each module as a release artifact.
196+
1. For each package released, create a release on GitHub using the module's portion from the changelog for this release for the description
197+
* The release tag should be named as follows: `MODULE_NAME-version`.
198+
* Example: `nidcpower-1.5.0`.
199+
* This tag format allows the individual `Read the Docs` projects to determine whether a release applies to them.
200+
* Add the ZIP files under `generated/examples` for each module (not just the releasing one) as a release artifact.
201+
* Internal test code will only look for the latest release tag and expect it to have examples attached for any module
177202
* This should trigger the [check_latest_release](.github/workflows/check_latest_release.yml) workflow. Check the [results](https://github.com/ni/nimi-python/actions/workflows/check_latest_release.yml) before continuing.
178203
1. Post-Release Steps
179204
1. Create and checkout another branch for post-release changes
180-
1. Update the module versions
181-
* `python3 tools/build_release.py --update`
182-
* This will update the version to X.X.(N+1).dev0
205+
1. Update the module version for a patch version upgrade. This will update the version to X.X.(N+1).dev0
206+
* `python3 tools/build_release.py --increment-patch-version`
207+
* If you need to update any specific module(s), include the `drivers` parameter.
208+
For example:
209+
```bash
210+
python3 tools/build_release.py --drivers nidcpower --increment-patch-version
211+
```
183212
* Commit to branch
184213
1. Clean and build to update generated files with new version
185214
* `python3 tools/build_release.py --build`
215+
* Ensure that all changes made as part of build command are specific to intended drivers.
186216
* Commit to branch
187217
1. Update changelog
188218
* Copy Unreleased section from the bottom of the changelog. Modify the package name in the example and TOC. Paste the modified section at the top of intended package's changelog and add a corresponding link to it in the package's TOC.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
This is the MIT license: http://www.opensource.org/licenses/mit-license.php
22

33
Copyright (c) 2017-2022, National Instruments Corporation.
4-
NI-Digital Pattern Driver, NI-DMM, NI-DCPower, NI-FGEN, NI-SCOPE, NI-SWITCH, NI Switch Executive,
4+
NI-Digital Pattern Driver, NI-DMM, NI-DCPower, NI-FGEN, NI-RFSG, NI-SCOPE, NI-SWITCH, NI Switch Executive,
55
NI-ModInst, NI-TClk are trademarks of National Instruments.
66

77
Permission is hereby granted, free of charge, to any person obtaining a copy of this

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ NI-RFSG Python API Status
298298
+-------------------------------+-----------------------+
299299
| NI-RFSG (nirfsg) | |
300300
+===============================+=======================+
301-
| Driver Version Tested Against | 2025 Q1 |
301+
| Driver Version Tested Against | 2025 Q2 |
302302
+-------------------------------+-----------------------+
303303
| PyPI Version | |nirfsgLatestVersion| |
304304
+-------------------------------+-----------------------+

build/templates/examples.rst.mako

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,23 @@
2727
2828
with open(f'./src/{module_name}/LATEST_RELEASE') as vf:
2929
latest_release_version = vf.read().strip()
30-
released_zip_url = 'https://github.com/ni/nimi-python/releases/download/{}/{}_examples.zip'.format(latest_release_version, module_name)
31-
32-
example_url_base = 'https://github.com/ni/nimi-python/blob/'
3330
3431
from packaging.version import Version
3532
v = Version(module_version)
3633
34+
# Check if the module name and version match the old tag formatting criteria
35+
use_old_tag_format = (
36+
module_name in ['nidcpower', 'nidigital', 'nidmm', 'nifake', 'niswitch', 'nimodinst', 'nifgen', 'niscope', 'nise', 'nitclk']
37+
and latest_release_version == '1.4.9'
38+
)
39+
40+
if not use_old_tag_format:
41+
latest_release_version = module_name + '-' + latest_release_version
42+
43+
released_zip_url = 'https://github.com/ni/nimi-python/releases/download/{}/{}_examples.zip'.format(latest_release_version, module_name)
44+
45+
example_url_base = 'https://github.com/ni/nimi-python/blob/'
46+
3747
if v.dev is None and v.pre is None:
3848
examples_zip_url_text = '`You can download all {} examples here <{}>`_'.format(module_name, released_zip_url)
3949
example_url_base += latest_release_version
@@ -54,4 +64,4 @@ ${helper.get_rst_header_snippet(os.path.basename(e), '-')}
5464
:encoding: utf8
5565
:caption: `(${os.path.basename(e)}) <${example_url_base}/${e.replace('\\', '/')}>`_
5666

57-
% endfor
67+
% endfor

build/templates/index.rst.mako

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
doc_header = f"{config['driver_name']} Python API Documentation"
44
module_name = config['module_name']
55
driver_name = config['driver_name']
6+
mi_drivers = ['nidcpower', 'nidigital', 'nidmm', 'nifgen', 'nimodinst', 'niscope', 'niswitch', 'nise', 'nitclk']
7+
read_the_docs_note = (
8+
"Refer to the `nimi-python Read the Docs project <https://nimi-python.readthedocs.io/en/stable/>`_ for documentation of versions 1.4.4 of the module or earlier."
9+
)
610
%>\
711

812
${doc_header}
@@ -25,7 +29,9 @@ Additional Documentation
2529

2630
Refer to your driver documentation for device-specific information and detailed API documentation.
2731

28-
For drivers other than nirfsg, refer to the `nimi-python Read the Docs project <https://nimi-python.readthedocs.io/en/stable/>`_ for documentation of versions 1.4.4 of the module or earlier.
32+
% if module_name in mi_drivers:
33+
${read_the_docs_note}
34+
% endif
2935

3036
.. include:: ../_static/license.inc
3137

docs/nirfsg/about_nirfsg.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ Support Policy
1111

1212
It follows `Python Software Foundation <https://devguide.python.org/#status-of-python-branches>`_ support policy for different versions of CPython.
1313

14+
NI created and supports **nirfsg**.
15+

docs/nirfsg/examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Examples
22
========
33

4-
`You can download all nirfsg examples here <https://github.com/ni/nimi-python/releases/download/0.2.0/nirfsg_examples.zip>`_
4+
`You can download all nirfsg examples here <https://github.com/ni/nimi-python/releases/download/nirfsg-0.2.0/nirfsg_examples.zip>`_
55

66
nirfsg_cw.py
77
------------
@@ -10,5 +10,5 @@ nirfsg_cw.py
1010
:language: python
1111
:linenos:
1212
:encoding: utf8
13-
:caption: `(nirfsg_cw.py) <https://github.com/ni/nimi-python/blob/0.2.0/src/nirfsg/examples/nirfsg_cw.py>`_
13+
:caption: `(nirfsg_cw.py) <https://github.com/ni/nimi-python/blob/nirfsg-0.2.0/src/nirfsg/examples/nirfsg_cw.py>`_
1414

docs/nirfsg/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Additional Documentation
1919

2020
Refer to your driver documentation for device-specific information and detailed API documentation.
2121

22-
For drivers other than nirfsg, refer to the `nimi-python Read the Docs project <https://nimi-python.readthedocs.io/en/stable/>`_ for documentation of versions 1.4.4 of the module or earlier.
2322

2423
.. include:: ../_static/license.inc
2524

0 commit comments

Comments
 (0)