Skip to content

Replace unix socket package - #430

Merged
jreadey merged 2 commits into
HDFGroup:masterfrom
mattjala:unixsocket2
Aug 19, 2025
Merged

jreadey merged 2 commits into
HDFGroup:masterfrom
mattjala:unixsocket2

Conversation

@mattjala

@mattjala mattjala commented Jun 30, 2025 •

Copy link
Copy Markdown
Collaborator
  • Replace deprecated unixsocket dependency with a fork that is still maintained

The original package is incompatible with requests 2.32.0+.


Important

Replace deprecated requests-unixsocket with requests-unixsocket2 and update related dependencies for compatibility with requests 2.32.0+.

  • Dependencies:
    • Replace requests-unixsocket with requests-unixsocket2 in Pipfile, pyproject.toml, and requirements.txt.
    • Update requests version constraint to <=2.32.4 in Pipfile, pyproject.toml, and requirements.txt.
    • Update urllib3 version constraint to >=2.4.0,<3.0 in Pipfile, pyproject.toml, and requirements.txt.
    • Relax aiobotocore version constraint to >=2.13.0 in Pipfile, pyproject.toml, and requirements.txt.
  • CI/CD:
    • Remove commented-out step for fixing requests version in .github/workflows/python-package.yml.

This description was created by Ellipsis for c071fa4. You can customize this summary. It will automatically update as commits are pushed.

@mattjala mattjala self-assigned this Jun 30, 2025
@mattjala mattjala added the dependencies Pull requests that update a dependency file label Jun 30, 2025
@mattjala

Copy link
Copy Markdown
Collaborator Author

Botocore and the replacement for unixsocket have an unavoidable dependency conflict for Python 3.9. Options for resolving this are to drop support for Python 3.9, freeze requests/urllib/requests-unixsocket at their current version, or replace requests-unixsocket with something else

@jreadey

jreadey commented Jul 1, 2025

Copy link
Copy Markdown
Member

I'd vote to drop support for Unix Sockets. Originally I was thinking that this might be a performance enhancement for clients and servers on the same host, but it's marginal if anything. Also, I think there can be problems when two clients are using the same socket connection.

If we go this way, the ruanll.sh script should change the --no-docker option to use TCP rather than sockets.

@jreadey

jreadey commented Aug 15, 2025

Copy link
Copy Markdown
Member

Actually we use unix sockets in hsds_app.py, and I prefer not to update the code to use tcp sockets.
Let's go with changing the unix-socket to use the gitlab project.

@jreadey jreadey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's go with this. I'll submit a PR to remove Python 3.9 support

@jreadey
jreadey marked this pull request as ready for review August 19, 2025 09:54
@jreadey
jreadey merged commit e36464c into HDFGroup:master Aug 19, 2025
@mattjala mattjala mentioned this pull request Aug 19, 2025
mattjala added a commit to mattjala/hsds that referenced this pull request Sep 2, 2026
Nothing in the tree references either file - no workflow, script, or
doc - and they contradict pyproject.toml on nearly every axis they share:
numpy <2.0.0 against >=2.0.0, aiohttp ==3.10.2 against ==3.9.4,
python_version 3.10 against requires-python >=3.11, and
requests-unixsocket2 from GitLab, which HDFGroup#430 replaced with
requests-unixsocket. They also omit h5json entirely.

An environment built from them would not match what HSDS declares it
needs, so they are worse than absent.
mattjala added a commit that referenced this pull request Sep 2, 2026
The cap dates to #363 (2024-05), where 'requests <= 2.31.0' accompanied
'urllib3 < 2.0.0' as the workaround for requests-unixsocket 0.3.x, which
raised 'TypeError: HTTPConnection.request() got an unexpected keyword
argument chunked' under urllib3 2.x.

#430 removed the reason for it: replacing the socket package let urllib3
move to >= 2.4.0 - but the cap was raised to 2.32.4 rather than dropped,
2.32.4 being simply the current release that week. It has bounded the
dependency ever since without a live constraint behind it.

requests-unixsocket 0.4.1 asks only for requests >= 1.1, and a real
request over a unix socket with requests 2.33.0 and urllib3 2.7.0
returns 200, so the pairing the cap protected is fine. Drop the bound
and move the pinned requirement to 2.33.0 so CI exercises it - the
socket tests are the ones that would notice a regression here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants