Skip to content

Add mypy settings and type hints for sessions manager#898

Open
miruuna wants to merge 2 commits intodevelopfrom
miruuna/mypy---session-manager
Open

Add mypy settings and type hints for sessions manager#898
miruuna wants to merge 2 commits intodevelopfrom
miruuna/mypy---session-manager

Conversation

@miruuna
Copy link
Copy Markdown
Contributor

@miruuna miruuna commented Apr 29, 2026

Description

Fixes issue #850

Added mypy settings in pyproject.toml found in #828.

Added some return types but most of it was done already.

Type of change

  • New feature / enhancement
  • Optimization
  • Bug fix
  • Breaking change
  • Documentation

List of required branches from other repositories

None

Change log

Added mypy settings

Suggested manual testing checklist

LIST COMMANDS TO DEMONSTRATE CHANGE

Run
mypy src/drunc/session_manager/

Developer checklist

Prior to marking this as "Ready for Review"

Tests ran on: NFD_DEV_260310_A9

Unit tests - some tests can't be ran on the CI. This is documented. If this PR checks a feature that can't be tested with CI, this has been marked appropriately.

Integration tests - the daqsystemtest_integtest_bundle requires a lot of resources, and connections to the EHN1 infrastructure. Check the cross referenced list if you can't run these. The developer needs to run at least the .

  • Unit tests (pytest --marker) passed
    • With relevant marker
    • Without marker
  • Integration tests passed
    • Only daqsystemtest_integtest_bundle.sh -k minimal_system_quick_test.py
    • Full daqsystemtest_integtest_bundle.sh
  • Testing skipped as there are no core code changes in this PR, this only relates to documentation/CI workflows

Final checklist prior to marking this as "Ready for Review"

  • Code is clearly commented.
  • New unit tests have been added, or is documented in # ISSUE NUMBER
  • A suitable reviewer has been chosen from this list.

Reviewer checklist

  • This branch has been rebased with develop prior to testing.
  • Suggested manual tests show changes.
  • CI workflows fails documented (if present)
  • Integration tests passed
    • Only concern yourself if failures related to drunc are in the log files
    • If non-drunc failure appears:
      • Validate failure in fresh working area
      • Contact Pawel if unsure

Once the features are validated and both the unit and integration tests pass, the PRs is ready to be merged.

Prior to merging

Choose one of the following an complete all substeps
  • Changes only affect the Run Control, are in a single repository, and do not affect the end user.
    • Changes are documented in docstrings and code comments
    • Wiki has been updated if architectural or endpoint changes
  • Otherwise
    • Workflow changes demonstrated in the Change Log (if necessary)
    • Wiki has been updated (if necessary)
    • #daq-sw-librarians Slack channel notified (see below)

Once completed, the reviewer can merge the PR.

Notification message for a Slack channel

Note - this should be to #dunedaq-integration for general workflow that isn't during a release candidate period, and to #daq-release-prep otherwise.

For an single merge that changes the user workflow

The CCM WG has an isolated PR ready to merge that affects user workflows. The PR is:

_URL_

I will leave time for any comments, otherwise will merge these at the end of the work day _Insert your time zone_.

For co-ordinated merge

The CCM WG has a set of co-ordinated merges ready to merge. The PRs are:

_URL_

_URL_


I will leave time for any comments, otherwise will merge these at the end of the day.

@miruuna miruuna linked an issue Apr 29, 2026 that may be closed by this pull request
@miruuna miruuna requested a review from PawelPlesniak April 29, 2026 15:17
@miruuna
Copy link
Copy Markdown
Contributor Author

miruuna commented Apr 29, 2026

Just tagging more people to see if the mypy settings suggested by @PawelPlesniak in #828 and added here in pyproject.toml are enough or we should change/relax some of them. It'd be easier to work on the rest of the mypy issues once this is decided. @jamesturner246 @Aurashk @emmuhamm

@emmuhamm
Copy link
Copy Markdown
Contributor

Hi @miruuna, thanks for this!

When working with #862 for the utils, I defined the settings I used in this commit here: 2097249

It looks like we basically have near identical settings, except yours also includes

warn_unused_configs = true
show_error_codes = true

Which I see no problems with. Also looks like your Ruff settings are comparable with what I used.

So bottom line is, in my opinion I think thats enough since we've both used very similar settings. Interested to hear what other people think though

@miruuna miruuna requested a review from jamesturner246 April 30, 2026 12:13
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.

[Feature]: mypy - session manager

3 participants