in setup.py [0:0]
def locked_requirements(section):
"""Look through the 'Pipfile.lock' to fetch requirements by section."""
with open("Pipfile.lock") as pip_file:
pipfile_json = json.load(pip_file)
if section not in pipfile_json:
print("{0} section missing from Pipfile.lock".format(section))
return []
return [
package + detail.get("version", "")
for package, detail in pipfile_json[section].items()
]