How to use the requirementslib.models.utils.init_requirement function in requirementslib

To help you get started, we’ve selected a few requirementslib 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 sarugaku / requirementslib / tests / unit / test_utils.py View on Github external
def test_init_requirement():
    req = utils.init_requirement("requests[security]")
    assert req.name == "requests"
    assert req.extras == ("security",)
    req = utils.init_requirement("requests[security,insecurity]")
    assert sorted(req.extras) == ["insecurity", "security"]
    req = utils.init_requirement("requests[security,insecurity]>=2.19.1")
    assert req.specifier
    assert req.revision is None
    assert req.vcs is None
    assert req.path is None
github sarugaku / requirementslib / tests / unit / test_utils.py View on Github external
def test_init_requirement():
    req = utils.init_requirement("requests[security]")
    assert req.name == "requests"
    assert req.extras == ("security",)
    req = utils.init_requirement("requests[security,insecurity]")
    assert sorted(req.extras) == ["insecurity", "security"]
    req = utils.init_requirement("requests[security,insecurity]>=2.19.1")
    assert req.specifier
    assert req.revision is None
    assert req.vcs is None
    assert req.path is None
github sarugaku / requirementslib / tests / unit / test_utils.py View on Github external
def test_init_requirement():
    req = utils.init_requirement("requests[security]")
    assert req.name == "requests"
    assert req.extras == ("security",)
    req = utils.init_requirement("requests[security,insecurity]")
    assert sorted(req.extras) == ["insecurity", "security"]
    req = utils.init_requirement("requests[security,insecurity]>=2.19.1")
    assert req.specifier
    assert req.revision is None
    assert req.vcs is None
    assert req.path is None