Skip to content

[bug] Import yaml lazily in the YAML publishers - #288

Merged
timkpaine merged 1 commit into
mainfrom
bug/lazy-yaml-import
Oct 27, 2026
Merged

timkpaine merged 1 commit into
mainfrom
bug/lazy-yaml-import

Conversation

@ptomecek

@ptomecek ptomecek commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description

pyyaml is not a declared dependency. It was only installed through hydra-core, which #287 made optional. ccflow/publishers/file.py and ccflow/publishers/print.py import yaml at module level and are loaded by import ccflow, so a bare pip install ccflow cannot import the package.

This moves the import into YAMLPublisher.__call__ and PrintYAMLPublisher.__call__, so only those two publishers need pyyaml. CI did not catch this because it installs the develop extras.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup
  • CI / build configuration
  • Other (describe below)

Checklist

  • Linting passes (make lint)
  • Tests pass (make test)
  • New tests added for new functionality
  • Documentation updated (if applicable)
  • Changelog / version bump (if applicable)

pyyaml was only installed transitively through hydra-core, which is now
optional, so a bare install could not import ccflow. Import it inside
YAMLPublisher and PrintYAMLPublisher instead of at module level.

Signed-off-by: Pascal Tomecek <40371786+ptomecek@users.noreply.github.com>
@timkpaine
timkpaine merged commit 48b6ea1 into main Oct 27, 2026
17 checks passed
@timkpaine
timkpaine deleted the bug/lazy-yaml-import branch October 27, 2026 23:04
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.83%. Comparing base (7666a7d) to head (d8bb6d0).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #288   +/-   ##
=======================================
  Coverage   93.83%   93.83%           
=======================================
  Files         203      203           
  Lines       22488    22488           
  Branches     1458     1458           
=======================================
  Hits        21101    21101           
  Misses       1099     1099           
  Partials      288      288           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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