Skip to content

Replace maintenance-mode Gitdgethub with urllib3 - #192

Open
hugovk wants to merge 2 commits into
python:mainfrom
hugovk:rm-gidgethub
Open

hugovk wants to merge 2 commits into
python:mainfrom
hugovk:rm-gidgethub

Conversation

@hugovk

@hugovk hugovk commented Sep 15, 2026

Copy link
Copy Markdown
Member

Brett wrote:

On Labour Day, @mariatta and I decided to put Gidgethub into maintenance mode; we will accept bug reports but no feature requests, PRs only by us.

https://mastodon.social/@brettcannon/117271883065229398

No rush to remove it, but we're only using it here to create headers that are used in a single Requests post.

We can:

  1. Create the headers as a dict and drop Gidgethub
  2. Replace Requests (which is built on top of urllib3) with the lighter urllib3

Comment thread cherry_picker/cherry_picker.py Resolved

@Vizonex Vizonex left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to review this because removing a lot of dependencies seems to be the right move however there are some things I'm not as familiar with and have a couple of questions about. I do however understand the removal of gidgethub and requests on the other hand and I'm in favor of urllib3 as it's reqeusts's main dependency under the hood and having a more optimized approach seems reasonable.

@hugovk

hugovk commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

This PR also means we can start testing Python 3.16 already (see #202).

urllib3 is pure Python dependency, with no dependencies of its own. gidgethub depends on cffi which fails to build from source:

gidgethub==6.0.0
β”œβ”€β”€ PyJWT [required: >=2.4.0, installed: 2.15.1]
β”‚   └── cryptography [required: >=3.4.0, installed: 50.0.2, extra: crypto]
β”‚       └── cffi [required: >=2.0.0, installed: 2.1.1]
β”‚           └── pycparser [required: Any, installed: 3.12]
β”œβ”€β”€ typing_extensions [required: >=4.0.0, installed: 4.16.0]
└── uritemplate [required: >=3.0.1, installed: 4.2.0]
tox -e py316
❯ tox -e py316
.pkg: _optional_hooks> python /Library/Frameworks/Python.framework/Versions/3.15/lib/python3.15/site-packages/pyproject_api/_backend.py True hatchling.build
.pkg: get_requires_for_build_sdist> python /Library/Frameworks/Python.framework/Versions/3.15/lib/python3.15/site-packages/pyproject_api/_backend.py True hatchling.build
.pkg: build_sdist> python /Library/Frameworks/Python.framework/Versions/3.15/lib/python3.15/site-packages/pyproject_api/_backend.py True hatchling.build
py316: install_package_deps> /Library/Frameworks/Python.framework/Versions/3.15/bin/uv pip install gidgethub pytest pytest-cov requests stamina
Using Python 3.16.0a1 environment at: .tox/py316
Resolved 21 packages in 23ms
error: Failed to build `cffi==2.1.1`
  cause: The build backend returned an error
  cause: Call to `setuptools.build_meta.build_wheel` failed (exit status: 1)

         [stdout]
         running bdist_wheel
         running build
         running build_py
         running egg_info
         writing src/cffi.egg-info/PKG-INFO
         writing dependency_links to src/cffi.egg-info/dependency_links.txt
         writing entry points to src/cffi.egg-info/entry_points.txt
         writing requirements to src/cffi.egg-info/requires.txt
         writing top-level names to src/cffi.egg-info/top_level.txt
         reading manifest file 'src/cffi.egg-info/SOURCES.txt'
         reading manifest template 'MANIFEST.in'
         adding license file 'LICENSE'
         writing manifest file 'src/cffi.egg-info/SOURCES.txt'
         running build_ext
         building '_cffi_backend' extension
         clang -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-strict-overflow
         -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall
         -arch arm64 -arch x86_64 -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE
         -I/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/ffi
         -I/Users/hugo/.cache/uv/builds-v0/.tmpTfFcha/include
         -I/Library/Frameworks/Python.framework/Versions/3.16/include/python3.16
         -c src/c/_cffi_backend.c -o
         build/temp.macosx-10.15-universal2-cpython-316/src/c/_cffi_backend.o
         -iwithsysroot/usr/include/ffi

         [stderr]
         src/c/_cffi_backend.c:878:17: warning: '_PyLong_Sign' is deprecated
         [-Wdeprecated-declarations]
           878 |             if (_PyLong_Sign(ob) < 0)
               |                 ^
         /Library/Frameworks/Python.framework/Versions/3.16/include/python3.16/cpython/longobject.h:38:1:
         note: '_PyLong_Sign' has been explicitly marked deprecated here
            38 | Py_DEPRECATED(3.14) PyAPI_FUNC(int) _PyLong_Sign(PyObject *v);
               | ^
         /Library/Frameworks/Python.framework/Versions/3.16/include/python3.16/pyport.h:261:54:
         note: expanded from macro 'Py_DEPRECATED'
           261 | #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
               |                                                      ^
         src/c/_cffi_backend.c:3964:16: warning: '_PyLong_Sign' is deprecated
         [-Wdeprecated-declarations]
          3964 |         return _PyLong_Sign(ob) != 0;
               |                ^
         /Library/Frameworks/Python.framework/Versions/3.16/include/python3.16/cpython/longobject.h:38:1:
         note: '_PyLong_Sign' has been explicitly marked deprecated here
            38 | Py_DEPRECATED(3.14) PyAPI_FUNC(int) _PyLong_Sign(PyObject *v);
               | ^
         /Library/Frameworks/Python.framework/Versions/3.16/include/python3.16/pyport.h:261:54:
         note: expanded from macro 'Py_DEPRECATED'
           261 | #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
               |                                                      ^
         src/c/_cffi_backend.c:4522:22: error: use of undeclared identifier
         'Py_FileSystemDefaultEncoding'; did you mean 'PyUnicode_GetDefaultEncoding'?
          4522 |                      Py_FileSystemDefaultEncoding, &filename_or_null,
         &flags))
               |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
               |                      PyUnicode_GetDefaultEncoding
         /Library/Frameworks/Python.framework/Versions/3.16/include/python3.16/unicodeobject.h:326:25:
         note: 'PyUnicode_GetDefaultEncoding' declared here
           326 | PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void);
               |                         ^
         2 warnings and 1 error generated.
         error: Command ['clang', '-fno-omit-frame-pointer',
         '-mno-omit-leaf-frame-pointer', '-fno-strict-overflow',
         '-Wsign-compare', '-Wunreachable-code', '-fno-common', '-dynamic',
         '-DNDEBUG', '-g', '-O3', '-Wall', '-arch', 'arm64', '-arch', 'x86_64',
         '-DFFI_BUILDING=1', '-DUSE__THREAD', '-DHAVE_SYNC_SYNCHRONIZE',
         '-I/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/ffi',
         '-I/Users/hugo/.cache/uv/builds-v0/.tmpTfFcha/include',
         '-I/Library/Frameworks/Python.framework/Versions/3.16/include/python3.16',
         '-c', 'src/c/_cffi_backend.c', '-o',
         'build/temp.macosx-10.15-universal2-cpython-316/src/c/_cffi_backend.o',
         '-iwithsysroot/usr/include/ffi'] returned non-zero exit status 1.

hint: `cffi` (v2.1.1) was included because `gidgethub` (v6.0.0) depends on `pyjwt[crypto]` (v2.15.1) which depends on `cryptography` (v50.0.2) which depends on `cffi`

hint: Build failures usually indicate a problem with the package or the build environment
py316: exit 1 (1.57 seconds) /Users/hugo/github/cherry-picker> /Library/Frameworks/Python.framework/Versions/3.15/bin/uv pip install gidgethub pytest pytest-cov requests stamina pid=48097
.pkg: _exit> python /Library/Frameworks/Python.framework/Versions/3.15/lib/python3.15/site-packages/pyproject_api/_backend.py True hatchling.build
  py316: FAIL code 1 (1.78 seconds)
  evaluation failed :( (1.87 seconds)

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

Successfully merging this pull request may close these issues.

2 participants