Skip to content

Commit

Permalink
Fix setup to work with pip 10
Browse files Browse the repository at this point in the history
pip.req has been moved to pip._internal.req in pip 10 and it is not recommended to use it.
  • Loading branch information
ssable committed Apr 17, 2018
1 parent cbd4c26 commit 940de2c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pip.req import parse_requirements
try:
from setuptools import setup
except ImportError:
from distutils.core import setup

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("#")]

with open('README.rst') as readme_file:
readme = readme_file.read()

with open('HISTORY.rst') as history_file:
history = history_file.read()

requirements = [str(i.req) for i in parse_requirements('requirements.txt', session=False)]
test_requirements = [str(i.req) for i in parse_requirements('requirements_dev.txt', session=False)]
requirements = parse_requirements('requirements.txt')
test_requirements = parse_requirements('requirements_dev.txt')

setup(
name='swagger_stub',
Expand Down

0 comments on commit 940de2c

Please sign in to comment.