tests_require=['pytest', 'pytest-cov'] breaks setuptools.setup #196
Comments
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): It looks like pytest-cov is being matched as the "cov" version of pytest, and so is fulfilling the requirement of "pytest". I seem to recall somewhere that setuptools discourages the use of dashes in package names, probably for this reason. I don't yet know what to recommend here other than to follow the indicated workaround. |
Ref links: * https://bitbucket.org/pypa/setuptools/issue/196 * pypa/setuptools#196 Signed-off-by: Giulio Calacoci <giulio.calacoci@2ndquadrant.it> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@2ndquadrant.it> Signed-off-by: Francesco Canovai <francesco.canovai@2ndquadrant.it>
At the moment you cannot ``python setup.py install`` Anitya (and this is causing our documentation to not build) because we're hitting a setuptools bug[0] which is causing "Flask-WTF" to be matched for the "Flask" requirement. Without the explicit requirement, the Flask plugins we use (including Flask-WTF) will pull Flask in. [0] pypa/setuptools#196 Signed-off-by: Jeremy Cline <jeremy@jcline.org>
At the moment you cannot ``python setup.py install`` Anitya (and this is causing our documentation to not build) because we're hitting a setuptools bug[0] which is causing "Flask-WTF" to be matched for the "Flask" requirement. Without the explicit requirement, the Flask plugins we use (including Flask-WTF) will pull Flask in. [0] pypa/setuptools#196 Signed-off-by: Jeremy Cline <jeremy@jcline.org>
Hello everyone, who can say when this bug will be resolved? |
I don't think it will ever be fixed. Setup requires and easy install are deprecated in favor of PEP 518 in pip and tools like tox and pip. I recommend avoiding easy install and setup requires as much as possible, use the workaround where necesaary. |
What about |
Just encountered this issue today while looking at another bug. It looks like it's caused by reusing the diff --git a/setuptools/dist.py b/setuptools/dist.py
index fa0b5eb4..6cd04d6e 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -482,36 +482,30 @@ class Distribution(Distribution_parse_config_files, _Distribution):
def fetch_build_egg(self, req):
"""Fetch an egg needed for building"""
-
- try:
- cmd = self._egg_fetcher
- cmd.package_index.to_scan = []
- except AttributeError:
- from setuptools.command.easy_install import easy_install
- dist = self.__class__({'script_args': ['easy_install']})
- dist.parse_config_files()
- opts = dist.get_option_dict('easy_install')
- keep = (
- 'find_links', 'site_dirs', 'index_url', 'optimize',
- 'site_dirs', 'allow_hosts'
- )
- for key in list(opts):
- if key not in keep:
- del opts[key] # don't use any other settings
- if self.dependency_links:
- links = self.dependency_links[:]
- if 'find_links' in opts:
- links = opts['find_links'][1].split() + links
- opts['find_links'] = ('setup', links)
- install_dir = self.get_egg_cache_dir()
- cmd = easy_install(
- dist, args=["x"], install_dir=install_dir,
- exclude_scripts=True,
- always_copy=False, build_directory=None, editable=False,
- upgrade=False, multi_version=True, no_report=True, user=False
- )
- cmd.ensure_finalized()
- self._egg_fetcher = cmd
+ from setuptools.command.easy_install import easy_install
+ dist = self.__class__({'script_args': ['easy_install']})
+ dist.parse_config_files()
+ opts = dist.get_option_dict('easy_install')
+ keep = (
+ 'find_links', 'site_dirs', 'index_url', 'optimize',
+ 'site_dirs', 'allow_hosts'
+ )
+ for key in list(opts):
+ if key not in keep:
+ del opts[key] # don't use any other settings
+ if self.dependency_links:
+ links = self.dependency_links[:]
+ if 'find_links' in opts:
+ links = opts['find_links'][1].split() + links
+ opts['find_links'] = ('setup', links)
+ install_dir = self.get_egg_cache_dir()
+ cmd = easy_install(
+ dist, args=["x"], install_dir=install_dir,
+ exclude_scripts=True,
+ always_copy=False, build_directory=None, editable=False,
+ upgrade=False, multi_version=True, no_report=True, user=False
+ )
+ cmd.ensure_finalized()
return cmd.easy_install(req)
def _set_global_opts_from_features(self): Working on adding a test before making a PR. |
Don't reuse `easy_install` command in `Distribution.fetch_build_egg` implementation. Fix pypa#196.
Don't reuse `easy_install` command in `Distribution.fetch_build_egg` implementation. Fix pypa#196.
`python setup.py install` disagrees with travispy (a new dependency) because of pypa/setuptools#196, but the requirements.pip file still does fine for installing all the actual current dependencies.
`python setup.py install` disagrees with travispy (a new dependency) because of pypa/setuptools#196, but the requirements.pip file still does fine for installing all the actual current dependencies.
I can observe this issue with setuptools version |
I'm also seeing a simillar clash between the "Flask" and "flask_restplus" packages using setuptools 41.0.0 and python 3.7.3. Steps to reproduce and output:
|
@ryan-collingham: that's #498, which is a similar issue, but with |
@benoit-pierre Ah thanks, I didn't spot that this issue was specific to |
Originally reported by: slashfoo (Bitbucket: slashfoo, GitHub: slashfoo)
since 'pytest-cov' depends on 'pytest', making
tests_require=['pytest-cov']
fixes the issue, same if it istests_require=['pytest-cov', 'pytest']
.Setting a breakpoint on
${HOME}/.virtualenvs/slashpyenv/lib/python3.4/site-packages/pkg_resources.py:620
(replace for your path to pkg_sources.py) shows:after running on for
req = Requirement.parse('pytest-cov')
, when I run!env.best_match(Requirement.parse('pytest'), ws, installer)
it returns the best match to be 'pytest-cov 1.6' and exits.note: In the report you see 3.4 in the outputs ect... but this is also present in 2.7.
The text was updated successfully, but these errors were encountered: