oasis-open / cti-stix-validator

OASIS TC Open Repository: Validator for STIX 2.0 JSON normative requirements and best practices
https://stix2-validator.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
50 stars 41 forks source link

stix2patterns.pattern module not found in latest tag version #101

Closed mdazam1942 closed 4 years ago

mdazam1942 commented 4 years ago

Importing stix2patterns.pattern throws exception as the location of pattern is moved in the latest tag version of stix2-patterns==1.2.0. Here's the stacktrace of the error:

Traceback:
<file path>:5: in <module>
    from stix2validator import validate_instance, print_results
virtualenv/lib/python3.6/site-packages/stix2validator/__init__.py:9: in <module>
    from .validator import (run_validation, validate, validate_file,
virtualenv/lib/python3.6/site-packages/stix2validator/validator.py:15: in <module>
    from . import musts, output, shoulds
virtualenv/lib/python3.6/site-packages/stix2validator/musts.py:8: in <module>
    from stix2patterns.pattern import Pattern
E   ModuleNotFoundError: No module named 'stix2patterns.pattern'

@clenk can you please verify? i can see Pattern(object) is copied into couple of directories v20 and v21 in stix2patterns

clenk commented 4 years ago

Yes, it was moved. We're working on a backwards compatibility patch which would allow that import to work, defaulting to v2.0 pattern validation. In version 2.0.0 of the validator the default will change to v2.1.

clenk commented 4 years ago

I just released v1.2.1 of the stix2patterns that should fix this. Please let me know if you're still seeing issues.

mdazam1942 commented 4 years ago

It works now! No issues so far. Thank you so much @clenk

mdazam1942 commented 4 years ago

I'm closing the issue as this is fixed