How to use the requirementslib.Lockfile 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 / passa / src / passa / lockfile.py View on Github external
comes_from = [dep]
        if any(name in dev_names for name in comes_from):
            dev_reqs.append(req)
        if any(name in req_names for name in comes_from):
            reqs.append(req)

    creation_dict = {
        "path": pipfile.path.parent / 'Pipfile.lock',
        "pipfile_hash": Hash(value=pipfile.get_hash()),
        "sources": [s for s in pipfile.sources],
        "dev_requirements": dev_reqs,
        "requirements": reqs,
    }
    if pipfile.requires.has_value():
        creation_dict['requires'] = pipfile.requires
    lockfile = Lockfile(**creation_dict)
    return lockfile