What the agent does
Before Python 3.10, importlib.metadata.entry_points() returned a dictionary keyed by group, and code read a plugin group with .get("my.group", []). Python 3.12 returns an EntryPoints object with no get method, so that line raises the error in the title. The agent finds each call and what runs it. In python-gino/gino there are two. src/gino/ext/__init__.py builds its table of extension modules from entry_points().get("gino.extensions", []) inside a finder class, and the last line of the file creates and installs that finder. src/gino/ext/__main__.py makes the same call for the python -m gino.ext stub command. Because the first runs at import, from gino.ext.starlette import Gino, the line the project's documentation tells users to write, fails on 3.12 before any extension is looked up.
The agent reproduces the three stages on separate interpreters, since the history explains the fix. On 3.9 the module loads and the result is a plain dict. On 3.10 and 3.11 it loads and prints DeprecationWarning: SelectableGroups dict interface is deprecated. Use select. On 3.12 it raises. The replacement is entry_points(group="gino.extensions"), which returns just that group's entries. That call has its own floor: on 3.9 it fails with TypeError: entry_points() got an unexpected keyword argument 'group'.
So the fix depends on which versions the project still claims, and the agent reads that from the repository instead of guessing. gino's pyproject.toml says python = "^3.6", depends on the importlib_metadata backport below 3.8, and its CI workflow tests 3.6 through 3.10. With that range a bare keyword call would trade a failure on 3.12 for one on 3.9. The agent offers the two honest answers. One keeps the range with a small helper that passes group and falls back to the dictionary lookup when the call raises TypeError. The other requires a recent importlib_metadata on every version, where the keyword form always works, and drops the helper. It also checks whether the rest of the package installs on the interpreter that raised the error, here a pinned SQLAlchemy below 1.4, and reports that separately so one pull request does not claim more than it fixed.
Tests need the same care as the code. tests/test_ext.py replaces gino.ext.entry_points with a function that takes no arguments and returns a dictionary, which is the old interface written into a mock. Once the code passes group, that stand-in fails with the TypeError above. The agent updates it to accept the keyword and return a list, and adds a test that runs the real lookup with no mock, so the suite fails the next time the standard library changes this API.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "This project fails on Python 3.12 with \"AttributeError: 'EntryPoints' object has no attribute 'get'\". Find every use of the old dictionary interface of importlib.metadata.entry_points() or the importlib_metadata backport: .get(group), [group], .items(), .keys() or iterating the result as a dict. For each call, say what runs it: an import, a command, or a plugin loader. Reproduce the behaviour on three interpreters and save the output: one where the result is a dict, one where it works with a DeprecationWarning, and Python 3.12 where it raises. Read which Python versions the project supports from its packaging metadata and CI configuration. Replace each call with entry_points(group=...) in a way that works on every supported version: if the project supports versions where the group keyword is not accepted, either add one small helper used by all call sites or raise the minimum importlib_metadata backport, and say which you chose and why. Do not leave two different lookups in two files. Update any test that mocks entry_points with the old dictionary shape, and add a test that exercises the real lookup without a mock. Then try to install and import the package on Python 3.12 and report, without fixing them in this pull request, any other dependency that blocks it. Run the tests you can on each interpreter. Open a pull request with the three outputs, the test results and the list of anything left for later.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
A pull request with a small diff in two source files and one test file, plus a dependency line if the backport route was taken. The description shows the same import on three interpreters: the dictionary, the warning and the traceback, then the import succeeding on 3.12 after the change. It says which Python versions the change was run on and which it could not run on, with the reason.
A reviewer checks that both call sites use one helper, that the oldest supported interpreter still loads the module, and that the new test does not mock the function it is meant to watch. A separate section lists what else stands between the package and 3.12. That section is the honest part of the result: fixing this error is necessary for the newer interpreter and may not be sufficient, and the description says so instead of implying the package now supports it.
Run it on every traceback in your terminal
This error tends to appear in the middle of something else: you move a service to a newer Python, start it, and an import you did not write fails. Hand the detour off from where you are. Rush is an MCP server at https://api.phoenix.so/mcp; connected to the coding agent in your terminal with an API key, it gives that agent a create_session tool. Tell it to start a session with this page's request and your repository, and keep working. create_session returns at once, and wait_for_sessions waits up to 50 seconds per call when you want the answer.
The same request works from a script. If you maintain several packages with plugin loaders, send one request per repository and give each a request_id, a UUID v5 of the repository's name, so running the script again does not start a second run for the same one.
The use case this job follows, with its automation and trigger: Hand off a long task.
Why run it on Rush?
Showing all three behaviours takes three interpreters in clean environments, and the middle one matters: the deprecation warning on 3.10 and 3.11 is how you learn which other projects of yours are one upgrade away from the same error. The agent installs each interpreter in its sandbox and keeps the output of every import with the session, so the pull request's three stages are evidence and not a description from memory.
The work is also easy to get half right. The obvious one-line change fixes the newest Python and breaks the oldest supported one, and a mocked test hides both outcomes. A run that reads the supported range from the repository and executes the lookup on each end of it catches that before a user does. Meanwhile your terminal stays on the upgrade you were doing.
Frequently asked questions
What replaces entry_points().get()?
entry_points(group="name"), which returns the entries of that group and an empty result when there are none. It is accepted from Python 3.10 and by recent releases of the importlib_metadata backport. entry_points().select(group="name") is the same selection written as a method.
Why did this work on Python 3.10 and 3.11?
Those versions return an object that still answers the dictionary methods and warns each time one is used. Python 3.12 dropped that compatibility layer. If your logs on 3.10 or 3.11 show the SelectableGroups warning, the same code raises on 3.12.
Can I use entry_points(group=...) if I still support Python 3.8 or 3.9?
Not with the standard-library function alone; it raises TypeError there. Either depend on the importlib_metadata backport for those versions and import from it, or wrap the call in one helper that falls back to the dictionary lookup.
The error comes from a library I installed, not my code. What then?
The agent does not edit installed packages. It finds which requirement contains the call, checks whether a newer release has fixed it, and proposes the version bump. If no fixed release exists, it reports that and the choices left: pin the interpreter, or carry a patch.
More jobs like this: Hand off a long task
- Fix "ImportError: cannot import name 'gcd' from 'fractions'" in Python 3.9+ (fractions)
- Fix "go: go.mod file not found in current directory or any parent directory" (GOPATH)
- Fix golangci-lint Findings in a Go CLI and Make Lint Block Merges (Go CLI)
- Fix N+1 Queries in a Gin API (Gin)
- Fix N+1 KV Reads in a Hono API (Hono)
- Fix N+1 Queries in a Flask + SQLAlchemy App (SQLAlchemy)