How to use the requirementslib.models 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_metadata.py View on Github external
def test_metadata(monkeypatch_wheel_download, package_json):
    package = requirementslib.models.metadata.Package.from_json(package_json)
    package = package.get_dependencies()
    deps = sorted([str(d.requirement) for d in package.dependencies])
    if package.name == "llvmlite":
        assert list(set(deps)) == ["enum34"]
    elif package.name == "celery":
        assert list(deps) == [
            "Django>=1.11",
            "PyYAML>=3.10",
            "azure-common==1.1.5",
            "azure-storage-common==1.1.0",
            "azure-storage==0.36.0",
            "backports.lzma",
            "billiard<4.0,>=3.6.1",
            "boto3>=1.9.125",
            "boto3>=1.9.178",
            'brotli>=1.0.0; platform_python_implementation == "CPython"',
github sarugaku / requirementslib / tests / unit / test_markers.py View on Github external
def test_get_specs(specset, new_set):
    assert requirementslib.models.markers._get_specs(specset) == new_set
github sarugaku / requirementslib / tests / unit / test_project.py View on Github external
def test_dir_with_pipfile_creates_project_file(pathlib_tmpdir):
    pipfile = pathlib_tmpdir.joinpath("Pipfile")
    pipfile.write_text(u"")
    project_file = requirementslib.models.project.ProjectFile.read(
        pipfile.as_posix(), requirementslib.models.pipfile.plette.pipfiles.Pipfile
    )
    assert project_file.model is not None
github sarugaku / requirementslib / tests / unit / test_project.py View on Github external
def test_pipfile_entry_comparisons(entry_1, entry_2):
    assert (
        requirementslib.models.project._are_pipfile_entries_equal(entry_1, entry_1)
        is True
    )
    assert (
        requirementslib.models.project._are_pipfile_entries_equal(entry_1, entry_2)
        is False
    )
github sarugaku / requirementslib / tests / unit / test_markers.py View on Github external
def test_tuplize_version(version, cleaned):
    assert requirementslib.models.markers._tuplize_version(version) == cleaned