Skip to content

Commit ed59b48

Browse files
mikeprosserniMike Prosser
andauthored
Update CONTRIBUTING.md and CHANGELOG.md to account for the new submodule (#865)
* update documentation to account for the new submodule * update changelog * cleanup * Remove auto-generated __init__.py files and update stub generator to create them only if the directory contains Python files. --------- Co-authored-by: Mike Prosser <[email protected]>
1 parent eab34d2 commit ed59b48

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ All notable changes to this project will be documented in this file.
4949
* Adopt ni-python-styleguide for hand-written code.
5050
* Upgrade to Poetry 2.x and migrate `pyproject.toml` format.
5151
* Add support for Python 3.14.
52+
* Add https://github.com/ni/ni-apis as a submodule of nidaqmx-python.
5253

5354
* ### Known Issues
5455
* ...

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ more details.
1717
To contribute to this project, it is recommended that you follow these steps:
1818

1919
1. Ensure you have [poetry](https://python-poetry.org/) [installed](https://python-poetry.org/docs/#installation)
20-
2. Fork the repository on GitHub.
21-
3. Install **nidaqmx** dependencies using ``poetry install``
20+
2. Clone the repository using `git clone https://github.com/ni/nidaqmx-python.git`
21+
3. Get the submodules using `git submodule update --init --recursive`
22+
3. Install **nidaqmx** dependencies using `poetry install --all-extras`
2223
4. Run the regression tests on your system (see Testing section). At this point, if any tests fail, do not
2324
begin development. Try to investigate these failures. If you're unable to do so, report an issue
2425
through our [GitHub issues page](http://github.com/ni/nidaqmx-python/issues).
2526
5. Write new tests that demonstrate your bug or feature. Ensure that these new tests fail.
2627
6. Make your change.
27-
7. Once the necessary changes are done, update the auto-generated code using ``poetry run python src/codegen --dest generated/nidaqmx``. This will ensure that the latest files are present in the ``generated`` folder.
28+
7. Once the necessary changes are done, update the auto-generated code using `poetry run python src/codegen --dest generated/nidaqmx`. This will ensure that the latest files are present in the ``generated`` folder.
2829
> **Note**
2930
> The codegen scripts require Python 3.9 or later.
3031
8. Run all the regression tests again (including the tests you just added), and confirm that they all

src/codegen/stub_generator.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def add_init_files(stubs_path: pathlib.Path, proto_path: pathlib.Path):
8484
"""Add __init__.py files to generated file directories."""
8585
for dir in stubs_path.rglob(""):
8686
if not is_relative_to(dir, proto_path) and dir.is_dir():
87-
init_path = dir / "__init__.py"
88-
print(f"Creating {init_path}")
89-
init_path.write_bytes(b'"""Auto generated gRPC files."""\n')
87+
python_files = list(dir.glob("*.py"))
88+
if python_files:
89+
init_path = dir / "__init__.py"
90+
print(f"Creating {init_path}")
91+
init_path.write_bytes(b'"""Auto generated gRPC files."""\n')

0 commit comments

Comments
 (0)