Add support for pypi packages in the registry#392
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9700af87f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
slimslenderslacks
left a comment
There was a problem hiding this comment.
I have one question about this but I'll put it in Slack
| ) | ||
|
|
||
| const ( | ||
| defaultPythonVersion = "3.14" |
There was a problem hiding this comment.
bleeding edge, but that's probably the right posture.
There was a problem hiding this comment.
This will probably get slightly annoying because we'll have to keep it up to date, but hard-coding it is a quick way to have it in lieu of a better mechanism.
| allMatches := re.FindAllStringSubmatch(requiresPython, -1) | ||
|
|
||
| // If any >= or > constraint exists, the package supports newer versions — use latest | ||
| for _, m := range allMatches { |
There was a problem hiding this comment.
do we need to test ~ versions
There was a problem hiding this comment.
Yep, this is handled on line 105.
pkg/catalog/registry_to_catalog.go
Outdated
| command = append(command, pkg.Identifier) | ||
|
|
||
| // Add uv cache volume | ||
| volumes = []string{"docker-mcp-uv-cache:/root/.cache/uv"} |
There was a problem hiding this comment.
Just confirming here but this is always correct because the container we use here is always running as root.
There was a problem hiding this comment.
Would you be able to verify that the second run will always be fast and will not need access to pypi? I'm just thinking about creating a profile, and then needing it to run at least once before going offline (for packages that don't otherwise need networks)
There was a problem hiding this comment.
Also, just to confirm, online and already cached takes the same amount of time as offline and already cached.
pkg/catalog/pypi.go
Outdated
| } | ||
|
|
||
| // Match all operator-version pairs in the specifier | ||
| re := regexp.MustCompile(`(~=|==|!=|<=|>=|<|>)\s*(\d+)(?:\.(\d+))?`) |
There was a problem hiding this comment.
Probably don't need to compile this on every parse
There was a problem hiding this comment.
Good point. Updated this.
ba15d28
|
I made a few updates:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 291d114d85
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

What I did
Adds basic support for pypi packages in the community registry.
servertype snapshot, like oci imagesghcr.io/astral-sh/uv:python{version}-bookworm-slimimage to run uvx.docker-mcp-uv-cache:/root/.cache/uvdocker-mcp-uv-cache-<server_name>:/root/.cache/uvYou can try it with this example:
Related issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did