-
Notifications
You must be signed in to change notification settings - Fork 25
Export version attributes from main package #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Export version attributes from main package #209
Conversation
4ad07ea to
2777ba5
Compare
|
So that issue was referring to the Fido attrs in the file indicated below, not the package version. https://github.com/TCDSolar/stixpy/blob/main/stixpy/net/attrs.py |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #209 +/- ##
=======================================
Coverage 81.53% 81.53%
=======================================
Files 36 36
Lines 2459 2459
=======================================
Hits 2005 2005
Misses 454 454 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Added missing version attributes (Version, VersionU, MinVersion, MinVersionU, MaxVersion, MaxVersionU) to the __all__ list in stixpy.net.attrs module and added comprehensive tests to verify their functionality and importability.
2964525 to
2f17004
Compare
Fixed the PR @samaloney |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added missing version attributes in __all__
|
Great thanks this looks good. One of the main reasons is the the Once the tests pass will get this merged |
Changed the operator from less-than (<) to less-than-or-equal (<=) in both MaxVersion and MaxVersionU classes to correctly handle maximum version constraints. This ensures that the specified maximum version is included in the valid range rather than excluded.
mashhoorahdal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make MaxVersion attributes inclusive
Summary
MaxVersion and MaxVersionU were previously implemented as exclusive upper bounds using a strict < comparison.
This caused MaxVersion(n) to reject version Vnn, which is unintuitive and inconsistent with how version constraints are typically interpreted.
With the availability of newer STIX data versions (e.g. V03), this off-by-one behavior became visible and resulted in incorrect attribute matching.
What changed
- Updated
MaxVersionandMaxVersionUto use inclusive comparison (<=) - Ensures:
MaxVersion(3)matchesV03MaxVersion(3)does not matchV04
- Tests explicitly document and enforce this boundary behavior
Rationale
- The name
MaxVersionimplies an inclusive upper bound - Rejecting
VnnforMaxVersion(n)is surprising to users - Inclusive behavior aligns with real STIX data usage
- Tests act as executable documentation of intended semantics
Tests
Boundary cases are now covered:
MaxVersion(n)matchesVnnMaxVersion(n)rejects versions greater thanVnnMaxVersionUfollows the same inclusive logic for uncompleted versions
Backward compatibility
This change is a bug fix, not a breaking change:
- Existing valid queries continue to work
- Previously failing boundary matches now behave correctly
|
@samaloney Why CI / core failing |
nicHoch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks all good
Description
This PR fixes issue #207 by exporting version attributes from the
stixpy.net.attrsmodule.Changes Made
Version,VersionU,MinVersion,MinVersionU,MaxVersion,MaxVersionU) to the module's__all__listTesting
Issue Reference
Fixes #207: Version attrs not exported in all
Checklist