pycontribs / jira

Python Jira library. Development chat available on https://matrix.to/#/#pycontribs:matrix.org
https://jira.readthedocs.io
BSD 2-Clause "Simplified" License
1.94k stars 860 forks source link

Import requests and urllib3 has conflict #1655

Open Extpilot opened 1 year ago

Extpilot commented 1 year ago

Bug summary

According to requests project: https://github.com/psf/requests/issues/6443 There is a conflict with urllib3 2.0.2 and requests 1.30.0 This is causing import errors downstream when importing the Jira module

Is there an existing issue for this?

Jira Instance type

Jira Server or Data Center (Self-hosted)

Jira instance version

No response

jira-python version

3.4.1,3.5.0

Python Interpreter version

3.9.6

Which operating systems have you used?

Reproduction steps

# 1. Install latest urllib3 - pip install urllib3==2.0.2
# 2. Install latest requests - pip install requests==2.30.0
# 3. Install latest jira - pip install jira==3.5.0
# 4. Run python - python
# 5. Import jira - import jira

Stack trace

Python 3.9.6 (default, Oct 18 2022, 12:41:40)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import jira
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<>/.venv/lib/python3.9/site-packages/jira/__init__.py", line 9, in <module>
    from jira.client import (
  File "<>/.venv/lib/python3.9/site-packages/jira/client.py", line 46, in <module>
    import requests
  File "<>/.venv/lib/python3.9/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "<>/.venv/lib/python3.9/site-packages/urllib3/__init__.py", line 38, in <module>
    raise ImportError(
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3. See: https://github.com/urllib3/urllib3/issues/2168

Expected behaviour

Successfully import and utilize jira module

Additional Context

Happening in other environments such-as linux running a Jenkins pipeline to build a project that uses Jira module

Extpilot commented 1 year ago

Note: Force downgrade requests to 2.29.0 allows jira to import correctly.


(.venv) <>% pip install --force-reinstall -v requests==2.29.0
...
(.venv) <> % python
Python 3.9.6 (default, Oct 18 2022, 12:41:40)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import jira
>>>
studioj commented 1 year ago

@Extpilot thank you for reporting

Its a problem of dependencies, nothing much we can do. I'll leave the ticket open until its resolved in the requests package. (as mentioned above https://github.com/psf/requests/issues/6443) This way people encountering the same problem will be able to find a solution.