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.54% 81.54%
=======================================
Files 35 35
Lines 2439 2439
=======================================
Hits 1989 1989
Misses 450 450 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2964525 to
2f17004
Compare
Fixed the PR @samaloney |
|
Great thanks this looks good. One of the main reasons is the the Once the tests pass will get this merged |
mashhoorahdal
left a comment
There was a problem hiding this comment.
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 |
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.
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.
bdba7c4 to
7784ee9
Compare
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