Skip to content

Conversation

@SFJohnson24
Copy link
Collaborator

@SFJohnson24 SFJohnson24 commented Jan 20, 2026

this PR adds a python version check and a warning if users are not using 3.12.

@SFJohnson24 SFJohnson24 marked this pull request as ready for review January 20, 2026 14:11
@SFJohnson24 SFJohnson24 self-assigned this Jan 20, 2026
@SFJohnson24 SFJohnson24 requested review from RamilCDISC and gerrycampion and removed request for RamilCDISC January 20, 2026 14:20
f"You are using Python {python_version.major}.{python_version.minor}.{python_version.micro} "
f"You may experience unexpected errors or issues with the validation"
)
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

The AC requires that the validation exits if its not correct python version. With current code only warning will be logged but validation will continue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i thought this through and alterred this--code now enforces a minimum version and warns if it is a newer version of python >3.12 as these are untested

Copy link
Collaborator

@RamilCDISC RamilCDISC left a comment

Choose a reason for hiding this comment

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

I ran a validation using python3.9 to validate the PR. I got following error.

python3 core.py validate -s sdtmig -v 3.4 -dp /Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/tests/resources/test_dataset.json
Traceback (most recent call last):
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/core.py", line 13, in <module>
    from cdisc_rules_engine.config import config
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/__init__.py", line 1, in <module>
    from .plugin_loader import PluginLoader
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/plugin_loader.py", line 10, in <module>
    from cdisc_rules_engine.operations import OperationsFactory
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/operations/__init__.py", line 1, in <module>
    from cdisc_rules_engine.operations.operations_factory import OperationsFactory
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/operations/operations_factory.py", line 4, in <module>
    from cdisc_rules_engine.operations.base_operation import BaseOperation
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/operations/base_operation.py", line 1, in <module>
    from cdisc_rules_engine.models.operation_params import OperationParams
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/models/operation_params.py", line 3, in <module>
    from cdisc_rules_engine.models.external_dictionaries_container import (
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/models/external_dictionaries_container.py", line 1, in <module>
    from cdisc_rules_engine.models.dictionaries.dictionary_types import DictionaryTypes
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/models/dictionaries/__init__.py", line 6, in <module>
    from .abstract_factory import AbstractTermsFactory
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/models/dictionaries/abstract_factory.py", line 11, in <module>
    from .meddra import MedDRATermsFactory
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/models/dictionaries/meddra/__init__.py", line 6, in <module>
    from .meddra_terms_factory import MedDRATermsFactory
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/models/dictionaries/meddra/meddra_terms_factory.py", line 14, in <module>
    from cdisc_rules_engine.utilities.utils import get_dictionary_path, decode_line
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/utilities/utils.py", line 35, in <module>
    from cdisc_rules_engine.check_operators.helpers import is_valid_date
  File "/Users/ramilabbasov/Desktop/ISSUES/ISS-1485/cdisc-rules-engine/cdisc_rules_engine/check_operators/helpers.py", line 161, in <module>
    def detect_datetime_precision(date_str: str) -> DatePrecision | None:
TypeError: unsupported operand type(s) for |: 'EnumMeta' and 'NoneType'

The error is because we are importing code before performing python check. I think it would be better to move the python version test in top of core.py file before any imports. If version validates we can proceed on to import our library and continue with whatever operation user has selected.

Copy link
Collaborator

@RamilCDISC RamilCDISC left a comment

Choose a reason for hiding this comment

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

updated to highlight required version of python more strongly.

@SFJohnson24 SFJohnson24 merged commit ecde8f8 into main Jan 28, 2026
11 checks passed
@SFJohnson24 SFJohnson24 deleted the python branch January 28, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants