Skip to content

enum34 dependency causes issues in some environments #66

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

Closed
echarrod opened this issue Jun 18, 2020 · 1 comment
Closed

enum34 dependency causes issues in some environments #66

echarrod opened this issue Jun 18, 2020 · 1 comment

Comments

@echarrod
Copy link

echarrod commented Jun 18, 2020

File "/usr/local/lib/python3.7/re.py", line 143, in <module>
  class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

See:

This happened with this setup.py:

# -*- coding: utf-8 -*-
from setuptools import find_packages
from setuptools import setup

version = {}
with open("yoti_python_sdk/version.py") as fp:
    exec(fp.read(), version)

setup(
    name="yoti",
    version=version["__version__"],
    packages=find_packages(include=["yoti_python_sdk", "yoti_python_sdk.*"]),
    license="MIT",
    description="The Yoti Python SDK, providing API support for Login, Verify (2FA) and Age Verification.",
    long_description=open("README.md").read(),
    long_description_content_type="text/markdown",
    url="https://github.com/getyoti/yoti-python-sdk",
    author="Yoti",
    author_email="[email protected]",
    install_requires=[
        "deprecated==1.2.10",
        "cryptography>=2.2.1",
        "protobuf>=3.1.0",
        "requests>=2.11.1",
        "future>=0.11.0",
        "asn1==2.3.1",
        "pyopenssl>=18.0.0",
        "iso8601==0.1.12",
    ],
    extras_require={
        "examples": [
            "Django>=3.0.7",
            "Flask>=1.0.4",
            "python-dotenv>=0.7.1",
            "django-sslserver>=0.22.0",
            "Werkzeug==1.0.1",
        ],
        "dev": [
            "pre-commit==1.17.0",
            "pytest>=4.6.0",
            "pytest-cov>=2.7.1",
            "pylint==1.9.4",
            "pylint-exit>=1.1.0",
            "python-coveralls==2.9.3",
            "coverage==4.5.4",
            "mock==2.0.0",
            "virtualenv==20.0.13",
        ],
    },
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Intended Audience :: Developers",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Topic :: Software Development :: Libraries :: Python Modules",
    ],
    keywords="yoti sdk 2FA multifactor authentication verification identity login register verify 2Factor",
)

and this requirements.txt:

asn1==2.3.1               # via -r requirements.in
certifi==2018.11.29       # via requests
cffi==1.14.0              # via -r requirements.in, cryptography
chardet==3.0.4            # via requests
cryptography==2.8         # via -r requirements.in, pyopenssl
deprecated==1.2.10        # via -r requirements.in
enum34==1.1.10            # via asn1
future==0.18.2            # via -r requirements.in
idna==2.7                 # via requests
iso8601==0.1.12           # via -r requirements.in
itsdangerous==0.24        # via -r requirements.in
pbr==1.10.0               # via -r requirements.in
protobuf==3.12.2          # via -r requirements.in
pycparser==2.18           # via cffi
pyopenssl==19.1.0         # via -r requirements.in
pytz==2020.1              # via -r requirements.in
pyyaml==5.2               # via -r requirements.in
requests==2.21.0          # via -r requirements.in
six==1.10.0               # via cryptography, protobuf, pyopenssl
urllib3==1.24.3           # via -r requirements.in, requests
wheel==0.33.6             # via -r requirements.in
wrapt==1.11.2             # via deprecated

and doing:

apk add -U --no-cache gcc build-base linux-headers ca-certificates python3-dev libffi-dev libressl-dev libxslt-dev
pip install -r requirements.txt
pip install -e .[dev]

From Python 3.6, 3.7 & 3.8 alpine images from DockerHub

I've tried the other suggestions in those two posts (unsetting pythonpath, using enum-compat etc.) , with the only remaining option to be to downgrade to asn1 2.2.0. Is it possible to fix this in the asn1 package so that other people won't have to encounter this?

@echarrod
Copy link
Author

Similar issue here - robshakir/pyangbind#232

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

1 participant