Support maison 2.0.0
Description
It seems that the new release of maison is breaking autoimport.
As per https://github.com/dbatten5/maison/releases:
- Renaming
ProjectConfigtoUserConfig
Steps to reproduce
$ autoimport --version
Traceback (most recent call last):
File "../bin/autoimport", line 5, in <module>
from autoimport.entrypoints.cli import cli
File "../lib/python3.12/site-packages/autoimport/entrypoints/cli.py", line 12, in <module>
from maison.config import ProjectConfig
ImportError: cannot import name 'ProjectConfig' from 'maison.config' (../lib/python3.12/site-packages/maison/config.py)
Current behavior
Desired behavior
No error, autoimport runs :)
Environment
autoimport==1.6.0
Just bumped into this too while installing on a new system.
# I installed with pipx
pipx install autoimport
autoimport
# fails with:
# ImportError: cannot import name 'ProjectConfig' from 'maison.config' (/home/erb/.local/share/pipx/venvs/autoimport/lib/python3.12/site-packages/maison/config.py)
# fix
pipx inject autoimport 'maison<2' --force
autoimport
# works!
I didn't see the prior PR but I've opened another one that address rebuilding the pdm lockfile and adds an entry to the changelog. Feel free to close it as a dupe, or whatever. https://github.com/lyz-code/autoimport/pull/261
This has been patched by @zhou13 by pinning maison <2.0.0 and released under 1.6.1. I'll rename the issue to track the support of > 2.0.0.
If you're interested in fixing this issue @cjwatson has started this work here