Skip to content

Johnfreeman/issue66 standardization v2#71

Merged
jcfreeman2 merged 8 commits intodevelopfrom
johnfreeman/issue66_standardization_v2
Nov 3, 2025
Merged

Johnfreeman/issue66 standardization v2#71
jcfreeman2 merged 8 commits intodevelopfrom
johnfreeman/issue66_standardization_v2

Conversation

@jcfreeman2
Copy link
Contributor

Description

Addresses issue #66

This PR addresses standardizes the structure of this package as a pip install-able Python package (DUNE-DAQ/daq-deliverables#191) as well as ensures that any standard tooling which wasn't yet in place has been added (DUNE-DAQ/daq-deliverables#192).

Compared to other Python package standardizations, this was a bit more complex than usual since druncschema serves as both a pip install-able Python package AND a dbt-buildable C++ package (CMakeLists.txt, dummy.cpp). I'll break down the major changes here.

  • Python code moved out of python_not_for_dunedaq/druncschema and into src/druncschema
  • Standardizations have been applied to pyproject.toml - e.g., versions of dependencies have been removed as they're centralized in daq-release; furthermore the version of the package itself is now defined in pyproject.toml rather than being put in an __init__.py file
  • For tooling: added support for pytest coverage calculation; also added the R (refactor) Ruff checks
  • The src/druncschema/apps/__main_generate_protos__. py code is no longer treated as a pip installed application. This is because it's meant to be run in a development context with the schema/druncschema/*.proto files available (e.g., you can't run it if you dbt-setup-release). Now it's simply a script which is made available via dbt-build. Notice also the name change; it's just generate_protos.py.

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • [X ] Breaking change (whatever its nature)

Key checklist

  • [] All tests pass (eg. python -m pytest)
  • [] Pre-commit hooks run successfully (eg. pre-commit run --all-files)
    There are no tests to pass/fail, and while I get a warning for a missing docstring in src/druncschema/__init__.py I'm not sure what to put there.

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added or an issue has been opened to tackle that in the future.
    (Indicate issue here: # (issue))
    It would be a good idea for someone to add tests here; also, I didn't look at the code itself since this PR tackles package standardization.

John Freeman added 8 commits November 1, 2025 10:03
… src/druncschema and removing version specifications from pyproject.toml
… python_not_for_dunedaq/druncschema to src/druncschema
… out of the Python-package part of druncschema, as this is meant to be used as a developer tool in a work area
…in practice means add pytest coverage and add the refactoring suggestions section of Ruff
@jcfreeman2
Copy link
Contributor Author

Also worth noting: yesterday a test build was made with this branch (DRNCFD_DEV_251101_A9) (https://github.com/DUNE-DAQ/daq-release/actions/runs/19001367458) which passed integration tests (https://github.com/DUNE-DAQ/daq-release/actions/runs/19002454208).

@PawelPlesniak
Copy link
Contributor

The src/druncschema/apps/main_generate_protos. py code is no longer treated as a pip installed application. This is because it's meant to be run in a development context with the schema/druncschema/*.proto files available (e.g., you can't run it if you dbt-setup-release). Now it's simply a script which is made available via dbt-build. Notice also the name change; it's just generate_protos.py.

I like this, this is a very good idea that I have added to the previous standardization document, which I am maintaining as a reference point

@jcfreeman2
Copy link
Contributor Author

Pawel's given the go-ahead in the CCM meeting, so I'll now merge.

@jcfreeman2 jcfreeman2 merged commit b543ec0 into develop Nov 3, 2025
1 check passed
@jcfreeman2 jcfreeman2 deleted the johnfreeman/issue66_standardization_v2 branch November 3, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants