Skip to content

Bound runtime dependency ranges and pin build backend - #103

Open
lelia wants to merge 4 commits into
mainfrom
lelia/bound-runtime-dependency-ranges
Open

Bound runtime dependency ranges and pin build backend#103
lelia wants to merge 4 commits into
mainfrom
lelia/bound-runtime-dependency-ranges

Conversation

@lelia

@lelia lelia commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Companion to the socket-python-cli dependency pinning work (SocketDev/socket-python-cli#289). The SDK's runtime dependencies were under-constrained:

  • requests was fully unbounded — a fresh install could resolve to any just-published release, which is both a supply-chain exposure and a problem for consumers running Socket Firewall with a cooldown policy.
  • typing-extensions>=4.12.2 had no upper bound.
  • The hatchling build backend was unpinned for sdist builds.

Changes

  • requests>=2.32.5,<3 and typing-extensions>=4.12.2,<5 — floors match the versions already resolved and tested in uv.lock; ceilings exclude the next major.
  • hatchling==1.31.0 in [build-system] (isolated build env, so an exact pin can't conflict with consumer environments).
  • Version bump to 3.5.0 (the new requests floor is a newly binding constraint for consumers on older versions, so minor rather than patch) and uv lock regenerated.
  • Seeded a CHANGELOG.md (the repo had none) in the socket-python-cli format: a curated 3.5.0 entry, plus the full history backfilled from the auto-generated GitHub release notes (all 53 published releases, dated, pre-releases labeled).

Why bounded ranges instead of exact pins

socketdev is a library, so it deliberately gets the library-appropriate version of the CLI's hardening rather than a copy of it. Exact == pins in a library's metadata become resolver constraints in every consumer's environment: socket-python-cli 2.6.0+ pins its entire runtime closure exactly (e.g. requests==2.34.2), and if this package pinned requests==2.32.5, every CLI install would fail with an unsatisfiable conflict — likewise for any downstream user who pins their own dependencies. Ranges here + exact pins in applications compose; pins in both places must move in lockstep forever.

Reproducibility for this repo's own development and CI is already handled where it belongs: the committed uv.lock (enforced with uv sync --locked in CI) and Dependabot on the uv ecosystem with a 7-day cooldown.

Testing

  • uv lock regenerated cleanly; only the project version entry changed (both floors were already the locked versions).
  • Test suite matches the main baseline exactly (183 passed; the same pre-existing integration-test failures requiring live API credentials fail identically on main).

Ref: CE-359


Note

Low Risk
Dependency and packaging metadata only; no SDK runtime code changes, though the new requests floor may affect installs on older requests versions.

Overview
Release 3.5.0 tightens packaging metadata and documents it: runtime deps in pyproject.toml are now requests>=2.32.5,<3 (was unbounded) and typing-extensions>=4.12.2,<5 (no prior upper cap), with matching requires-dist updates in uv.lock. The sdist build backend is pinned to hatchling==1.31.0 in [build-system].

socketdev/version.py is bumped to 3.5.0 (minor, because the new requests floor can reject older consumer installs). A new CHANGELOG.md adds a curated 3.5.0 section and backfills prior releases from GitHub release notes.

Reviewed by Cursor Bugbot for commit 934d491. Configure here.

Add version bounds to the runtime dependencies: requests was fully
unbounded and typing-extensions had no upper bound, so a fresh install
could resolve either to any just-published release. As a library,
socketdev declares bounded ranges rather than exact pins - exact pins
in package metadata would conflict with consumers that pin their own
dependencies, including socket-python-cli, which pins its entire
runtime closure (socketsecurity 2.5.10+) and relies on this package's
ranges staying compatible.

Floors match the versions already resolved and tested in uv.lock;
ceilings exclude the next major. Also pins the hatchling build backend
used for sdist builds. Dependabot (uv ecosystem, 7-day cooldown)
already keeps the lockfile fresh within these bounds.

Companion to the socket-python-cli dependency pinning work (CE-359).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia
lelia requested a review from a team as a code owner August 6, 2026 02:30
@lelia
lelia temporarily deployed to socket-firewall August 6, 2026 02:31 — with GitHub Actions Inactive
Seed a changelog in the socket-python-cli format, starting at 3.4.3,
with a pointer to GitHub releases for earlier history.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia
lelia temporarily deployed to socket-firewall August 6, 2026 02:34 — with GitHub Actions Inactive
Import all 53 published releases (v1.0.15 through v3.4.2) from the
auto-generated GitHub release notes: one dated entry per version,
pre-releases labeled, body headings demoted one level so version
headings stay the top-level structure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia
lelia temporarily deployed to socket-firewall August 6, 2026 02:40 — with GitHub Actions Inactive
The new requests floor is a newly binding constraint for consumers on
older versions, so this warrants a minor bump rather than a patch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia
lelia deployed to socket-firewall August 6, 2026 02:57 — with GitHub Actions Active
@lelia

lelia commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Incomplete package version bump
    • Updated pyproject.toml and uv.lock from 3.4.2 to 3.5.0 so packaging metadata matches socketdev/version.py and CHANGELOG.md.

Create PR

Or push these changes by commenting:

@cursor push 804710c344
Preview (804710c344)
diff --git a/pyproject.toml b/pyproject.toml
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@
 
 [project]
 name = "socketdev"
-version = "3.4.2"
+version = "3.5.0"
 requires-python = ">= 3.9"
 dependencies = [
     'requests>=2.32.5,<3',

diff --git a/uv.lock b/uv.lock
--- a/uv.lock
+++ b/uv.lock
@@ -1353,7 +1353,7 @@
 
 [[package]]
 name = "socketdev"
-version = "3.4.2"
+version = "3.5.0"
 source = { editable = "." }
 dependencies = [
     { name = "requests" },

You can send follow-ups to the cloud agent here.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 934d491. Configure here.

Comment thread pyproject.toml
dependencies = [
'requests',
'typing-extensions>=4.12.2'
'requests>=2.32.5,<3',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Incomplete package version bump

High Severity

The [project].version in pyproject.toml remains 3.4.2, while socketdev/version.py and CHANGELOG.md are updated to 3.5.0. Because the pyproject.toml version is static, this mismatch causes packaging metadata and uv.lock to reflect 3.4.2, even though runtime __version__ reports 3.5.0. This discrepancy can block or mis-publish the intended release.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 934d491. Configure here.

Comment thread pyproject.toml
@@ -1,14 +1,14 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling==1.31.0"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Build pin breaks Python 3.9

Medium Severity

Pinning hatchling==1.31.0 in [build-system] introduces a conflict: this version requires Python 3.10+, while requires-python still supports 3.9. This prevents builds and installs on Python 3.9 environments.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 934d491. Configure here.

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.

1 participant