Skip to content

Commit 3276ab2

Browse files
Merge branch 'ni:master' into users/vagupta/adding_rfsg_apis
2 parents f31bdb1 + 8b52559 commit 3276ab2

File tree

27 files changed

+193
-60
lines changed

27 files changed

+193
-60
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 }}

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.

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Overall Status
88
+----------------------+------------------------------------------------------------------------------------------------------------------------------------+
99

1010
=========== ============================================================================================================================
11-
Info Python bindings for NI Modular Instrument drivers. See `GitHub <https://github.com/ni/nimi-python/>`_ for the latest source.
11+
Info NI Modular Instrument driver APIs for Python.
1212
Author NI
1313
=========== ============================================================================================================================
1414

@@ -59,6 +59,8 @@ called through its public C API using the `ctypes <https://docs.python.org/2/lib
5959

6060
**nimi-python** follows `Python Software Foundation <https://devguide.python.org/#status-of-python-branches>`_ support policy for different versions.
6161

62+
NI created and supports **nimi-python**.
63+
6264

6365
NI-DCPower Python API Status
6466
----------------------------

build/templates/about_driver.inc.mako

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

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

21+
NI created and supports **${module_name}**.
22+

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

docs/_static/about.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ called through its public C API using the `ctypes <https://docs.python.org/2/lib
2424

2525
**nimi-python** follows `Python Software Foundation <https://devguide.python.org/#status-of-python-branches>`_ support policy for different versions.
2626

27+
NI created and supports **nimi-python**.
28+

docs/_static/status_project.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Overall Status
88
+----------------------+------------------------------------------------------------------------------------------------------------------------------------+
99

1010
=========== ============================================================================================================================
11-
Info Python bindings for NI Modular Instrument drivers. See `GitHub <https://github.com/ni/nimi-python/>`_ for the latest source.
11+
Info NI Modular Instrument driver APIs for Python.
1212
Author NI
1313
=========== ============================================================================================================================
1414

docs/nidcpower/about_nidcpower.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 **nidcpower**.
15+

docs/nidigital/about_nidigital.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 **nidigital**.
15+

docs/nidmm/about_nidmm.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 **nidmm**.
15+

0 commit comments

Comments
 (0)