Open
Conversation
This changes setup.py, so it does not rely on pip internals to form the list of install requires.
|
@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 ? |
Owner
|
what would be the advantage of switching the |
|
/extra_require/¹ allows installation of test-related dependencies
independently, unlike /tests_require/² which is invoked when the test
command is called. The change here would happen in how to install
dependencies, for example:
on setup.py:
extras_require={
"test'": ["pytest"]
}
|$ pip install -e. [test]|
Even the integration with tox would be simpler, as we could leave the
dependencies (replacing requirements-test.txt) in setup.py and call them
in "deps" in tox.ini:
deps =
. [test]
[1] -
https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies
[2] -
https://setuptools.readthedocs.io/en/latest/setuptools.html?highlight=tests_require#developer-s-guide
|
…On 8/26/19 1:09 PM, guyzmo wrote:
what would be the advantage of switching the |tests_required| to
|extra_required|? 🤔
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#191?email_source=notifications&email_token=AAIPKPHMHC6HPG2ONSJC4QTQGP54FA5CNFSM4FIP3BNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5E24RY#issuecomment-524922439>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIPKPFT2NGERP4WVS3N4ZLQGP54FANCNFSM4FIP3BNA>.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes setup.py, so it does not rely on pip internals to
form the list of install requires.