Files
certbot-certbot/tools/pinning/oldest/pyproject.toml
c8ebcb49bd Migrate certbot-dns-cloudflare to cloudflare 4.x SDK (#10587)
## Summary

- Migrate `certbot-dns-cloudflare` from the archived `python-cloudflare`
2.x library (`import CloudFlare`) to the actively maintained Cloudflare
Python SDK 4.x (`import cloudflare`)
- Update all API calls to the new SDK surface:
`dns.records.create/list/delete`, `zones.list`, typed response objects
instead of dicts
- Replace `CloudFlare.exceptions.CloudFlareAPIError` with
`cloudflare.APIStatusError` and extract CF error codes from
`response.json()`
- Bump dependency from `cloudflare>=2.19, <2.20` to `cloudflare>=4.0`
- Update oldest pinning from `cloudflare 2.19` to `4.0.0`
- Update all test mocks and assertions accordingly

Fixes #9938

## API Migration

| Operation | Old 2.x | New 4.x |
|---|---|---|
| Import | `import CloudFlare` | `import cloudflare` |
| Client (token) | `CloudFlare.CloudFlare(token=t)` |
`cloudflare.Cloudflare(api_token=t)` |
| Client (key) | `CloudFlare.CloudFlare(email, key)` |
`cloudflare.Cloudflare(api_email=e, api_key=k)` |
| List zones | `cf.zones.get(params={...})` → `list[dict]` |
`cf.zones.list(name=n)` → iterable of Zone objects |
| Create record | `cf.zones.dns_records.post(zone_id, data={...})` |
`cf.dns.records.create(zone_id=id, **data)` |
| List records | `cf.zones.dns_records.get(zone_id, params={...})` |
`cf.dns.records.list(zone_id=id, type=..., ...)` |
| Delete record | `cf.zones.dns_records.delete(zone_id, record_id)` |
`cf.dns.records.delete(dns_record_id=rid, zone_id=zid)` |
| Exceptions | `CloudFlare.exceptions.CloudFlareAPIError` |
`cloudflare.APIStatusError` |

## Test plan

- [x] All 20 existing tests pass with updated mocks
- [x] Credentials INI file format is unchanged — no user-facing config
changes
- [x] Live dry-run renewal tested successfully across 5 domains

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Ember <BeigeBox@users.noreply.github.com>
Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2026-05-06 09:35:38 -07:00

113 lines
4.1 KiB
TOML

# The purpose of this file is to help us test Certbot against the oldest
# versions of our dependencies which we claim to support in our setup.py files.
#
# Security alerts about vulnerable packages in this file can be ignored since
# they are only used during testing.
#
# Ideally, generating package pinnings based on our minimum allowed dependency
# versions would be done automatically by tooling, but as of writing this, both
# https://github.com/pypa/pip/issues/8085 and
# https://github.com/python-poetry/poetry/issues/3527 remain unresolved.
[tool.poetry]
name = "certbot-pinner"
version = "0.1.0"
description = "A simple project for pinning Certbot's dependencies using Poetry."
authors = ["Certbot Project"]
license = "Apache License 2.0"
[tool.poetry.dependencies]
# The Python version here should be kept in sync with the one used in our
# oldest tests in tox.ini.
python = "<3.11,>=3.10"
# Local dependencies
# Any local packages that have dependencies on other local packages must be
# listed below before the package it depends on. For instance, certbot depends
# on acme so certbot must be listed before acme.
certbot-ci = {path = "../../../certbot-ci"}
certbot-dns-cloudflare = {path = "../../../certbot-dns-cloudflare"}
certbot-dns-digitalocean = {path = "../../../certbot-dns-digitalocean"}
certbot-dns-dnsimple = {path = "../../../certbot-dns-dnsimple"}
certbot-dns-dnsmadeeasy = {path = "../../../certbot-dns-dnsmadeeasy"}
certbot-dns-gehirn = {path = "../../../certbot-dns-gehirn"}
certbot-dns-google = {path = "../../../certbot-dns-google"}
certbot-dns-linode = {path = "../../../certbot-dns-linode"}
certbot-dns-luadns = {path = "../../../certbot-dns-luadns"}
certbot-dns-nsone = {path = "../../../certbot-dns-nsone"}
certbot-dns-ovh = {path = "../../../certbot-dns-ovh"}
certbot-dns-rfc2136 = {path = "../../../certbot-dns-rfc2136"}
certbot-dns-route53 = {path = "../../../certbot-dns-route53"}
certbot-dns-sakuracloud = {path = "../../../certbot-dns-sakuracloud"}
certbot-nginx = {path = "../../../certbot-nginx"}
certbot-apache = {path = "../../../certbot-apache"}
certbot = {path = "../../../certbot", extras = ["test"]}
acme = {path = "../../../acme", extras = ["test"]}
# Oldest dependencies
# We specify the oldest versions of our dependencies that we keep support for
# below. These dependencies can be updated as desired to simplify or improve
# Certbot or its development. If the dependency being updated is a direct
# dependency of one of our own packages, the minimum required version of that
# dependency should be updated in our setup.py files as well to communicate
# this information to our users.
ConfigArgParse = "1.5.3"
apacheconfig = "0.3.2"
asn1crypto = "0.24.0"
# we were already ignoring debian 11 for our boto* versions; this uses the versions from ubuntu 22
boto3 = "1.20.34"
botocore = "1.23.34"
cffi = "1.14.1"
chardet = "3.0.4"
cloudflare = "4.0.0"
configobj = "5.0.6"
cryptography = "43.0.0"
distro = "1.7.0"
dns-lexicon = "3.15.1"
dnspython = "2.6.1"
funcsigs = "0.4"
google-api-python-client = "1.6.5"
google-auth = "2.16.0"
httplib2 = "0.9.2"
idna = "2.8"
ipaddress = "1.0.16"
ndg-httpsclient = "0.3.2"
parsedatetime = "2.6"
pbr = "1.8.0"
ply = "3.4"
pyOpenSSL = "25.0.0"
pyRFC3339 = "1.0"
pyasn1 = "0.4.8"
pycparser = "2.14"
pyparsing = "3.0.0"
python-augeas = "0.5.0"
python-digitalocean = "1.15.0"
requests = "2.25.1"
six = "1.16.0"
urllib3 = "1.26.5"
# Build dependencies
# Since there doesn't appear to
# doesn't appear to be a good way to automatically track down and pin build
# dependencies in Python (see
# https://discuss.python.org/t/how-to-pin-build-dependencies/8238), we list any
# build dependencies here to ensure they're pinned for extra stability.
# cython is a build dependency of pyyaml
#
#
# As of pyyaml 6.0.2, cython >= 3.0 is required for py >= 3.13, and < 3.0 for py < 3.13.
# See https://github.com/yaml/pyyaml/pull/808/files.
cython = [
{ version = "<3.0", python = "<3.13" },
{ version = ">=3.0", python = ">=3.13" }
]
# Other dependencies
# We add any dependencies that must be specified in this file for any another
# reason below.
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"