How to use the libratom.__version__ function in libratom

To help you get started, we’ve selected a few libratom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github libratom / libratom / tests / unit / test_libratom.py View on Github external
def test_version():
    assert libratom.__version__
github libratom / libratom / tests / unit / test_cli.py View on Github external
        (["--version"], libratom.__version__),
    ],
)
def test_ratom(cli_runner, params, expected):

    result = cli_runner.invoke(ratom, args=params)
    assert result.exit_code == 0
    assert expected in result.output

    with pytest.raises(ValueError):
        db_session_from_cmd_out(result)
github libratom / libratom / libratom / lib / report.py View on Github external
def store_configuration_in_db(
    session: Session,
    src: str,
    jobs: int,
    spacy_model: Optional[str] = None,
    spacy_model_version: Optional[int] = None,
) -> None:
    """
    Store configuration / environment information in the database output during a ratom command execution
    """

    configuration = {
        "source": src,
        "jobs": jobs,
        "libratom_version": libratom.__version__,
        "spacy_model_name": spacy_model,
        "spacy_model_version": spacy_model_version,
    }

    settings = [
        Configuration(name=key, value=str(value))
        for key, value in configuration.items()
    ]

    settings.extend(
        [
            Configuration(name=key, value=str(value))
            for key, value in get_ratom_settings()
        ]
    )