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

Fresh installs print warning due to requests vs chardet 5.0.0 incompatibility #1745

Closed
jepler opened this issue Jun 27, 2022 · 3 comments
Closed

Comments

@jepler
Copy link

jepler commented Jun 27, 2022

Description:

We test our cookiecutter with a pytest. Since the release of chardet 5.0.0, which requests 2.0.12 treats as incompatible, this produces a (caught) AssertionError and a runtime warning, both of which are treated as failures by pytest. There has been an issue opened to support chardet 5.0.0 in cookiecutter but no maintainer activity has occurred there yet: psf/requests#6177

While this has a severe impact on us (causes our Actions runs to all fail), for most users of cookiecutter this only causes the warning to be printed each time cookiecutter is run.

Most likely we'll be taking steps to ensure chardet<5 is installed during our CI process. I'm honestly not sure what would be constructive for cookiecutter to do about this, but I wanted to file this issue anyway for others who may encounter the warning, especially in a context that turns it into an error like ours does.

What I've run:

$ pip install cookiecutter
$ cookiecutter --version
/tmp/_envcc/lib/python3.9/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version!
  warnings.warn(
Cookiecutter 2.1.1 from /tmp/_envcc/lib/python3.9/site-packages (Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110])

also

$ python3 -mpytest
============================= test session starts ==============================
platform linux -- Python 3.9.2, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/jepler/src/cookiecutter-adafruit-circuitpython, configfile: pytest.ini
collected 0 items / 1 error                                                    

==================================== ERRORS ====================================
_________________ ERROR collecting tests/test_make_cookies.py __________________
/tmp/_envcc/lib/python3.9/site-packages/requests/__init__.py:105: in <module>
    check_compatibility(
/tmp/_envcc/lib/python3.9/site-packages/requests/__init__.py:79: in check_compatibility
    assert (3, 0, 2) <= (major, minor, patch) < (5, 0, 0)
E   AssertionError

During handling of the above exception, another exception occurred:
tests/test_make_cookies.py:11: in <module>
    from cookiecutter.main import cookiecutter
/tmp/_envcc/lib/python3.9/site-packages/cookiecutter/main.py:17: in <module>
    from cookiecutter.repository import determine_repo_dir
/tmp/_envcc/lib/python3.9/site-packages/cookiecutter/repository.py:7: in <module>
    from cookiecutter.zipfile import unzip
/tmp/_envcc/lib/python3.9/site-packages/cookiecutter/zipfile.py:6: in <module>
    import requests
/tmp/_envcc/lib/python3.9/site-packages/requests/__init__.py:109: in <module>
    warnings.warn(
E   requests.exceptions.RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version!
=========================== short test summary info ============================
ERROR tests/test_make_cookies.py - requests.exceptions.RequestsDependencyWarn...
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.15s ===============================
@Toshiro00
Copy link

'pip3 install --upgrade requests' worked for me.

@jepler
Copy link
Author

jepler commented Jul 2, 2022

yay! I think you're right.

@jepler jepler closed this as completed Jul 2, 2022
@SocialEngineer2
Copy link

'pip3 install --upgrade requests' сработало для меня.

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

3 participants