Repository navigation
fix: install Poetry with pipx and bump psycopg2-binary and oauthlib - #149
Conversation
Every job that installs Poetry through snok/install-poetry fails with HTTP 403. The action downloads https://install.python-poetry.org/ with Python's urllib, and the Cloudflare front of that host now rejects the Python-urllib User-Agent with error 1010. The action's latest release makes the same request, so bumping it does not help. Poetry is installed from PyPI with the runner's preinstalled pipx instead, as dockerfiles/test.Dockerfile already does. The settings the action applied are already set by the workflow-level POETRY_* env vars. The runner image points pipx at /opt, so the two jobs that cache ~/.local for their Poetry install redirect pipx there; otherwise the cache would save nothing and a later cache hit would leave poetry missing.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
📦 Python package built successfully!
|
|
🚀 Review App Deployment Started
|
psycopg2-binary 2.9.12 and 2.9.13 fix an infinite loop on a malformed interval and the parsing of malformed bytea and int64-array input. No advisory is published for them yet; the floor is raised the way past audit fixes raise one. 2.9.13 requires Python 3.10 and ships wheels for 3.10 to 3.14, so the per-Python split, which existed only because 2.9.10 was the first release with 3.13 wheels, collapses into one constraint with the newer line's <3 ceiling, as was done for pymongo and pylint. Only the psycopg2-binary block and content-hash were spliced into the lock.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #149 +/- ##
=======================================
Coverage 78.43% 78.43%
=======================================
Files 121 121
Lines 6920 6920
Branches 1005 1005
=======================================
Hits 5428 5428
Misses 1182 1182
Partials 310 310
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
CVE-2026-49272 (GHSA-3jp2-3mrg-2vxc) was revised on 2026-11-05 to name 4.0.1 as its fix, so pip-audit fails Production and Server on 4.0.0. 4.0.1 changes only the server-side device flow; databricks-sql-connector, the only consumer, uses oauthlib as a client and allows <5. The floor in the transitive security block is raised in place, as for pyasn1. Only the oauthlib block and content-hash were spliced into the lock.
Makes CI green again. This PR does three things:
pipxinstead ofsnok/install-poetry, whose download frominstall.python-poetry.orgis now blocked with HTTP 403.1. Install Poetry with pipx
Why it broke
snok/install-poetrydownloads the installer fromhttps://install.python-poetry.org/with Python'surllib, which sends the defaultPython-urllib/3.xUser-Agent.error code: 1010(a block on the client's signature). curl and browser User-Agents still get 200:main.shmakes the same request, so a newer version of the action wouldn't help.Publish Python package. Only jobs that restored a cached Poetry install got through.The change
All 8 uses of the action (7 in
ci.yml, 1 incd.yml) become:ubuntu-latest).dockerfiles/test.Dockerfilealready installs Poetry this way.poetry configforvirtualenvs.create,virtualenvs.in-projectandinstaller.parallel. Both workflows already set these asPOETRY_*env vars, which Poetry reads ahead of its config file.--python: keeps Poetry on thesetup-pythoninterpreter, as the action did.PIPX_HOME=/opt/pipxandPIPX_BIN_DIR=/opt/pipx_bin(install-python.sh). The two jobs that cache~/.localfor their Poetry install (CI Test and CD Publish) therefore redirect pipx into~/.local. Without that, the cache would save nothing, and a later cache hit would leavepoetrymissing. Existing cache entries in the old layout still restore and work.2. and 3. Dependency bumps
Audit
poetry export <matrix export-args> -f requirements.txt, thenpypa/gh-action-pip-auditwithrequire-hashes: true,disable-pip: true, ignoringPYSEC-2024-161andPYSEC-2026-113, on Python 3.11 (.github/workflows/ci.yml,auditjob).--without dev), Server (--extras server), Dev (--only dev).oauthlib4.0.0 (CVE-2026-49272), onmaintoo.Precedent
pyproject.toml, with a trailing comment that says why (fix(deps): resolve pip-audit failures for snowflake-sqlalchemy, thrift and tornado #126, fix(deps): resolve pip-audit failures #133, fix(deps): resolve pip-audit failures for pymongo, dnspython, oauthlib and pylint #145).poetry.lockblocks andcontent-hashare spliced in, because a plainpoetry lockwith Poetry 2.2.0 also drops about 20 unrelated older-Python entries (fix(deps): resolve pip-audit failures for pillow, gitpython, certifi and black #143–fix(deps): resolve pip-audit failures for tornado and pyasn1 #146).psycopg2-binary 2.9.11 → 2.9.13 (from #148)
<3ceiling.<2.10to<3, which changes nothing today because no 2.10 exists.DEEPNOTE_ENFORCE_PIP_CONSTRAINTSis on, the published constraints file now rejects user pins below 2.9.13.Verified
wait_selectcallback: interval, bytea and extreme int8 values in an array parse correctly, andstatement_timeoutcancellation works.oauthlib 4.0.0 → 4.0.1
AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N). The RFC 8628 device-flow token endpoint did not validatedevice_code.databricks-sql-connector(oauthlib>=3.1.0,<5.0.0); the toolkit never imports oauthlib.device_codedefault onRequest, and rewords one error message. The connector uses oauthlib as a client (WebApplicationClient,OAuth2Error), so none of its calls changed and the toolkit was never exploitable. Still, the fix is a patch release, so this follows the precedent of bumping rather than adding an ignore.Verified
databricks.sql.auth.oauthimports, and the connector's client calls give the same output on 4.0.0 and 4.0.1.Decided with the user
Checks
mainpoetry check --lock(Poetry 2.2.0)poetry lockpsycopg2-binary,oauthlibandcontent-hashdiffer frommainpytest tests/uniton Python 3.13ab9f127ab9f127Publish Python packageand the artifact pushesNot fixed
The CI audits run on Python 3.11 only. An all-extras + dev export audited on Python 3.10 still shows pillow, dnspython, tornado, filelock and virtualenv. These are the exposures accepted in #143–#146, because none of their fixed versions supports Python 3.10. This PR leaves them unchanged.