feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# Restrict all files related to deploying to
# require lead maintainer approval.
.github/workflows/ @sethmlarson @pquentin @shazow @illia-v
.github/CODEOWNERS @sethmlarson @pquentin @shazow @illia-v
src/urllib3/_version.py @sethmlarson @pquentin @shazow @illia-v
pyproject.toml @sethmlarson @pquentin @shazow @illia-v
ci/ @sethmlarson @pquentin @shazow @illia-v

View File

@@ -0,0 +1,3 @@
tidelift: pypi/urllib3
github: urllib3
open_collective: urllib3

View File

@@ -0,0 +1,26 @@
---
name: 🎁 Feature Request
about: Suggest a new feature
---
### Context
What are you trying to do?
How do you expect to do it?
Is it something you currently cannot do?
Is this related to an existing issue/problem?
### Alternatives
Can you achieve the same result doing it in an alternative way?
Is the alternative considerable?
### Duplicate
Has the feature been requested before?
If so, please provide a link to the issue.
### Contribution
Would you be willing to submit a PR?
_(Help can be provided if you need assistance submitting a PR)_

View File

@@ -0,0 +1,37 @@
---
name: 🐞 Bug Report
about: Something is broken
---
### Subject
Describe the issue here.
### Environment
Describe your environment.
At least, paste here the output of:
```python
import platform
import ssl
import urllib3
print("OS", platform.platform())
print("Python", platform.python_version())
print(ssl.OPENSSL_VERSION)
print("urllib3", urllib3.__version__)
```
### Steps to Reproduce
A simple and isolated way to reproduce the issue. A code snippet would be great.
### Expected Behavior
What should happen.
### Actual Behavior
What happens instead.
You may attach logs, packet captures, etc.

View File

@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: 📚 Documentation
url: https://urllib3.readthedocs.io
about: Make sure you read the relevant docs
- name: ❓ Ask on StackOverflow
url: https://stackoverflow.com/questions/tagged/urllib3
about: Ask questions about usage in StackOverflow
- name: 💬 Ask the Community
url: https://discord.gg/CHEgCZN
about: Join urllib3's Discord server

View File

@@ -0,0 +1,8 @@
<!---
Thanks for your contribution! ♥️
If this is your first PR to urllib3 please review the Contributing Guide:
https://urllib3.readthedocs.io/en/latest/contributing.html
Adhering to the Contributing Guide means we can review, merge, and release your change faster! :)
--->

View File

@@ -0,0 +1,22 @@
* [ ] See if all tests, including downstream, pass
* [ ] Get the release pull request approved by a [CODEOWNER](https://github.com/urllib3/urllib3/blob/main/.github/CODEOWNERS)
* [ ] Squash merge the release pull request with message "`Release <VERSION>`"
* [ ] Tag with X.Y.Z, push tag on urllib3/urllib3 (not on your fork, update `<REMOTE>` accordingly)
* Notice that the `<VERSION>` shouldn't have a `v` prefix (Use `1.26.6` instead of `v.1.26.6`)
* ```
# Ensure the release commit is the latest in the main branch.
git checkout main
git pull origin main
git tag -s -a '<VERSION>' -m 'Release: <VERSION>'
git push <REMOTE> --tags
```
* [ ] Execute the `publish` GitHub workflow. This requires a review from a maintainer.
* [ ] Ensure that all expected artifacts are added to the new GitHub release. Should
be one `.whl`, one `.tar.gz`, and one `multiple.intoto.jsonl`. Update the GitHub
release to have the content of the release's changelog.
* [ ] Announce on:
* [ ] Twitter
* [ ] Discord
* [ ] OpenCollective
* [ ] Update Tidelift metadata
* [ ] If this was a 1.26.x release, add changelog to the `main` branch

View File

@@ -0,0 +1,4 @@
# Security Disclosures
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure with maintainers.

View File

@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
- "github_actions"
- "Skip Changelog"
ignore:
# Ignore all patch releases as we can manually
# upgrade if we run into a bug and need a fix.
- dependency-name: "*"
update-types: ["version-update:semver-patch"]

View File

@@ -0,0 +1,28 @@
name: Check
on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]
permissions: "read-all"
jobs:
check-changelog-entry:
name: changelog entry
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
# `towncrier check` runs `git diff --name-only origin/main...`, which
# needs a non-shallow clone.
fetch-depth: 0
- name: "Check changelog"
if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')"
run: |
if ! pipx run towncrier check --compare-with origin/${{ github.base_ref }}; then
echo "Please see https://github.com/urllib3/urllib3/blob/main/changelog/README.rst for guidance."
false
fi

View File

@@ -0,0 +1,171 @@
name: CI
on: [push, pull_request, workflow_dispatch]
permissions: "read-all"
defaults:
run:
shell: bash
jobs:
package:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "Checkout repository"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: "Setup Python"
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.x"
cache: "pip"
- name: "Check packages"
run: |
python -m pip install -U pip setuptools wheel build twine rstcheck
python -m build
rstcheck CHANGES.rst
python -m twine check dist/*
test:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
os:
- macos-12
- windows-latest
- ubuntu-22.04
nox-session: ['']
include:
- experimental: false
# integration
# 3.8 and 3.9 have a known issue with large SSL requests that we work around:
# https://github.com/urllib3/urllib3/pull/3181#issuecomment-1794830698
- python-version: "3.8"
os: ubuntu-latest
experimental: false
nox-session: test_integration
- python-version: "3.9"
os: ubuntu-latest
experimental: false
nox-session: test_integration
- python-version: "3.12"
os: ubuntu-latest
experimental: false
nox-session: test_integration
# OpenSSL 1.1.1
- python-version: "3.8"
os: ubuntu-20.04
experimental: false
nox-session: test-3.8
# pypy
- python-version: "pypy-3.8"
os: ubuntu-latest
experimental: false
nox-session: test-pypy3.8
- python-version: "pypy-3.9-v7.3.13"
os: ubuntu-latest
experimental: false
nox-session: test-pypy3.9
- python-version: "pypy-3.10"
os: ubuntu-latest
experimental: false
nox-session: test-pypy3.10
- python-version: "3.x"
# brotli
os: ubuntu-latest
experimental: false
nox-session: test_brotlipy
# Test CPython with a broken hostname_checks_common_name (the fix is in 3.9.3)
- python-version: "3.9.2"
os: ubuntu-20.04 # CPython 3.9.2 is not available for ubuntu-22.04.
experimental: false
nox-session: test-3.9
- python-version: "3.11"
os: ubuntu-latest
nox-session: emscripten
experimental: true
- python-version: "3.13"
experimental: true
exclude:
# Ubuntu 22.04 comes with OpenSSL 3.0, so only CPython 3.9+ is compatible with it
# https://github.com/python/cpython/issues/83001
- python-version: "3.8"
os: ubuntu-22.04
runs-on: ${{ matrix.os }}
name: ${{ fromJson('{"macos-12":"macOS","windows-latest":"Windows","ubuntu-latest":"Ubuntu","ubuntu-20.04":"Ubuntu 20.04 (OpenSSL 1.1.1)","ubuntu-22.04":"Ubuntu 22.04 (OpenSSL 3.0)"}')[matrix.os] }} ${{ matrix.python-version }} ${{ matrix.nox-session}}
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 30
steps:
- name: "Checkout repository"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: "Setup Python ${{ matrix.python-version }}"
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: "Install dependencies"
run: python -m pip install --upgrade pip setuptools nox
- name: "Install Chrome"
uses: browser-actions/setup-chrome@db1b524c26f20a8d1a10f7fc385c92387e2d0477 # v1.7.1
if: ${{ matrix.nox-session == 'emscripten' }}
- name: "Install Firefox"
uses: browser-actions/setup-firefox@233224b712fc07910ded8c15fb95a555c86da76f # v1.5.0
if: ${{ matrix.nox-session == 'emscripten' }}
- name: "Run tests"
# If no explicit NOX_SESSION is set, run the default tests for the chosen Python version
run: nox -s ${NOX_SESSION:-test-$PYTHON_VERSION}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
NOX_SESSION: ${{ matrix.nox-session }}
- name: "Upload coverage data"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: coverage-data-${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.experimental }}-${{ matrix.nox-session }}
path: ".coverage.*"
if-no-files-found: error
coverage:
if: always()
runs-on: "ubuntu-latest"
needs: test
steps:
- name: "Checkout repository"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: "Setup Python"
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.x"
- name: "Install coverage"
run: "python -m pip install -r dev-requirements.txt"
- name: "Download coverage data"
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
pattern: coverage-data-*
merge-multiple: true
- name: "Combine & check coverage"
run: |
python -m coverage combine
python -m coverage html --skip-covered --skip-empty
python -m coverage report --ignore-errors --show-missing --fail-under=100
- if: ${{ failure() }}
name: "Upload report if check failed"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: coverage-report
path: htmlcov

View File

@@ -0,0 +1,37 @@
name: "CodeQL"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "0 0 * * 5"
workflow_dispatch:
permissions: "read-all"
jobs:
analyze:
if: github.repository_owner == 'urllib3'
name: "Analyze"
runs-on: "ubuntu-latest"
permissions:
actions: read
contents: read
security-events: write
steps:
- name: "Checkout repository"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: "Run CodeQL init"
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
with:
config-file: "./.github/codeql.yml"
languages: "python"
- name: "Run CodeQL autobuild"
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
- name: "Run CodeQL analyze"
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6

View File

@@ -0,0 +1,29 @@
name: Downstream
on: [push, pull_request, workflow_dispatch]
permissions: "read-all"
jobs:
downstream:
strategy:
fail-fast: false
matrix:
downstream: [botocore, requests]
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: "Checkout repository"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: "Setup Python"
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.x"
- name: "Install dependencies"
run: python -m pip install --upgrade nox
- name: "Run downstream tests"
run: nox -s downstream_${{ matrix.downstream }}

View File

@@ -0,0 +1,29 @@
name: lint
on: [push, pull_request, workflow_dispatch]
permissions: "read-all"
jobs:
lint:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- name: "Checkout repository"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: "Setup Python"
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.x"
cache: pip
- name: "Run pre-commit"
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0
- name: "Install dependencies"
run: python -m pip install nox
- name: "Run mypy"
run: nox -s mypy

View File

@@ -0,0 +1,85 @@
name: Publish to PyPI
on:
push:
tags:
- "*"
permissions:
contents: read
jobs:
build:
name: "Build dists"
runs-on: "ubuntu-latest"
environment:
name: "publish"
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
steps:
- name: "Checkout repository"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: "Setup Python"
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.x"
- name: "Install dependencies"
run: python -m pip install build==0.8.0
- name: "Build dists"
run: |
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) \
python -m build
- name: "Generate hashes"
id: hash
run: |
cd dist && echo "hashes=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
- name: "Upload dists"
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: "dist"
path: "dist/"
if-no-files-found: error
retention-days: 5
provenance:
needs: [build]
permissions:
actions: read
contents: write
id-token: write # Needed to access the workflow's OIDC identity.
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0
with:
base64-subjects: "${{ needs.build.outputs.hashes }}"
upload-assets: true
compile-generator: true # Workaround for https://github.com/slsa-framework/slsa-github-generator/issues/1163
publish:
name: "Publish"
if: startsWith(github.ref, 'refs/tags/')
needs: ["build", "provenance"]
permissions:
contents: write
id-token: write # Needed for trusted publishing to PyPI.
runs-on: "ubuntu-latest"
steps:
- name: "Download dists"
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: "dist"
path: "dist/"
- name: "Upload dists to GitHub Release"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
gh release upload ${{ github.ref_name }} dist/* --repo ${{ github.repository }}
- name: "Publish dists to PyPI"
uses: pypa/gh-action-pypi-publish@f8c70e705ffc13c3b4d1221169b84f12a75d6ca8 # v1.8.8

View File

@@ -0,0 +1,34 @@
name: "Scorecard"
on:
branch_protection_rule:
schedule:
- cron: "0 0 * * 0"
push:
branches: ["main", "1.26.x"]
permissions: read-all
jobs:
analysis:
if: github.repository_owner == 'urllib3'
name: "Scorecard"
runs-on: "ubuntu-latest"
permissions:
security-events: write
id-token: write
contents: read
actions: read
steps:
- name: "Checkout repository"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
persist-credentials: false
- name: "Run Scorecard"
uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0
with:
results_file: results.sarif
results_format: sarif
repo_token: ${{ secrets.SCORECARD_TOKEN }}
publish_results: true