How to use the flit.common.Metadata function in flit

To help you get started, we’ve selected a few flit 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 takluyver / flit / tests / test_common.py View on Github external
def test_supports_py2(requires_python, expected_result):
    from flit.common import Metadata
    metadata = object.__new__(Metadata)
    metadata.requires_python = requires_python
    result = metadata.supports_py2
    assert result == expected_result
github takluyver / flit / tests / test_metadata.py View on Github external
def test_extras_dev_warning(caplog):
    info = read_pkg_ini(samples_dir / 'extras-dev-conflict.toml')
    info['metadata']['requires_extra'] = {}
    meta = Metadata(dict(name=info['module'], version='0.0', summary='', **info['metadata']))
    assert '“dev-requires = ...” is obsolete' in caplog.text
    assert set(meta.requires_dist) == {'apackage; extra == "dev"'}
github takluyver / flit / tests / test_metadata.py View on Github external
def test_extra_conditions():
    info = read_pkg_ini(samples_dir / 'extras.toml')
    meta = Metadata(dict(name=info['module'], version='0.0', summary='', **info['metadata']))
    assert set(meta.requires_dist) == {'toml', 'pytest; extra == "test"', 'requests; extra == "custom"'}
github takluyver / flit / tests / test_metadata.py View on Github external
def test_extras_dev_conflict():
    info = read_pkg_ini(samples_dir / 'extras-dev-conflict.toml')
    with pytest.raises(ValueError, match=r'Ambiguity'):
        Metadata(dict(name=info['module'], version='0.0', summary='', **info['metadata']))