Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pip >= 10 support in the release script. #115

Merged
merged 1 commit into from
Jun 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@
# -*- coding: utf-8 -*-
import sys

import pip
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements

try: # for pip >= 10
from pip._internal import download
except ImportError: # for pip <= 9.0.3
from pip import download

from setuptools import find_packages
from setuptools import setup

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

requirements = pip.req.parse_requirements(
'requirements.txt', session=pip.download.PipSession(),
requirements = parse_requirements(
'requirements.txt', session=download.PipSession(),
)

pip_requirements = [str(r.req) for r in requirements]
Expand Down