Skip to content

Commit

Permalink
removed dependency on pip internal function
Browse files Browse the repository at this point in the history
  • Loading branch information
paulte committed Apr 16, 2018
1 parent 31d04eb commit 470d9dc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
import re
import warnings

from pip.req import parse_requirements
from setuptools import setup, find_packages

version = '0.9.1'

def parse_requirements(filename):
""" load requirements from a pip requirements file """
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]


news = os.path.join(os.path.dirname(__file__), 'docs', 'news.rst')
news = open(news).read()
parts = re.split(r'([0-9\.]+)\s*\n\r?-+\n\r?', news)
Expand All @@ -29,12 +34,7 @@
long_description += '\n%s\n%s\n' % (title, '-' * len(title))
long_description += found_news

# parse_requirements() returns generator of pip.req.InstallRequirement objects
install_reqs = parse_requirements(os.path.join(os.path.dirname(__file__), 'requirements.txt'), session=False)

# reqs is a list of requirement
# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
reqs = [str(ir.req) for ir in install_reqs]
reqs = parse_requirements(os.path.join(os.path.dirname(__file__), 'requirements.txt'))

setup(
name='stravalib',
Expand Down

0 comments on commit 470d9dc

Please sign in to comment.