From 914ab79cca7104164e43b6cd11c856654dd9eae6 Mon Sep 17 00:00:00 2001 From: matfax Date: Fri, 18 Oct 2019 01:48:21 +0200 Subject: [PATCH] fix: use json to pass dependencies to setup.py --- setup.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index b511f39..eab0f91 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,14 @@ +import json from pathlib import Path -import toml from setuptools import setup, find_packages -def get_dependencies(): - with open('Pipfile', 'r') as fh: - pipfile = fh.read() - return toml.loads(pipfile).values() +def get_dependencies(pipfile_lock=None): + if pipfile_lock is None: + pipfile_lock = Path("Pipfile.lock") + lock_data = json.load(pipfile_lock.open()) + return [package_name for package_name in lock_data.get('default', {}).keys()] setup(