Skip to content

Conversation

@CodyCBakerPhD
Copy link
Contributor

fix #356

This looks better now

image

Copilot AI review requested due to automatic review settings January 30, 2026 18:38
@CodyCBakerPhD CodyCBakerPhD self-assigned this Jan 30, 2026
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.68%. Comparing base (3756590) to head (c736e91).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #392      +/-   ##
==========================================
- Coverage   91.81%   91.68%   -0.14%     
==========================================
  Files          15       15              
  Lines        1112     1118       +6     
  Branches      138      139       +1     
==========================================
+ Hits         1021     1025       +4     
- Misses         69       70       +1     
- Partials       22       23       +1     

☔ 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

This PR improves error handling for unsupported operating systems by raising a clear, user-friendly NotImplementedError at module import time instead of allowing the application to fail later with a cryptic error. This addresses issue #356, which requested better error messages when the library is imported on unsupported systems like Windows.

Changes:

  • Added early validation check at import time in _sampling.py to detect unsupported operating systems
  • Implemented a user-friendly error message with guidance to request support via GitHub issues
  • Suppressed traceback for cleaner error presentation using sys.tracebacklimit = 0

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@asmacdo asmacdo added the semver-tests Add or improve existing tests label Jan 31, 2026
@asmacdo asmacdo requested a review from Copilot January 31, 2026 17:13
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


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

SYSTEM = platform.system()

_SUPPORTED_SYSTEMS = {"Linux", "Darwin"}
if SYSTEM not in _SUPPORTED_SYSTEMS:
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

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

Setting sys.tracebacklimit = 0 modifies global state that affects all future tracebacks in the Python process. While this is acceptable for this use case (since the program will terminate after raising the error), consider documenting this side effect with a comment. If someone were to catch this exception and continue execution, all subsequent tracebacks would be suppressed.

Suggested change
if SYSTEM not in _SUPPORTED_SYSTEMS:
if SYSTEM not in _SUPPORTED_SYSTEMS:
# NOTE: This modifies global interpreter state and will suppress all subsequent
# tracebacks in the current Python process. This is intentional here to avoid
# noisy stack traces on unsupported platforms; if this exception is caught and
# execution continues, traceback output will remain suppressed.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-tests Add or improve existing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raise RunTime Error on import for unsupported systems (i.e., Windows)

2 participants