diff --git a/CHANGELOG.md b/CHANGELOG.md index b74473d79..ee543e071 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ All notable changes to this project will be documented in this file. * Adopt ni-python-styleguide for hand-written code. * Upgrade to Poetry 2.x and migrate `pyproject.toml` format. * Add support for Python 3.14. + * Add https://github.com/ni/ni-apis as a submodule of nidaqmx-python. * ### Known Issues * ... diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26f886b99..0a5e25dfd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,14 +17,15 @@ more details. To contribute to this project, it is recommended that you follow these steps: 1. Ensure you have [poetry](https://python-poetry.org/) [installed](https://python-poetry.org/docs/#installation) -2. Fork the repository on GitHub. -3. Install **nidaqmx** dependencies using ``poetry install`` +2. Clone the repository using `git clone https://github.com/ni/nidaqmx-python.git` +3. Get the submodules using `git submodule update --init --recursive` +3. Install **nidaqmx** dependencies using `poetry install --all-extras` 4. Run the regression tests on your system (see Testing section). At this point, if any tests fail, do not begin development. Try to investigate these failures. If you're unable to do so, report an issue through our [GitHub issues page](http://github.com/ni/nidaqmx-python/issues). 5. Write new tests that demonstrate your bug or feature. Ensure that these new tests fail. 6. Make your change. -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. +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. > **Note** > The codegen scripts require Python 3.9 or later. 8. Run all the regression tests again (including the tests you just added), and confirm that they all diff --git a/src/codegen/stub_generator.py b/src/codegen/stub_generator.py index b6b3e3b5d..6d6e47a59 100644 --- a/src/codegen/stub_generator.py +++ b/src/codegen/stub_generator.py @@ -84,6 +84,8 @@ def add_init_files(stubs_path: pathlib.Path, proto_path: pathlib.Path): """Add __init__.py files to generated file directories.""" for dir in stubs_path.rglob(""): if not is_relative_to(dir, proto_path) and dir.is_dir(): - init_path = dir / "__init__.py" - print(f"Creating {init_path}") - init_path.write_bytes(b'"""Auto generated gRPC files."""\n') + python_files = list(dir.glob("*.py")) + if python_files: + init_path = dir / "__init__.py" + print(f"Creating {init_path}") + init_path.write_bytes(b'"""Auto generated gRPC files."""\n')