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

Fix setup error when using pip 10 #191

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

nikitavbv
Copy link
Contributor

This changes setup.py, so it does not rely on pip internals to
form the list of install requires.

This changes setup.py, so it does not rely on pip internals to
form the list of install requires.
@gutierri
Copy link

@nikitavbv Great ... but what do you think of this approach here:

diff --git a/requirements-test.txt b/requirements-test.txt
index 700db9b..9ede2ac 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,5 +1,3 @@
--r requirements.txt
--e .
 pytest
 pytest-cov
 pytest-sugar
diff --git a/setup.py b/setup.py
index 125164c..2be25d4 100644
--- a/setup.py
+++ b/setup.py
@@ -4,8 +4,6 @@ from setuptools import setup, find_packages
 
 import sys, os
 
-import pip
-
 from setuptools import setup, find_packages, dist
 from setuptools.command.test import test as TestCommand
 from distutils.core import Command
@@ -120,16 +118,9 @@ requirements_links = []
 def requirements(spec=None):
	 spec = '{}{}.txt'.format('requirements',
			 '-'+spec if spec else '')
-    requires = []
-
-    requirements = pip.req.parse_requirements(
-        spec, session=pip.download.PipSession())
 
-    for item in requirements:
-        if getattr(item, 'link', None):
-            requirements_links.append(str(item.link))
-        if item.req:
-            requires.append(str(item.req))
+    with open(spec, 'r') as requirements_txt:
+        requires = requirements_txt.read().splitlines()
 
	 return requires
 

Also, it might be interesting to move tests_required to an extra_required (e.g. pip install -e. [tests]). What do you think @guyzmo ?

@guyzmo
Copy link
Owner

guyzmo commented Aug 26, 2019

what would be the advantage of switching the tests_required to extra_required? 🤔

@gutierri
Copy link

gutierri commented Sep 4, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants