hynek / argon2-cffi-bindings

Low-level Python CFFI Bindings for Argon2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

package will not install on python 3.6

hinoue opened this issue · comments

setuptools_scm 7.0.x, which was released last week, drops support of python 3.6
due to their use of annotations.

Because of this, argon2-cffi-bindings fails to install on python 3.6 because it will
use the latest version in their setup.

The workaround, I think, is to use --no-build-isolation, but a proper fix if 3.6 support
is desired is to pin setuptools_scm to the last 6.4 version (6.4.2).

I am not very sophisticated with the python packaging system so if there's some fix
I'm missing I apologize.

That doesn't seem right: setuptools_scm has had a python_requires marker since 7.0: https://github.com/pypa/setuptools_scm/blob/d57a5546d9c054e55972b475d5a346cbdd0c874a/setup.cfg#L34

For me it also works flawlessly. Could you paste your error please? But make sure to update pip beforehand.

FYI, I'm having the same problem pip installing on RHEL 8 using python 3.6.8. The error I get is:

 Downloading https://<local-pypi-proxy>/packages/argon2-cffi-bindings/21.2.0/argon2-cffi-bin
dings-21.2.0.tar.gz (1.8MB)
    100% |████████████████████████████████| 1.8MB 114.9MB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-hpcx_idc/argon2-cffi-bindings/setup.py", line 111, in <module>
        cffi_modules=CFFI_MODULES,
      File "/home/djpeaco/venv/lib64/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib64/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/djpeaco/venv/lib64/python3.6/site-packages/setuptools/dist.py", line 370, in __init__
        k: v for k, v in attrs.items()
      File "/usr/lib64/python3.6/distutils/dist.py", line 281, in __init__
        self.finalize_options()
      File "/home/djpeaco/venv/lib64/python3.6/site-packages/setuptools/dist.py", line 529, in finalize_options
        ep.load()(self, ep.name, value)
      File "/home/djpeaco/venv/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
        return self.resolve()
      File "/home/djpeaco/venv/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
      File "/tmp/pip-build-hpcx_idc/argon2-cffi-bindings/.eggs/setuptools_scm-7.0.5-py3.6.egg/setuptools_scm/__init__.py", line 5
        from __future__ import annotations
        ^
    SyntaxError: future feature annotations is not defined

That said, I don't know that this is a argon2-cffi-bindings problem. Your setup.py and pyproject.toml look fine to me. In my experiance, pip seems to frequently ignore python_requires, and tries to install packages that are incompatible with the version of python I am running. Doing pip install "setuptools_scm<7" before installing argon2-cffi-bindings works around the problem, and is just one of many packages that I've found that need this workaround.

Oops, I was running in a new venv in which I had forgotten to upgrade pip. Using the latest pip (21.3.1) like you recommend, it was able to resolve the python_requires correctly, no workaround required.

Yeah, I suspect that was the issue for OP too. Thanks for reaching back.