Skip to content

Added basic import structure for library usage#390

Merged
asmacdo merged 3 commits intocon:mainfrom
CodyCBakerPhD:scopes
Feb 2, 2026
Merged

Added basic import structure for library usage#390
asmacdo merged 3 commits intocon:mainfrom
CodyCBakerPhD:scopes

Conversation

@CodyCBakerPhD
Copy link
Contributor

@CodyCBakerPhD CodyCBakerPhD commented Jan 30, 2026

fix #389

@asmacdo Here you go

Copilot AI review requested due to automatic review settings January 30, 2026 18:15
@CodyCBakerPhD CodyCBakerPhD marked this pull request as draft January 30, 2026 18:16
@CodyCBakerPhD
Copy link
Contributor Author

Well, one second - it's behaving a bit oddly in kernel ATM

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.83%. Comparing base (3756590) to head (4ca4b23).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #390      +/-   ##
==========================================
+ Coverage   91.81%   91.83%   +0.01%     
==========================================
  Files          15       15              
  Lines        1112     1114       +2     
  Branches      138      138              
==========================================
+ Hits         1021     1023       +2     
  Misses         69       69              
  Partials       22       22              

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes a minimal public API surface for the con_duct package by re-exporting the main execution entrypoint and explicitly defining module exports.

Changes:

  • Re-export execute from duct_main at the package root (con_duct.execute).
  • Add __all__ to explicitly define the intended public exports (execute, __version__).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CodyCBakerPhD CodyCBakerPhD self-assigned this Jan 30, 2026
@CodyCBakerPhD CodyCBakerPhD requested a review from asmacdo January 30, 2026 18:24
@CodyCBakerPhD CodyCBakerPhD marked this pull request as ready for review January 30, 2026 18:24
@CodyCBakerPhD
Copy link
Contributor Author

@asmacdo OK good to go - just note that duct_main does need to be relabeled as private (this one out of necessity for completerlib, not just convention) since it is the source of the execute function and must be imported into the namespace for that

@asmacdo asmacdo changed the title Bare bones scoping Added basic import structure for library usage Jan 30, 2026
Copy link
Member

@asmacdo asmacdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CodyCBakerPhD IMO this looks good, but I'm wondering if we've restricted it enough. Should the other files (ie cli ls json_utils, plot, pprint_json) also be made private for now? I'll go ahead and merge, but I suspect we should do a followup and perhaps reopen #389

@asmacdo asmacdo merged commit 1e704f3 into con:main Feb 2, 2026
29 of 30 checks passed
@CodyCBakerPhD
Copy link
Contributor Author

@asmacdo So, this back to how strictly you want to follow convention

Technically, anything not included in the scoped init of this PR should be marked private (both modules and internal methods / classes / globals)

But as it is, the scope hides them well enough since they are not directly imported by the execute method of _duct_main.py, so they are 'private' simply because they are 'not found' by common searchers

I think the VSCode completion is more sensitive to folder existence than PyCharm or ipython are so that would be the exception I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Library scope structure

2 participants