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

Update from benjaminp/six@master #8

Open
wants to merge 55 commits into
base: master
Choose a base branch
from

Conversation

evandrocoan
Copy link
Member

The upstream repository benjaminp/six@master has some new changes that aren't in this fork. So, here they are, ready to be merged!

This Pull Request was created programmatically by the githubpullrequests.

catleeball and others added 30 commits January 19, 2019 09:57
Small update to the `ensure_str` function's documentation formatting to
match `ensure_binary` and `ensure_text`'s formatting.
There was `six.io` if and only if py3, which was error-prone.
We are obliged to use a very old version that supports Python 3.2.
This reverts commit d5efa74.

The original intention of providing a distutils fallback has not gone
away. These three extra lines will almost never be used, as most people
have setuptools or install with pip anyway, and at the same time it
serves as a very low-maintenance solution for people who *do* want to
bootstrap setuptools.

Bootstrapping setuptools without vendored six (and pyparsing) is a valid
use case. Although setuptools by default ships with vendored
dependencies, it supports removing the contents of the _vendored/
directory and falling back to an installed version of six.py -- and
thirdparty vendors of setuptools, such as Arch Linux and OpenSUSE,
actually make use of this and need to be able to bootstrap the
dependency tree of setuptools itself.
- Add Python 3.8.
- Unpin pypy2.7 and pypy3.
This is pretty-much a straight backport of Py3 implementations of update_wrapper and (privately) wraps.

Fixes #250 
Fixes #165

Co-authored-by: Benjamin Peterson <[email protected]>
Fixes #308.

Stops testing them on the CI, update python_requries and remove some code specifically for those versions.

Not done anything to remove any six functionality that's only a benefit on those versions, that should be in a separate PR and would be a breaking change that should ideally deprecate first.
Fixes #288.

Co-authored-by: Benjamin Peterson <[email protected]>
benjaminp and others added 18 commits January 14, 2020 18:44
Co-authored-by: Benjamin Peterson <[email protected]>
We found that large applications that have undergone a 2 -> 3 migration
and wound up with a lot of six.ensure_str and six.ensure_binary calls
could save 1-2% CPU usage by optimizing these for the common case.

Further optimization could be done by replacing them with extension
module implementations - assumed out of scope for the pure Python six
project itself.

Ideally all of these calls and use of six in people's code would be
removed after there all need for any Python 2 compatibility is gone.
But completing that kind of type cleanup requires a lot of human
engineering time.  This lowers the ongoing costs in the interim.

Contributed by YouTube.
cristianMeli and others added 3 commits November 21, 2021 12:57
instances of UserDict.UserDict are not iterable
but instances of collections.UserDict are iterable
benjaminp and others added 4 commits July 26, 2022 14:04
…lib.request (#388)

python/cpython#84850

> Remove URLopener and FancyURLopener classes from urllib.request.
> They had previously raised DeprecationWarning since Python 3.3.

The test failures were:

    __________________ test_move_items_urllib_request[URLopener] ___________________

    item_name = 'URLopener'

        @pytest.mark.parametrize("item_name",
                                  [item.name for item in six._urllib_request_moved_attributes])
        def test_move_items_urllib_request(item_name):
            """Ensure that everything loads correctly."""
            assert item_name in dir(six.moves.urllib.request)
    >       getattr(six.moves.urllib.request, item_name)
    E       AttributeError: module 'six.moves.urllib.request' has no attribute 'URLopener'

    test_six.py:170: AttributeError
    ________________ test_move_items_urllib_request[FancyURLopener] ________________

    item_name = 'FancyURLopener'

        @pytest.mark.parametrize("item_name",
                                  [item.name for item in six._urllib_request_moved_attributes])
        def test_move_items_urllib_request(item_name):
            """Ensure that everything loads correctly."""
            assert item_name in dir(six.moves.urllib.request)
    >       getattr(six.moves.urllib.request, item_name)
    E       AttributeError: module 'six.moves.urllib.request' has no attribute 'FancyURLopener'

    test_six.py:170: AttributeError
@benjaminp benjaminp deleted the branch evandroforks:master December 1, 2024 22:01
@benjaminp benjaminp deleted the master branch December 1, 2024 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.