Skip to content

Commit

Permalink
fix: use json to pass dependencies to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
matfax committed Oct 17, 2019
1 parent ce33dba commit 914ab79
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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(
Expand Down

0 comments on commit 914ab79

Please sign in to comment.