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

Pyhash 0.9.3 does not install with more-itertools > 5.x #37

Open
sgrzemski opened this issue Jan 17, 2020 · 2 comments
Open

Pyhash 0.9.3 does not install with more-itertools > 5.x #37

sgrzemski opened this issue Jan 17, 2020 · 2 comments

Comments

@sgrzemski
Copy link

sgrzemski commented Jan 17, 2020

Hi there,
I am experiencing issues installing pyhash when more-itertools over 5.x is installed:

(base) root@04931f9c4e76:/# pip install pyhash
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pyhash
  Downloading https://files.pythonhosted.org/packages/f0/bf/4db9bed05d10824a17697f65063de19892ca2171a31a9c6854f9bbf55c02/pyhash-0.9.3.tar.gz (602kB)
     |████████████████████████████████| 604kB 3.2MB/s 
    ERROR: Command errored out with exit status 1:
     command: /opt/conda/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x7aoCw/pyhash/setup.py'"'"'; __file__='"'"'/tmp/pip-install-x7aoCw/pyhash/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-install-x7aoCw/pyhash/
    Complete output (403 lines):
      File "build/bdist.linux-x86_64/egg/_pytest/tmpdir.py", line 40
        def from_config(cls, config) -> "TempPathFactory":
                                     ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/runner.py", line 229
        def from_call(cls, func, when, reraise=None) -> "CallInfo":
                                                     ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/capture.py", line 245
        def _ensure_only_one_capture_fixture(request: FixtureRequest, name):
                                                    ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/pytester.py", line 159
        def _pytest(request: FixtureRequest) -> "PytestArg":
                           ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/_io/saferepr.py", line 15
        def _format_repr_exception(exc: BaseException, obj: Any) -> str:
                                      ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/outcomes.py", line 22
        def __init__(self, msg: Optional[str] = None, pytrace: bool = True) -> None:
                              ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/warning_types.py", line 84
        def simple(cls, apiname: str) -> "PytestExperimentalApiWarning":
                               ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/pathlib.py", line 37
        def get_lock_path(path: _AnyPurePath) -> _AnyPurePath:
                              ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/main.py", line 371
        def __missing__(self, path: str) -> str:
                                  ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/mark/structures.py", line 54
        def param(cls, *values, marks=(), id=None):
                                    ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/doctest.py", line 136
        self, reprlocation_lines: Sequence[Tuple[ReprFileLocation, Sequence[str]]]
                                ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/compat.py", line 57
        def _format_args(func: Callable[..., Any]) -> str:
                             ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/fixtures.py", line 701
        def formatrepr(self) -> "FixtureLookupErrorRepr":
                             ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/nodes.py", line 84
        parent: Optional["Node"] = None,
              ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/reports.py", line 47
        def toterminal(self, out) -> None:
                                  ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/cacheprovider.py", line 61
        def clear_cache(cls, cachedir: Path):
                                     ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/_code/source.py", line 30
        def __init__(self, *parts, **kwargs) -> None:
                                             ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/_code/code.py", line 50
        def __init__(self, rawcode) -> None:
                                    ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/config/argparsing.py", line 88
        def _getparser(self) -> "MyOptionParser":
                             ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/config/findpaths.py", line 112
        inifile: Optional[str],
               ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/config/__init__.py", line 61
        def main(args=None, plugins=None) -> "Union[int, _pytest.main.ExitCode]":
                                          ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/logging.py", line 42
        def __init__(self, terminalwriter, *args, **kwargs) -> None:
                                                            ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/python.py", line 283
        def reportinfo(self) -> Tuple[str, int, str]:
                             ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/resultlog.py", line 52
        print("{} {}".format(lettercode, testpath), file=self.logfile)
                                                        ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/assertion/util.py", line 46
        def _pformat_dispatch(object, indent=1, width=80, depth=None, *, compact=False):
                                                                       ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/assertion/rewrite.py", line 207
        def _is_marked_for_rewrite(self, name: str, state):
                                             ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/assertion/__init__.py", line 36
        def register_assert_rewrite(*names) -> None:
                                            ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/recwarn.py", line 60
        expected_warning: Union["Type[Warning]", Tuple["Type[Warning]", ...]],
                        ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/python_api.py", line 548
        expected_exception: Union["Type[_E]", Tuple["Type[_E]", ...]],
                          ^
    SyntaxError: invalid syntax
    
      File "build/bdist.linux-x86_64/egg/_pytest/terminal.py", line 156
        def pytest_configure(config: Config) -> None:
                                   ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/cacheprovider.py", line 61
        def clear_cache(cls, cachedir: Path):
                                     ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/capture.py", line 245
        def _ensure_only_one_capture_fixture(request: FixtureRequest, name):
                                                    ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/compat.py", line 57
        def _format_args(func: Callable[..., Any]) -> str:
                             ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/doctest.py", line 136
        self, reprlocation_lines: Sequence[Tuple[ReprFileLocation, Sequence[str]]]
                                ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/fixtures.py", line 701
        def formatrepr(self) -> "FixtureLookupErrorRepr":
                             ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/logging.py", line 42
        def __init__(self, terminalwriter, *args, **kwargs) -> None:
                                                            ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/main.py", line 371
        def __missing__(self, path: str) -> str:
                                  ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/nodes.py", line 84
        parent: Optional["Node"] = None,
              ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/outcomes.py", line 22
        def __init__(self, msg: Optional[str] = None, pytrace: bool = True) -> None:
                              ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/pathlib.py", line 37
        def get_lock_path(path: _AnyPurePath) -> _AnyPurePath:
                              ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/pytester.py", line 159
        def _pytest(request: FixtureRequest) -> "PytestArg":
                           ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/python.py", line 283
        def reportinfo(self) -> Tuple[str, int, str]:
                             ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/python_api.py", line 548
        expected_exception: Union["Type[_E]", Tuple["Type[_E]", ...]],
                          ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/recwarn.py", line 60
        expected_warning: Union["Type[Warning]", Tuple["Type[Warning]", ...]],
                        ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/reports.py", line 47
        def toterminal(self, out) -> None:
                                  ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/resultlog.py", line 52
        print("{} {}".format(lettercode, testpath), file=self.logfile)
                                                        ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/runner.py", line 229
        def from_call(cls, func, when, reraise=None) -> "CallInfo":
                                                     ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/terminal.py", line 156
        def pytest_configure(config: Config) -> None:
                                   ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/tmpdir.py", line 40
        def from_config(cls, config) -> "TempPathFactory":
                                     ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/warning_types.py", line 84
        def simple(cls, apiname: str) -> "PytestExperimentalApiWarning":
                               ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/_code/code.py", line 50
        def __init__(self, rawcode) -> None:
                                    ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/_code/source.py", line 30
        def __init__(self, *parts, **kwargs) -> None:
                                             ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/_io/saferepr.py", line 15
        def _format_repr_exception(exc: BaseException, obj: Any) -> str:
                                      ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/assertion/__init__.py", line 36
        def register_assert_rewrite(*names) -> None:
                                            ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/assertion/rewrite.py", line 207
        def _is_marked_for_rewrite(self, name: str, state):
                                             ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/assertion/util.py", line 46
        def _pformat_dispatch(object, indent=1, width=80, depth=None, *, compact=False):
                                                                       ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/config/__init__.py", line 61
        def main(args=None, plugins=None) -> "Union[int, _pytest.main.ExitCode]":
                                          ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/config/argparsing.py", line 88
        def _getparser(self) -> "MyOptionParser":
                             ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/config/findpaths.py", line 112
        inifile: Optional[str],
               ^
    SyntaxError: invalid syntax
    
      File "/tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg/_pytest/mark/structures.py", line 54
        def param(cls, *values, marks=(), id=None):
                                    ^
    SyntaxError: invalid syntax
    
    
    Installed /tmp/pip-install-x7aoCw/pyhash/.eggs/pytest-5.3.3-py2.7.egg
    Searching for py-cpuinfo
    Reading https://pypi.org/simple/py-cpuinfo/
    Downloading https://files.pythonhosted.org/packages/42/60/63f28a5401da733043abe7053e7d9591491b4784c4f87c339bf51215aa0a/py-cpuinfo-5.0.0.tar.gz#sha256=2cf6426f776625b21d1db8397d3297ef7acfa59018f02a8779123f3190f18500
    Best match: py-cpuinfo 5.0.0
    Processing py-cpuinfo-5.0.0.tar.gz
    Writing /tmp/easy_install-6llkwl/py-cpuinfo-5.0.0/setup.cfg
    Running py-cpuinfo-5.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-6llkwl/py-cpuinfo-5.0.0/egg-dist-tmp-CHNE33
    zip_safe flag not set; analyzing archive contents...
    cpuinfo.cpuinfo: module references __file__
    creating /tmp/pip-install-x7aoCw/pyhash/.eggs/py_cpuinfo-5.0.0-py2.7.egg
    Extracting py_cpuinfo-5.0.0-py2.7.egg to /tmp/pip-install-x7aoCw/pyhash/.eggs
    
    Installed /tmp/pip-install-x7aoCw/pyhash/.eggs/py_cpuinfo-5.0.0-py2.7.egg
    Searching for importlib-metadata>=0.12
    Reading https://pypi.org/simple/importlib-metadata/
    Downloading https://files.pythonhosted.org/packages/d7/31/74dcb59a601b95fce3b0334e8fc9db758f78e43075f22aeb3677dfb19f4c/importlib_metadata-1.4.0-py2.py3-none-any.whl#sha256=bdd9b7c397c273bcc9a11d6629a38487cd07154fa255a467bf704cd2c258e359
    Best match: importlib-metadata 1.4.0
    Processing importlib_metadata-1.4.0-py2.py3-none-any.whl
    Installing importlib_metadata-1.4.0-py2.py3-none-any.whl to /tmp/pip-install-x7aoCw/pyhash/.eggs
    writing requirements to /tmp/pip-install-x7aoCw/pyhash/.eggs/importlib_metadata-1.4.0-py2.7.egg/EGG-INFO/requires.txt
    
    Installed /tmp/pip-install-x7aoCw/pyhash/.eggs/importlib_metadata-1.4.0-py2.7.egg
    Searching for wcwidth
    Reading https://pypi.org/simple/wcwidth/
    Downloading https://files.pythonhosted.org/packages/58/b4/4850a0ccc6f567cc0ebe7060d20ffd4258b8210efadc259da62dc6ed9c65/wcwidth-0.1.8-py2.py3-none-any.whl#sha256=8fd29383f539be45b20bd4df0dc29c20ba48654a41e661925e612311e9f3c603
    Best match: wcwidth 0.1.8
    Processing wcwidth-0.1.8-py2.py3-none-any.whl
    Installing wcwidth-0.1.8-py2.py3-none-any.whl to /tmp/pip-install-x7aoCw/pyhash/.eggs
    
    Installed /tmp/pip-install-x7aoCw/pyhash/.eggs/wcwidth-0.1.8-py2.7.egg
    Searching for pluggy<1.0,>=0.12
    Reading https://pypi.org/simple/pluggy/
    Downloading https://files.pythonhosted.org/packages/a0/28/85c7aa31b80d150b772fbe4a229487bc6644da9ccb7e427dd8cc60cb8a62/pluggy-0.13.1-py2.py3-none-any.whl#sha256=966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d
    Best match: pluggy 0.13.1
    Processing pluggy-0.13.1-py2.py3-none-any.whl
    Installing pluggy-0.13.1-py2.py3-none-any.whl to /tmp/pip-install-x7aoCw/pyhash/.eggs
    writing requirements to /tmp/pip-install-x7aoCw/pyhash/.eggs/pluggy-0.13.1-py2.7.egg/EGG-INFO/requires.txt
    
    Installed /tmp/pip-install-x7aoCw/pyhash/.eggs/pluggy-0.13.1-py2.7.egg
    Searching for more-itertools>=4.0.0
    Reading https://pypi.org/simple/more-itertools/
    Downloading https://files.pythonhosted.org/packages/df/8c/c278395367a46c00d28036143fdc6583db8f98622b83875403f16473509b/more-itertools-8.1.0.tar.gz#sha256=c468adec578380b6281a114cb8a5db34eb1116277da92d7c46f904f0b52d3288
    Best match: more-itertools 8.1.0
    Processing more-itertools-8.1.0.tar.gz
    Writing /tmp/easy_install-x591sI/more-itertools-8.1.0/setup.cfg
    Running more-itertools-8.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-x591sI/more-itertools-8.1.0/egg-dist-tmp-qIKVLX
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-x7aoCw/pyhash/setup.py", line 164, in <module>
        use_2to3=True)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
        replace_conflicting=True,
      File "/opt/conda/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
      File "/opt/conda/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/opt/conda/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
        return cmd.easy_install(req)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/opt/conda/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/opt/conda/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/opt/conda/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/opt/conda/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/opt/conda/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/opt/conda/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-x591sI/more-itertools-8.1.0/setup.py", line 5, in <module>
        import math
      File "/tmp/easy_install-x591sI/more-itertools-8.1.0/more_itertools/__init__.py", line 1, in <module>
      File "/tmp/easy_install-x591sI/more-itertools-8.1.0/more_itertools/more.py", line 480
        yield from iterable
                 ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

When downgrading more-itertools to 5.0 pyhash installs flawless:

(base) root@04931f9c4e76:/# pip install more-itertools==5.0
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting more-itertools==5.0
  Downloading https://files.pythonhosted.org/packages/2f/9d/dcfe59e213093695f108508af1214cf9cd95cc5489e46877ec5cb56369e5/more_itertools-5.0.0-py2-none-any.whl (52kB)
     |████████████████████████████████| 61kB 2.3MB/s 
Requirement already satisfied: six<2.0.0,>=1.0.0 in /opt/conda/lib/python2.7/site-packages (from more-itertools==5.0) (1.12.0)
Installing collected packages: more-itertools
Successfully installed more-itertools-5.0.0
(base) root@04931f9c4e76:/# pip install pyhash
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pyhash
  Using cached https://files.pythonhosted.org/packages/f0/bf/4db9bed05d10824a17697f65063de19892ca2171a31a9c6854f9bbf55c02/pyhash-0.9.3.tar.gz
Building wheels for collected packages: pyhash
  Building wheel for pyhash (setup.py) ... done
  Created wheel for pyhash: filename=pyhash-0.9.3-cp27-cp27mu-linux_x86_64.whl size=2994264 sha256=47860d256742367073c2009f0e3345798df92b8840fa8e88b3a48a2d154ec9f1
  Stored in directory: /root/.cache/pip/wheels/0b/6d/31/936fd0c841c52f7afcb77290e2de18fd04d88325853787b36e
Successfully built pyhash
Installing collected packages: pyhash
Successfully installed pyhash-0.9.3
@twm
Copy link

twm commented Jan 17, 2020

I'm seeing the same issue over on ciena/afkak#110.

Analysis

The root of this is that a bunch of pyhash's transitive install-time (setup_requires) dependencies have dropped Python 2.7 support. The setup_requires mechanism basically installs stuff using setuptools easy_install, rather than Pip. easy_install doesn't know about Requires-Python (PEP 345), so it tries to install a bunch of packages in spite of this metadata.

It looks like the easiest way to fix this is to move away from pytest-runner. Its maintainers have deprecated it, essentially exactly for this reason. You'd start by deleting these lines:

pyfasthash/setup.py

Lines 238 to 239 in 5f81262

setup_requires=['pytest-runner', 'pytest-benchmark'],
tests_require=['pytest'],

The current Tox config installs these test dependencies:

pytest >= 4.6
pytest-benchmark >= 3.2
pytest-cov >= 2.7
codecov >= 2.0

That should work, but if you were still getting the wrong pytest version you can add an additional constraint like:

pytest <5.0; python_version<"3.0"

Another option is to ship Python 2.7 wheels for more platforms so that setup.py is never run. This is, admittedly, quite a lot of work. argon2-cffi is a fully worked example of this.

Workarounds

As a user of the library, we can work around these issues by ensuring that Python 2.7-compatible versions of these libraries are installed before pyhash. For example, you could add a Python 2.7-qualified dep in tox.ini:

[testenv]
deps =
    {py27,pypy}: pytest-runner
    {py27,pypy}: pytest-benchmark

Here's a real-world example: ciena/afkak@8c7bd8a

@sgrzemski
Copy link
Author

Whoa, nice analysis. Much appreciated, thanks!

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

No branches or pull requests

2 participants