vlaci / openconnect-sso

Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs
GNU General Public License v3.0
280 stars 119 forks source link

openconnect-sso 0.6.2 requires structlog<21.0,>=20.1, but you have structlog 21.1.0 which is incompatible. #42

Closed mdbosworth closed 3 years ago

mdbosworth commented 3 years ago

I tried going back to stuctlog-20.1, this threw another error. I thought it be good to post this as an issue.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/openconnect-sso", line 33, in <module>
    sys.exit(load_entry_point('openconnect-sso==0.6.2', 'console_scripts', 'openconnect-sso')())
  File "/usr/bin/openconnect-sso", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/openconnect_sso/cli.py", line 10, in <module>
    from openconnect_sso import app, config, __version__
  File "/usr/lib/python3.9/site-packages/openconnect_sso/app.py", line 16, in <module>
    from openconnect_sso.authenticator import Authenticator, AuthResponseError
  File "/usr/lib/python3.9/site-packages/openconnect_sso/authenticator.py", line 6, in <module>
    from openconnect_sso.saml_authenticator import authenticate_in_browser
  File "/usr/lib/python3.9/site-packages/openconnect_sso/saml_authenticator.py", line 3, in <module>
    from openconnect_sso.browser import Browser
  File "/usr/lib/python3.9/site-packages/openconnect_sso/browser/__init__.py", line 1, in <module>
    from .browser import Browser, DisplayMode, Terminated
  File "/usr/lib/python3.9/site-packages/openconnect_sso/browser/browser.py", line 5, in <module>
    from . import webengine_process as web
  File "/usr/lib/python3.9/site-packages/openconnect_sso/browser/webengine_process.py", line 9, in <module>
    import pkg_resources
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 570, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'structlog<21.0,>=20.1' distribution was not found and is required by openconnect-sso
joonne commented 3 years ago

Works for me with pip install structlog==20.2.0. I'm running archlinux with 5.10.16-arch1-1 kernel. If I had used the pipx way of installing instead of the archlinux aur package, maybe this issue would not have happened in the first place? :thinking:

Thanks to the team, openconnect-sso has really made my life easier the past few weeks :muscle:

MrAnno commented 3 years ago

pipx creates an isolated environment for openconnect-sso, so it won't break due to changing system dependencies.

The AUR package, however, depends on Python packages that are coming from the official repositories of Arch Linux (for example, https://archlinux.org/packages/community/any/python-structlog/), so it might break after a system upgrade. I'm trying my best to keep the AUR package up-to-date.

vlaci commented 3 years ago

We could maybe relax version constraints on the dependencies and do an automated dependency update if tests pass :thinking:

vlaci commented 3 years ago

Fixed by #44

MrAnno commented 3 years ago

@vlaci That sounds awesome.

idealo-ricardo-band commented 2 years ago

I'm getting errors again on arch linux. Would it be possible to change the dependency from:

structlog<21.2.0,>=20.1

to something like:

structlog>=20.1

From the other tickets it says that the version is just date based and not semantic so a rule to stop an update to the 22 version that will come out in a few months isn't really needed imho.

I fixed my setup for now by downgrading python-structlog to 21.1.0-1 but it would be nice to be able to keep track with arch updates.